-
Notifications
You must be signed in to change notification settings - Fork 74
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
Move all platform-specific functions in index-*.ts
files
#2519
Move all platform-specific functions in index-*.ts
files
#2519
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.
twiggy diff reportDifference in .wasm size before and after this pull request.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Close #2516
After trying #2516, I had a eureka moment about how to do this properly.
This PR removes the
compat
module. Instead, all platform-specific functions are now implemented in the main file (formerlyindex.ts
) and injected through the public API ofclient.ts
.There are now two
index.ts
files:index-browser.ts
andindex-nodejs.ts
. Thepackage.json
file defaults toindex-browser.ts
, but now has aexports
->node
field that instead points toindex-nodejs.ts
.In a future PR, I will add a
index-deno.ts
file that will be the Deno entry point.