Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable uglify mangle and compress #214

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

fsdiogo
Copy link
Contributor

@fsdiogo fsdiogo commented Apr 16, 2018

We can now enable mangling after changing the way we did some type checking, from comparing instances with constructor.name to using the class-is module that uses symbols, as proposed in ipfs/js-ipfs#1131 (comment).

Check ipfs/js-ipfs#938 (comment) for some of the repos that were affected.

We can now also compress the code, but I've had to disable the unused flag (it drops unreferenced functions and variables -- check it) due to the following error:

Uncaught (in promise) Error: Callback was already called

Fixes ipfs/js-ipfs#938.

@fsdiogo fsdiogo self-assigned this Apr 16, 2018
@fsdiogo fsdiogo requested review from vmx and daviddias April 16, 2018 17:10
@ghost ghost added the status/in-progress In progress label Apr 16, 2018
@daviddias daviddias merged commit 8d323b7 into master Apr 24, 2018
@ghost ghost removed the status/in-progress In progress label Apr 24, 2018
@fazo96
Copy link

fazo96 commented Apr 24, 2018

I've had to disable the unused flag (it drops unreferenced functions and variables -- check it) due to the following error:

Any idea what causes the error? Would be nice to be able to run js-ipfs through uglify with default settings

@daviddias daviddias deleted the feat/enable-uglify-mangle-compress branch April 24, 2018 10:32
@fsdiogo
Copy link
Contributor Author

fsdiogo commented May 2, 2018

Hey @fazo96, sorry for the late response, I must've missed the notification 😐

No idea to be honest. I got that error so I figured it could be solved by passing some options, and unused did it.

lidel added a commit to ipfs/ipfs-companion that referenced this pull request Jul 14, 2018
This commit is a backport of ipfs/aegir#214

Default flags from webpack broke pubsub by removing 'unused'
experiments. This restores pubsub functionality and applies the fix for
entire build pipeline.
lidel added a commit to ipfs/ipfs-companion that referenced this pull request Jul 14, 2018
This commit is a backport of ipfs/aegir#214

Default flags from webpack broke pubsub by removing 'unused'
experiments. This restores pubsub functionality and applies the fix for
entire build pipeline.
lidel added a commit to ipfs/ipfs-companion that referenced this pull request Jul 16, 2018
Change webpack minimizer flags to follow Aegir

### Problem fixed by this PR

Default minimizer flags break pubsub with embedded node  by removing 'unused' code of pubsub experiment. Details in #521.

### In This PR

-  Backport of ipfs/aegir#214: it restores pubsub functionality and applies the fix for  entire build pipeline to avoid similar issues in future.
- The way configuration blocks are merged is improved by use of [webpack-merge](https://www.npmjs.com/package/webpack-merge)
- Bundles are bit smaller due to moving LICENSE comments to separate file (`extractComments: true`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants