Live data from Hacker News

What's New in Webpack 2

gist.github.com

41–50 of 71 posts

Re: What's New in Webpack 2

#42

Earlier quoted context omitted.

I think JSPM should stress the part about bundling. It's the second person that I see who says "JSPM is slow" and the reason behind this slowness is that they didn't bundle the files or bundled them incorrectly. We do the same in our project: we bundle all the 3rd party libs when they change, so only our own code gets retranspiled on each page load. During deployment, we bundle all the JS in a single bundle (which is…

Any chance you can go into detail how you bundle your 3rd party dependencies separately? I have tried that, without much luck.

Using bundle arythmetic.

jspm bundle src/app.js - src/[/*]

This will tell jspm to bundle src/app.js with all its dependencies, excluding everything in the src/ directory. This will result in JSPM bundling only your dependencies.

Re: What's New in Webpack 2

#43
post #4

Huge. Between webpack and Babel, JS is quickly progressing towards becoming a powerful language that is easy to write, read and reason about. I'm currently in the process of moving an inherited "minified by hand" codebase to ES6, and the difference is incredible. Not only are linters catching hundreds of previously unknown edge cases and bugs, but the end result is more performant and smaller in file size. It's very…

Have you looked into TypeScript? Type system helps you catch even more errors.

Since adopting Redux, I've not seen many advantages of TypeScript. My codebase is just pure functions that describe simple state objects. What sort of advantages do I stand to gain by bringing in TS in this situation?

Re: What's New in Webpack 2

#44
post #4

Earlier quoted context omitted.

Have you looked into TypeScript? Type system helps you catch even more errors.

Since adopting Redux, I've not seen many advantages of TypeScript. My codebase is just pure functions that describe simple state objects. What sort of advantages do I stand to gain by bringing in TS in this situation?

[deleted]

Re: What's New in Webpack 2

#45
post #37

I tries cycle.js the other day and had to use some webpack. Seems like npms default webpack Version is some 2.0 beta?! Somehow requires in scoped modules didn't work with it ans I searched about n hour for an solution till I saw that the webpack devs seem to consider a beta a good 'default' Version.... Going back do 1.12.12 helped. I love npm D:

It may have been temporary because right now the default version it installs is 1.12.12

Re: What's New in Webpack 2

#46
post #5
post #3

Huh, they've pulled es6 compilation in, away from babel? It's early in the morning here so my pre-coffee brain might be terrible, but did they say which compilation engine they were using for es6?

ES6 modules support are now baked into Webpack, which makes sense because that's supposed to be it's primary concern. Any other feature you'd still need to use Babel.

I wish Node supported ES6 modules without transpilation as well

Re: What's New in Webpack 2

#47
post #11

has anyone used systemjs + jspm here ? I inherited a codebase using jspm (due to the override registry system that works great with legacy javascript packages - like Handsontabe) and am wondering about webpack.

We are using jspm on an inherited codebase that was concatenated "by hand" with Rails' asset-pipeline (it has lots of old libraries and the overrides are very good to handle them). What we hate is jspm is extremely slow in development for us. There are two main causes: - The amount of xhr. This is solvable with http2's server push (but our dev server is in Ruby, and there's no http2 webserver yet). - Apparently jspm…

You should check out StealJS which is a fork of JSPM[1]. The biggest difference between StealJS is that it uses NPM so you don't need a separate package manager tool. Aside from that, we have built in hot module swapping so dev can be really fast (less than 200ms per change usually). Also on the roadmap is caching using Service Workers.

[1]http://stealjs.com/

Re: What's New in Webpack 2

#48
post #26

Hm, I'm not sure about having to pull in a Promise polyfill to support code splitting (`require.ensure()`) in IE11... If I'm already using a promises library from X, would it be possible to somehow instruct webpack use that? Does that make sense? Am I missing something?

You would have to make the Promise object from your choosen promise library global before any calls to require.ensure.

Re: What's New in Webpack 2

#49
post #4

Earlier quoted context omitted.

Have you looked into TypeScript? Type system helps you catch even more errors.

Since adopting Redux, I've not seen many advantages of TypeScript. My codebase is just pure functions that describe simple state objects. What sort of advantages do I stand to gain by bringing in TS in this situation?

When implementing overloaded functions, explicitly defining an interface would allow for much easier debugging than testing it afterwards. Running tests (that can take up to seconds sometimes) is far less efficient than seeing the problem nearly immediately

Re: What's New in Webpack 2

#50
post #41

What's needed for Webpack 2: better documentation.

I strongly agree. I had to set up a React application not so long ago and the Webpack docs were completely useless. I ended up following a step by step guide made by someone else, which was really easy to follow and reason about: http://survivejs.com/webpack_react/developing_with_webpack/
Post reply on HN