Remove dependency to tslib by bumping TypeScript target #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):
URLSearchParams
intoSearchParams
.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.