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

Move all platform-specific functions in index-*.ts files #2519

Merged
merged 16 commits into from
Jul 18, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jul 17, 2022

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 (formerly index.ts) and injected through the public API of client.ts.

There are now two index.ts files: index-browser.ts and index-nodejs.ts. The package.json file defaults to index-browser.ts, but now has a exports -> node field that instead points to index-nodejs.ts.

In a future PR, I will add a index-deno.ts file that will be the Deno entry point.

Copy link
Contributor

@mergify mergify bot left a 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼──────────────────
          +0 ┊ Σ [0 Total Rows]

Copy link
Contributor

@wirednkod wirednkod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Jul 18, 2022
@mergify mergify bot merged commit 71060a9 into paritytech:main Jul 18, 2022
@tomaka tomaka deleted the one-more-platform-compat-idea branch July 18, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants