News for hackers. Stuff that matters.
Re:The melting pot of JavaScript (2017) by _hardwaregeek on Monday January 07, 2019 @02:35PM (#18849098)
Very nice points here. I've always been struck at how the JavaScript community never really adopted the Rails ideas of convention over configuration and optimizing for developer happiness. While it's easy to roll one's eyes at the marketing lingo, these principles do truly make Rails a charm to use. Right now, even setting up the most simple Webpack-Babel-Node config requires writing a whole lot of config and set up for very little gain.
Re:The melting pot of JavaScript (2017) by lewisjoe on Monday January 07, 2019 @02:43PM (#18849180)
Rails (or Python or Java) doesn't really fit into the problem set that JS has to go through. Most softwares written in those tech stay in the server with no need of transpiling, no need of code splitting when built, no need to be sent over the wire, etc.

While I agree the package management in JS could have been better, most other too-much-config problem is just because of the variety of problems and the variety of potential solutions.

Re:The melting pot of JavaScript (2017) by _hardwaregeek on Monday January 07, 2019 @04:38PM (#18850429)
I'm not so sure about that. While there are a lot of complicated situations for JS dev, there's also a lot of similar patterns. I'm not saying we need to ignore the various complexities involved in JS dev, but we should make the general patterns easier to solve. Yes, of course transpilation can have all these different edge cases. But we should be able to have some preset modes that can do 90% of the work automatically. Like it baffles the mind that I still need to tell webpack that JSX files should be loaded by babel.

And anyways, there's the entire backend JS ecosystem, which is extremely behind Rails in developer ergonomics. I can spin up a REST API in Rails in half the time it takes to connect Node to a database.

Re:The melting pot of JavaScript (2017) by soneca on Monday January 07, 2019 @05:46PM (#18851051)
Ember is exactly that. I love it and use it on my day job and on my side-project. But overall it doesn't have much adoption and no perspective to grow anymore.
Re:The melting pot of JavaScript (2017) by _hardwaregeek on Monday January 07, 2019 @06:17PM (#18851309)
I've wanted to use Ember, but I've never bothered to sit down and learn it. What ever happened to Glimmer? I remember it being hyped up as a crazy fast virtual DOM, but I haven't heard anything recently.
Re:The melting pot of JavaScript (2017) by vmware505 on Monday January 07, 2019 @10:02PM (#18852740)
It is super easy to pick up, you can understand the whole concept quite quickly. Follow one the tutorial and you will be ready to deploy new apps in days. One of my fav free tutorial: https://www.yoember.com
Re:The melting pot of JavaScript (2017) by _hardwaregeek on Monday January 07, 2019 @10:15PM (#18852813)
Thank you for the link! For some reason it gives a "Your connection is not secure" error on Firefox, but I managed to find the tutorial via Google. I'll give it a shot sometime
Re:The melting pot of JavaScript (2017) by vmware505 on Tuesday January 08, 2019 @07:17AM (#18854982)
yep, without www: https://yoember.com
Re:The melting pot of JavaScript (2017) by soneca on Monday January 07, 2019 @06:31PM (#18851409)
It was incorporated as the UI engine for Ember for some versions already for now.

Nothing revolutionary, but a good UI lib

Re:The melting pot of JavaScript (2017) by undersheet on Monday January 07, 2019 @03:56PM (#18849976)
In JS there is a lot of convention but on a micro level. The times of monolithic Rails apps which have strict conventions are over and it's good: Too much magic and strict conventions often forced devs into patterns which didn't match the use case. Even experienced Rails devs tried to solve every problem the same way.

You also confusing matters. You need Webpack, Babel etc for the frontend not the backend. And even in the frontend it got abstracted away by things like creat-react-app. So you shouldn't them see them too often.

Re:The melting pot of JavaScript (2017) by _hardwaregeek on Monday January 07, 2019 @04:30PM (#18850340)
First, Webpack and Babel are totally used for backend. If you look at a lot of Node libraries, they use ES6 modules in their [docs](https://github.com/graphql/graphql-js). While you could use mjs for this, it's still experimental.

I do think create-react-app is a good innovation in the JS world. However, I've never found a good equivalent on the back end. Setting up even the most basic CRUD REST API requires a whole lot of typing for very little reward.

As for convention, I think JS could do with more of it. I find that when I talk about adding more convention, people take it quite literally as "we need to reinvent Rails in JS". That's not at all what I mean. Convention can be something as simple as Rack, which is a consistent, useful interface between servers. Convention does not and is not tied to monoliths or MVC or any other aspect of Rails.

Re:The melting pot of JavaScript (2017) by com2kid on Monday January 07, 2019 @08:48PM (#18852318)
> I do think create-react-app is a good innovation in the JS world. However, I've never found a good equivalent on the back end. Setting up even the most basic CRUD REST API requires a whole lot of typing for very little reward.

This is where services like Google Firebase Functions become useful.

I went from having never written a REST API in my life, to up and running in under 20 minutes.

First time I went to create some endpoints on my own server, wow, that was a pain.

Re:The melting pot of JavaScript (2017) by _hardwaregeek on Monday January 07, 2019 @10:23PM (#18852848)
Firebase is a dream. It's almost a shame they got bought by Google because it's such a fantastic idea. All of the things I used to dread setting up (auth, deployment, serverless) are automated and dead easy. The documentation is clear and caters to the common usecases. I managed to set up a Sendgrid email that sends on database writes within an hour or two.
Re:The melting pot of JavaScript (2017) by com2kid on Tuesday January 08, 2019 @12:45PM (#18857571)
> The documentation is clear and caters to the common usecases.

I wouldn't quite say that, but I'll agree with your other points. :)

(More than once the docs have been out of date, or just flat out wrong, costing me many hours of development time...)

Re:The melting pot of JavaScript (2017) by undersheet on Monday January 07, 2019 @10:18PM (#18852826)
JS is so good for APIS because of its dynamic JS objects. If you then take also a document storage you don't need any ORM anymore and write your entire API in 5 mins. Rails was a nightmare compared. JS lets you do stuff yourself. You don't any framework holding your hand. Maybe that's your problem.
Re:The melting pot of JavaScript (2017) by Daishiman on Tuesday January 08, 2019 @01:58AM (#18853838)
In what world you think the usability of a language is determined by being able to get a Restful API up in 5 minutes?

Yeah, document storage for business-critical data. I'll pass. There's a reason important data gets stored in Postgres.

Re:The melting pot of JavaScript (2017) by matchbok on Monday January 07, 2019 @06:15PM (#18851287)
Simply not true. Rails continues to be the choice for many companies who don't base tech choices on what the latest bandwagon is.

JS is mess.

Re:The melting pot of JavaScript (2017) by h1d on Tuesday January 08, 2019 @01:50AM (#18853806)
Rails is so much into its own world I hate it. Glad JS is developing in different ways. Try parcel bundled, it's zero config yet it doesn't invent its own world to freak newcomers.
Re:The melting pot of JavaScript (2017) by tuesdayrain on Monday January 07, 2019 @04:12PM (#18850145)
Gatsby is pretty much a superior version of ruby on rails in my experience. I don't remember the last time I had to touch webpack.