News for hackers. Stuff that matters.
Re:The state of JavaScript modules by git-pull on Monday May 29, 2017 @02:50AM (#14437782)
I support innovation and people who like to code and build great things. And am happy to see JS is getting these features. I even see a downvoted comment to "just use amdefine". Well that solution worked fine for me, then 5 years of amazing hop scotch between build tools and libraries happened.

And while some report benefits and advancement, I have to tell you, the amount of tools you have to pull in these days just get some single page interaction going... Just stop. And we need to draw a line between "progress" for the language and its libraries vs introducing features without discipline. The more features a language has, the harder it will be for open source and industry to develop consensus on what's idiomatic.

Want to know another language feature? Being stable.

I swear, it's like the language reinvents itself every year. Give me some sort of promise when you'll leave the standard alone, then I'll wait for the community to form best practices / libraries to catch up. After the dust settles, I'll invest time reading up on the standard.

Ain't trying to jab javascript. Love the language, community is top tier, but everything these days from build tools to libraries seems like a moving target.

Re:The state of JavaScript modules by hdhzy on Monday May 29, 2017 @03:13AM (#14437846)
Well, in ancient ES3 times all we had was functions and so we used functions for everything and that was good as they are extremely versatile. But now a different problem appeared: it's hard to statically analyze function-based constructs for various purposes (tree shaking, refactoring, etc.) so new syntax was invented to capture what was convention inside the language itself. If you look at classes they are "just" syntactic sugar that works just like good ol' prototype system. But the one key difference is that this is now easier to statically analyze.

The same happens with modules although having written several require.js like loaders I find the ES system a little bit lacking.

> I swear, it's like the language reinvents itself every year. Give me some sort of promise when you'll leave the standard alone, then I'll wait for the community to form best practices / libraries to catch up. After the dust settles, I'll invest time reading up on the standard.

Sorry to disappoint you but this will never happen, especially not in JavaScript. Actually the standard is released every year that's why we have ES2015, ES2016... But that's just the way things work in IT: people keep changing things and we are supposed to follow.

> ... seems like a moving target.

Yes, exactly. But that seems to be "by design" rather than "by accident", see Fire and Motion [0].

[0]: https://www.joelonsoftware.com/2002/01/06/fire-and-motion/

Re:The state of JavaScript modules by bcherny on Monday May 29, 2017 @06:15AM (#14438387)
Can you give some examples (or better, a writeup) about how static analysis is hard without classes? It seems like Haskell gets along fine without it.
Re:The state of JavaScript modules by hdhzy on Monday May 29, 2017 @07:05AM (#14438510)
I meant higher level constructs. Classes are just an example. Even in Haskell you have typeclasses and modules. The point is that even though in JavaScript (and other Turing complete languages) you can emulate anything with what is available (for JS that is functions) you cannot easily build tooling around your ad hoc constructs.
Re:The state of JavaScript modules by bcherny on Monday May 29, 2017 @07:31AM (#14438575)
Again, maybe a concrete example would help?
Re:The state of JavaScript modules by hdhzy on Monday May 29, 2017 @07:42AM (#14438618)
Import/export statements vs require() calls?

  const x = require;
  const m = x('crypto');
Here I'm requiring a module but it's hard to follow for a tool that Crypto is being imported.

The proliferation of class systems in JS before ES6 classes. Building a tool (IDE for example) to support all of them would be a complex problem.

See also interviews with Anders Hejlsberg (e.g. [0]) where he explicitly mentions that TypeScript type system's primary focus is allowing better tooling support for developers (like press dot and see what's there, safe refactorings).

[0]: https://devchat.tv/js-jabber/209-jsj-typescript-with-anders-...

Re:The state of JavaScript modules by bcherny on Thursday June 01, 2017 @05:57AM (#14459051)
Not sure I see what you're saying.

Requires are impossible to statically analyze in some pathological cases, which is why more rigidly defined imports made it into the ES2015 spec.

That's totally unrelated to classes vs. functions or any of the other things you've mentioned.

Re:The state of JavaScript modules by Illniyar on Monday May 29, 2017 @06:13AM (#14438382)
I think that the feeling of "too much churn" that surrounds JS development is really people not fully realizing two things:

1 - the magnitude of the language's popularity.

2 - just how young modern javascript really is.

Javascript is either the most popular language in the world, or the second most popular after C. Even in in Java's height somewhere in the early 2000s it was never as popular as JS is right now, and it was much more homogeneous in terms of developers - js is written by designers, people with no formal education, even children.

Modern javascript is only a few years old, even jQuery came out just 10 years ago, but javascript that was used not as a scripting language really only came with the popularity of chrome and SPAs, somewhere around 6-7 years ago.

Taking these things into perspective, I don't think it's reasonable to expect (or request) for JS development to stabilize - Java is still not stable 20 years in, and it was in a similar state of upheaval as JS as recent as 8 years ago.

C is so decentralized that we don't even think about it's stability the same way we do other languages - there were (and maybe still are) multiple competing standards for the language itself, and compilers regularly won't compile code that works in other compilers.

Re:The state of JavaScript modules by pdimitar on Monday May 29, 2017 @09:03AM (#14438878)
It's not about (1) other languages having trouble as well, and (2) it sure as hell is not about JS being very popular.

It's about this: I wrote a module for my project, I want to import it in my project and everywhere else where it might be useful, in one, SINGULAR way, which doesn't change for at least 18 months, please. I'd like to be able to write ES 2016/2017 and not caring how it gets compiled to ES5; can't you people just finally agree on one way of doing things?

You people who mostly (or exclusively) code JS simply don't understand that many of us code in 5+ languages every week and we want to be productive.

If I have to read on a new standard and a new and shiny way of managing dependencies every 8-10 weeks and if you think that's okay, then you seem to fail to grasp how unproductive this is. For you it might be a full-time job. For me, and many others, it's a distraction because we have to do a lot of stuff in several languages and we'd much appreciate it if the JS folk would just calm the hell down for a bit.

Re:The state of JavaScript modules by bryanlarsen on Monday May 29, 2017 @09:32AM (#14438997)
The article explains the approach that the node.js ecosystem is taking to bend over backwards and maintain full backwards compatibility. Javascript from 1997 still works; write your code 2015 style and it'll still work 20 years from now. You don't have to live on the bleeding edge -- you'll lose tree shaking but you'll gain some sanity.
Re:The state of JavaScript modules by pdimitar on Monday May 29, 2017 @09:39AM (#14439029)
No disagreement on that point. I am talking about new and maintenance projects. My pet peeve is "just install this, just use that, oh and by the way also definitely install this" for things that should either be built-in, or well-standardized (minifiers, tree-shaking, transpiling). And they are not.

If I get into a new team and there are 3 devs already writing JS, it's highly unproductive because it feels like you have to very regularly catch up with the JS ecosystem. Not to mention the strong peer-pressure factor of "cool kids use X, Y or Z". And this is a very underestimated phenomena by so many devs -- and it exists in almost every team.

Re:The state of JavaScript modules by bryanlarsen on Monday May 29, 2017 @09:47AM (#14439060)
"minifiers, tree-shaking, transpiling" should not have been part of 1997 Javascript so they have to be added at some point. And this post is part of that standardization that you're asking for.
Re:The state of JavaScript modules by jmkni on Monday May 29, 2017 @10:05AM (#14439127)
I feel as though I got burned a bit with AngularJS.

I went all out with it, learned it inside out, learned how to use Gulp, Bower, etc.

Then along comes Angular2 and it's completely different. Bower is deprecated, Gulp isn't widely used any more. It's all WebPack and Yarn.

I have spent some time with Angular2 and it is good. There's a lot to like, but it is exhausting having to learn everything I already know how to do in AngularJS again in a different framework, especially when I know I could just fire up AngularJS, get the old gang back together with Gulp/Bower etc and be done in a fraction of the time, because there's nothing new to learn.

So I've been learning Android development (in the context of Xamarin.Android) over the past year, and I am now at the point where I can do pretty much whatever I want to do in Android comfortably, and have shipped a couple of apps.

In the past month I've been learning Xamarin.iOS and it is starting to (slowly) click with me. I'm getting close to that know enough to be dangerous phase.

I feel as though these are better investments of my time. I am confident that Android and iOS will still be around in five years. Even if Xamarin isn't, Xamarin maps so closely to native development that if Microsoft gets bored of it, I could use Android Studio and XCode instead and still know what's going on.

I can't say the same for Angular, React, Vue, Webpack, Yarn, Aurelia, Ionic, etc etc. I have zero confidence that they will still be around in five years, and I don't want to learn any more client-side JS frameworks until the industry settles down and matures a bit.

If I need to build a single page app, AngularJS it is for the next year or two, because even if it isn't cool anymore, it's still fine.

Re:The state of JavaScript modules by ravenstine on Monday May 29, 2017 @12:54PM (#14440032)
You pretty much come to the right conclusion in the end. In reality, nobody is forcing us to use WebPack, Yarn, React, etc. If an employer thinks I can't learn most of these tools on the job, then that's not the right employer for me. Although I don't think you're entirely right about Gulp, I tend to start most of my projects with Gulp, Express, and Handlebars because those are the tools I like to use. Nobody is stopping me from using those, nor will I ever be chastised for doing so. If any tool becomes useful to me, I will learn it regardless of its popularity. Well, unless support needs to be a serious consideration.

The "churn" we feel is really just a confusion from having so many new options while only wanting or needing a handful of simple/stable ones. This is troublesome because there aren't market forces(per se) or companies with researchers to limit our choices for us, like a spaghetti sauce company figuring out which 3 flavors of sauce to sell. If you can distance yourself from needing to be relevant, you'll be fine. Learn JavaScript and keep up with browser and Node.js advances; that's really the majority of what we need to do to stay relevant.

Re:The state of JavaScript modules by pas on Monday May 29, 2017 @04:29AM (#14438065)
JS is backward compatible. So it got that too from Java other than the funky name. So it's stable. jQuery? Works. Good old document.getElementById? Works. And thanks to the standardization efforts of vendors (and countless volunteers, who created feature matrices and feature tests and polyfills, and so on), now using those is easy, because you can look up what's supported, what will be supported, and what is deprecated. (So for a single page interaction you don't need tools. Case in point, last week I coded up a HTML form with a simple <script> tag. I got so nostalgic I almost wanted to watch a video of FrontPage 97.)

But if you want to minify your code, and bundle it, and use SCSS/LESS/SASS and compile that to CSS, and if you don't want to execute the various tools manually every time, then you need tools. And yes, since these are pretty simple tools, it's easy to reinvent them, to try out a new mix of them. Gulp vs grunt? Yeah, grunt's config was horrible. But people still like magical config files, so we are back with them with webpack. And people want to use better state management, and shadow DOM, and so on, but they still like to view their sites in browsers, not just through TC39 glasses, so they use babel, but that itself evolved over the years. And so on.

And WebAssembly. And TypeScript. Because static typing is really helpful. And isomorphic whatever. And tools for that. And tools for development. (Nodemon, hot code replacement, unit testing, code coverage, e2e testing, and so on.)

And even though everything is a moving target, the good bits are still doing pretty well. (Yarn is pretty good thanks to the lockfile, but obviously npm is doing well. Webpack lives on but AngularCLI actually works so no need to handcraft webpack config; and gulp works too, if you want to get simple.)

And you don't need to wait for others to tell you what's best. Look at your visitors/users, think about their needs, and look at what tools can help you serve them best. Are you making sites for blind people? Use/support tools that are thinking about WAI-ARIA/semantic markup. If you deal with mobile users? Optimize for speed, service workers, write non-chatty [REST] APIs, push content to CDNs, and think about PRPL ( https://developers.google.com/web/fundamentals/performance/p... ). If you serve big enterprises, use tools that provide IE4.01 compatibility, and so on.

Re:The state of JavaScript modules by positivecomment on Monday May 29, 2017 @05:10AM (#14438199)
I generally agree, just a small nitpick:

> Are you making sites for blind people? Use/support tools that are thinking about WAI-ARIA/semantic markup.

I think developers should always have accessibility in their mind. People (or organizations they work for) may choose to use IE8 and yes, it makes sense to draw a line somewhere regards to supporting browsers. They can decide if an upgrade effort is worth to use your application. However people do not choose to have less abilities and it's possible that they can't do anything to change that. I'm not a dictator who says everyone must use all the accessibility best-practices but usually there's a small effort which can be made with huge gains.

Re:The state of JavaScript modules by pas on Monday May 29, 2017 @08:18AM (#14438717)
Absolutely. But that's still a trade off (between using a tool that might be better in some other sense, but then you might not have time to add ARIA tags, or reshape the markup a bit). And usually it's not an explicit requirement. So it's up to the developer/team.

And I agree with doing the minimum. There was a great site that shows sites as they "look" like to a screen reader, but I can't find it now. (But it was very much like WAVE http://wave.webaim.org )

Re:The state of JavaScript modules by coldtea on Monday May 29, 2017 @04:53AM (#14438149)
>JS is backward compatible. So it got that too from Java other than the funky name.

You mean forward compatible. Which is unlike in Java.

New code (e.g. with ES6 features) doesn't work in older JS engines / browsers -- that's why we have transpilers.

Re:The state of JavaScript modules by pas on Monday May 29, 2017 @08:20AM (#14438726)
Java 8 lambas don't work on Java 6 JRE/JVMs either.

But your code is "futureproof". The spec/language/VM is backward compatible with old code. (In the sense that you can drop in the new version and old code runs.)

Re:The state of JavaScript modules by rusk on Monday May 29, 2017 @08:39AM (#14438797)
I'm fairly new to this whole Javascript development game. I got involved in brown field development in a hobby project and I am blown away by how far Javascript development has come.

Like I say, I'm new to this area so don't have much of a frame of reference but `npm` is nothing short of brilliantly neat, and hassle free.

With regards to the different language varieties `babel` sorts all that out - you can use your flavour of JS as you see fit and it all gets compiled to orthodox cross-browser JS.

Seriously pleased with what these features provide to the development environment.

Re:The state of JavaScript modules by thinkxl on Monday May 29, 2017 @04:17AM (#14438029)
Also, there is a trend to shame old technology, or better said, to shame devs that use jQuery, Backbone, or similar.

> "Oh, why are you using Backbone? That's an old and obsolete technology. You should learn React/Vue/Elm."

(Vue is easy to learn for new devs, though)

The dev is not familiar with functional programming or other paradigms that React suggests or requires you to know. He may be in a early learning process where Backbone/jQuery makes it easier for him to start on building webapps.

Re:The state of JavaScript modules by camus2 on Monday May 29, 2017 @04:59AM (#14438165)
> "Oh, why are you using Backbone? That's an old and obsolete technology. You should learn React/Vue/Elm."

I have no problem with jQuery (I still use it on animation heavy websites), but Backbone wasn't a good framework IMHO. it was not very useful and it lacked the component model that is well understood by web frameworks today (backbone didn't support composite views).There is no reason to use Backbone nowadays.

I think Vue.js is a good replacement for the people who seek simplicity and a clear data model. And it doesn't require any asset pipeline or whatever, it's just a little JS file.

Angular 2,4,whatever and Embers are frameworks that oozes with complexity, for very little benefits in my opinion.

Re:The state of JavaScript modules by bshimmin on Monday May 29, 2017 @05:34AM (#14438268)
Backbone provided some useful stuff for working with collections, a router, and, perhaps most importantly, structure to your projects. You have to look at it in the context of the time it was written - it predated React, for example, by a number of years. It was lightweight and the code was easy to follow, the documentation was good, and the API was certainly very stable.

Nested views were problematic, undeniably, and did lead in the real world to a big old mess that wasn't much better than the jQuery spaghetti it was intended to replace, with events bubbling all over the place and unnecessary re-rendering and so on. I led a team that built a big Backbone app, back when it was very much in vogue, and it was certainly hard to get this stuff right in practice - perhaps not impossible, but harder than one would have preferred.

Re:The state of JavaScript modules by boubiyeah on Monday May 29, 2017 @05:47AM (#14438315)
Yep, backbone was just like 200-300 lines of code. It was incrementally better than JQuery alone but suffered from the same limitations when trying to build apps with lots of views. If you wanted performances, you had a separated creation and update path, and you were back to Jquery spaghetti and tight coupling between DOM and JS via CSS selectors.

Shaming shouldn't be a thing, but It's fair to say no one should start a backbone project in 2017, unless it was dead simple, in which case you can use pretty much any tech anyway.

Re:The state of JavaScript modules by pas on Monday May 29, 2017 @04:35AM (#14438090)
Anyone suggesting something over the older tech should be able to explain why. And alas, as you write a lot of times, this explanation phase is simply skipped and only the impulsive shaming remains.

However, that doesn't mean the new libraries/tools/technologies are just created because "oh it's been a year and we're still using knockoutjs/react/angular/webpack/yarn!", but because a slight paradigm shift happened - at least for some people - and they feel that backbone is not the ideal tool for their job. (Maybe they felt backbone is too barebones, and went for angular, then felt that too heavy, and tried React and settled for Inferno.js.)

Re:The state of JavaScript modules by ng12 on Monday May 29, 2017 @11:03AM (#14439429)
> Give me some sort of promise when you'll leave the standard alone, then I'll wait for the community to form best practices / libraries to catch up

I don't understand what's stopping you from doing that. There are many perfectly fine jQuery/Backbone/Angular/etc apps that are chugging along perfectly fine. There's no reason for you to adopt new technology unless it makes your life easier.

And therein lies the problem -- for a long time developing an SPA in JS was absolutely terrible. And it's getting better, and getting better due to efforts of people who love the language. Webpack didn't beat Gulp because Corporate Sponsor X adopted it, Webpack beat Gulp because some guy wrote it and it turned out to be awesome. To me that's worth more than upsetting the curmudgeons who complain about perceived fatigue.

Re:The state of JavaScript modules by ilugaslifk on Monday May 29, 2017 @11:21AM (#14439518)
> due to efforts of people who love the language

Extremely tangential, but does anybody actually love javascript? We've been in a captive situation with this deeply flawed hack for 20 years.

Once WebAssembly is mature enough to fulfill its promise, and after that once we've burned through the generation born into this JS captivity, is anyone going to want use it anymore?

Like, if it were magically possible to use anything else natively in the browser today, would the next big thing be another 10 million person-hours put into yet another angle on working around JS's flaws... or something in another less clunky language entirely, never to return?

Re:The state of JavaScript modules by ravenstine on Monday May 29, 2017 @12:56PM (#14440041)
> Extremely tangential, but does anybody actually love javascript?

I know that I do, and it's my language of choice. That's not to say that it wasn't deeply flawed for a long time, but now both the technology and standard practices have evolved to where I really enjoy writing it and using it.

Re:The state of JavaScript modules by jbergens on Tuesday May 30, 2017 @03:47AM (#14443563)
I've been more curious if anybody actually loves Java. Ok Java 8 seems to be fine but do people really love it? And did they also love Java 7?
Re:The state of JavaScript modules by omginternets on Monday May 29, 2017 @05:07AM (#14438189)
Your comment summarizes why I still haven't managed to learn JS (or indeed web dev in general).

It's all just too damn confusing.

Re:The state of JavaScript modules by aaron-lebo on Monday May 29, 2017 @05:24AM (#14438239)
There's not much to it.

1) Pick a build tool (gulp, grunt, webpack - if you don't want an option, use webpack). You don't need a build tool but it helps with transpilation and it's a good base for the future.

2) Make or copy/adapt your build tool's config file to use Babel so you can use the latest ES version but compile down to work in browsers. You'll have to Google but these exist all over the place and they aren't confusing.

3) Pick a front end framework. Do you like Vue? It doesn't really matter because they're all doing basically the same thing in slightly different ways (like Rails, Django, Sinatra, Flask, etc).

You're good to go. It's not more difficult than setting up a Python, C, or any other environment, you simply have options. Hell, if you're doing terminal apps, you gotta decide between ncurses, blessed, termbox, raw escape sequences and so on. The JS world really isn't different than anything else.

Re:The state of JavaScript modules by omginternets on Monday May 29, 2017 @05:50AM (#14438324)
I appreciate your help, but it's somewhat comical to note how much your comment resembles this satire: https://hackernoon.com/how-it-feels-to-learn-javascript-in-2...

> It's not more difficult than setting up a Python, C, or any other environment, you simply have options

It's decidedly more complicated than Python. Being on par with C is hardly appropriate for a dynamic language.

To be clear, I really do appreciate the help, and I absolutely will tackle this someday (soon). Still, JavaScript has a serious problem here.

Re:The state of JavaScript modules by jessaustin on Monday May 29, 2017 @10:22AM (#14439204)
Yeah it's easy to start coding in python. Eventually one wants to distribute that code, and then the tears begin.
Re:The state of JavaScript modules by omginternets on Monday May 29, 2017 @11:17AM (#14439509)
That was true years ago. It's really not the case anymore. Related reading: https://glyph.twistedmatrix.com/2016/08/python-packaging.htm...

More to the point, even if what you said were true, the tooling is still absurdly complicated in the JS world. Your comment is a mix of of a red herring and whataboutism.

Re:The state of JavaScript modules by jessaustin on Monday May 29, 2017 @06:47PM (#14441928)
Thanks, I read that last year. This seems telling:

There should be tools that help you write and update a setup.py.

In my experience, this was always the hardest part. I started using python in 1999, and I never really had any problems setting up dev environments or doing any of the other things that Glyph discusses at length at that link. As I said above, distribution is the difficulty. The javascript "complications" about which some complain at every opportunity are only possible because distribution is so easy.

If comparing the pros and cons of two languages in response to another such comparison is "whataboutism", then I have no fucking idea what that term means.

Re:The state of JavaScript modules by omginternets on Tuesday May 30, 2017 @04:46AM (#14443775)
>If comparing the pros and cons of two languages in response to another such comparison is "whataboutism", then I have no fucking idea what that term means.

The issue at hand is not whether Python is superior to JS. Rather, we're talking about a specific problem in the JS world -- the apparent need for tooling and its so-called "dependency hell".

Bringing deployment into the conversation is whataboutism.

Re:The state of JavaScript modules by aaron-lebo on Monday May 29, 2017 @05:55AM (#14438339)
I understand it's frustrating and the onboarding process is annoying.

However, once you've done it yourself, you understand that it's overstated. I can setup a template for a JS project quicker than I can a Python one these days. You have to learn how to do that, yeah (which is the annoying part), but it's not hard, just scary cause without having worked with it, all you see is options.

Re:The state of JavaScript modules by SquareWheel on Monday May 29, 2017 @05:57AM (#14438342)
I know you're trying to be helpful, but I'd like to make clear that if you're a noobie, you don't need any of these tools. Plain Javascript is just fine, especially with the improvements of ES6.

Tools are here to solve problems. Don't bother with them until you have that problem yourself. If you one day decide you want to set up things like auto-minification, image compression, CSS-preprocessing, then look into build script options. Otherwise, it'll just overwhelm you.

Re:The state of JavaScript modules by aaron-lebo on Monday May 29, 2017 @06:03AM (#14438355)
You don't need any of those if you are doing a node project, yeah, but if you want to do any work on the browser, you're gonna need to transpile anyway, so it's something people should be aware of.

Plus it's literally a 20 line config file to do so.

    module.exports = {
        entry: './src/app.js',
        output: {
            path: './bin',
            filename: 'app.bundle.js',
         },
         module: {
             loaders: [{
                 test: /\.js$/,
                 exclude: /node_modules/,
                 loader: 'babel-loader'
             }]
         }
    }
Include your app.bundle.js file in your webpage and you are good to go.
Re:The state of JavaScript modules by nilliams on Monday May 29, 2017 @07:06AM (#14438512)
Soon with the new webpack-cli, you'll just be able to 'webpack init':

https://medium.com/webpack/announcing-the-new-webpack-cli-75...

Re:The state of JavaScript modules by _pmf_ on Monday May 29, 2017 @09:04AM (#14438881)
> Plain Javascript is just fine, especially with the improvements of ES6.

With React pushing hard to use JSX and discontinuing the in-browser JSX-to-JS transformation step, this is no longer completely true. You have to introduce the tooling from the start. (Yes, technologically you are not forced to use JSX and can use JS, but this is clearly declared as unwanted in the React ecosystem.)

Re:The state of JavaScript modules by jbergens on Tuesday May 30, 2017 @03:37AM (#14443516)
Actually other languages evolve too. C# 1.0 is not the same as C# 7, Java 1.0 is not close to Java 8 (which differs a lot from Java 7) and soon Java 9 seems to add more changes including new module handling systems.

I think that core js evolution has slowed down. There is not that many new things in ES2017 compared to ES2016.

Some libraries still evolve a lot but that will probably slow down over time. Some tools evolve but that is slower than the libraries. It was a few years between webpack 1 and 2, for example.

Re:The state of JavaScript modules by jacobr on Monday May 29, 2017 @04:28AM (#14438063)
> the amount of tools you have to pull in these days just get some single page interaction going...

I just started contributing to an open source project with a lot of JavaScript without any modules or even IIFE wrappers, everything is global. Just 1 year ago I would solve the problem with a new build system but now I'll just gradually introduce ES6 features, and I will not do any module refactorings because in 6 months I can probably just introduce standard modules without any build step.

When modules ship, 90% of what you need for a SPA will be available natively in browsers. If you are building a complex product, complexity will naturally increase, with build steps for various reasons.

Re:The state of JavaScript modules by pitaj on Monday May 29, 2017 @11:43AM (#14439642)
When people complain about these things, I just don't get it. If you liked what you were doing, just keep doing it. Sure, Bower is deprecated and you might want to consider switching to an npm-based module fetcher, but every library I've seen still works with AMD.

You can include React in an HTML script tag just like you could jQuery 5+ years ago and use it like that just fine.

The issue with JS is that it's a language used for lots of different things, and one of those things is front-end web development which is, like you said, very unstable and currently in a state of enormous flux.

You say we need to draw a line between the language and the libraries, but then you go on to say the language seems to reinvent itself every year.

[dead]
Re:The state of JavaScript modules by dagw on Monday May 29, 2017 @03:08AM (#14437832)
Seriously. Just use it.

I'm sorry, but that is hardly a convincing argument. For all I know you may be right, but just write one paragraph about what "amdefine" actually is/does, and why it is a better solution than what people are currently using and people might actually agree with you.