Immer: Use terser instead of uglify-es

Created on 9 Nov 2018  Â·  14Comments  Â·  Source: immerjs/immer

@gaearon has been tweeting about uglify-es causing issues for CRA users. Considering uglify-es is unmaintained, we should use terser instead (a fork of uglify-es that is actively maintained).

has PR

All 14 comments

Agreed

Op vr 9 nov. 2018 om 16:48 schreef Alec Larson notifications@github.com:

@gaearon https://github.com/gaearon has been tweeting about uglify-es
causing issues for CRA users. Considering uglify-es is unmaintained, we
should use terser https://www.npmjs.com/package/terser instead (a fork
of uglify-es that is actively maintained).

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mweststrate/immer/issues/247, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABvGhBVHXjMZgh8Gr4gGxtKpZYkwcrSUks5utaPRgaJpZM4YW0E7
.

I'm not using the minified version of Immer, so I cannot set aside time to do this. 😢

@mweststrate what's this line about? The rollup-plugin-uglify doesn't take any 2nd arg.

@dwelle no clue, probably copied it from somewhere else, but it seems to parameterize the minifier that should be used :)

We could stop bundling Immer altogether.

Bundling is the job of the application, not the library.

Web apps can use https://packd.now.sh/[email protected] or something like Webpack.

Node apps can use something like Rollup or zeit/ncc.

@mweststrate are there any contributing guidelines or local development setup instructions? I looked for them in README and wiki.

Bundling is pretty essential for UMD builds, for other builds it can be left out indeed

@prithvi16 no, no clear guidelines atm :), setup is pretty straight forward, make sure to use yarn and that your IDE respects prettier, and that should be it. Discuss large changes upfront in an issue to avoid wasting effort

@mweststrate There's https://unpkg.com/ for UMD bundles.

unpkg is a CDN, not a bundler, so if you put an UMD bundle in your package,
then you can CDN UMD builds. Otherwise you have useless require / import
statements in your browser

Just remembered Packd creates a UMD bundle, so I think we can stop using Rollup locally. :)

Note: https://bundle.run should be used over https://packd.now.sh

Oh that's cool! Didn't know it.

Further optimization: mange properties could be used to make the minified build smaller (with exceptions for publicly exposed property names).

If anyone wants to contribute here, try setting up bili.

It has the same goals as microbundle, but with some nice improvements: https://github.com/egoist/bili/issues/163

@aleclarson you can close this now as it's resolved 🤗

Was this page helpful?
0 / 5 - 0 ratings