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

Remove dependency to tslib by bumping TypeScript target #90

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

remusao
Copy link
Contributor

@remusao remusao commented Jan 5, 2020

To fix #4, I propose to bump the target of TypeScript compiler to es6, which allows to use generators and other features natively instead of requiring some polyfill. We should make sure it does not introduce any big regression but locally I could see that the figures I get for performance match roughly what's in the README (although I used a different hardware and Node.js version; it would be nice to check all original benchmarks). As a positive side-effect, the size of minified bundle is 6% smaller now.

There was a few additional changes that needed to be made to satisfy the minifier (which does not like duplicated global class definitions since they are not transpiled to functions + prototypes now):

  • Renaming URLSearchParams into SearchParams.
  • Exporting classes as default and replacing direct class types by interface where possible.
  • Renaming URL into MutableURL in utils.ts (I was wondering if it could return an ImmutableURL here as well?).

I added one last bit in the PR: correct source-map handling using an additional rollup plugin which is able to combine source-maps from dependencies (i.e. tldts) and url-parser code minified into a final one.

@sammacbeth sammacbeth merged commit 503587e into ghostery:master Jan 7, 2020
@remusao remusao added the PR: Internal 🏠 Changes only affect internals label Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Internal 🏠 Changes only affect internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

library seems to be missing 'tslib' dependency
2 participants