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

Allow workers to load CJS plugins #3796

Merged
merged 2 commits into from
Jul 12, 2023
Merged

Allow workers to load CJS plugins #3796

merged 2 commits into from
Jul 12, 2023

Conversation

garrettjstevens
Copy link
Collaborator

Fixes #3785

Worked on this with @cmdcolin during our pairing yesterday, and since then I've created a CJS plugin to test with that does node-native module import on the worker.

Because our electron version now uses node 18, we can use fetch natively. Also because webpack 5 doesn't do any polyfilling, we can avoid a bunch of window.requires that were a workaround to avoid the polyfilling.

Co-authored-by: Colin <colin.diesh@gmail.com>
@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Jul 12, 2023
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Merging #3796 (a9e2283) into main (8a3ac2d) will increase coverage by 0.22%.
The diff coverage is 8.10%.

❗ Current head a9e2283 differs from pull request most recent head da83d0e. Consider uploading reports for the commit da83d0e to get more accurate results

@@            Coverage Diff             @@
##             main    #3796      +/-   ##
==========================================
+ Coverage   64.24%   64.47%   +0.22%     
==========================================
  Files         987      990       +3     
  Lines       29671    29574      -97     
  Branches     7096     7094       -2     
==========================================
+ Hits        19063    19068       +5     
+ Misses      10444    10341     -103     
- Partials      164      165       +1     
Impacted Files Coverage Δ
packages/core/rpc/WebWorkerRpcDriver.ts 0.00% <ø> (ø)
packages/product-core/src/rpcWorker.ts 0.00% <0.00%> (ø)
...browse-desktop/src/components/StartScreen/util.tsx 0.00% <0.00%> (ø)
products/jbrowse-desktop/src/rootModel/index.ts 47.05% <ø> (ø)
products/jbrowse-desktop/src/rpcWorker.ts 0.00% <0.00%> (ø)
...ucts/jbrowse-desktop/src/sessionModel/TrackMenu.ts 8.57% <0.00%> (ø)
products/jbrowse-desktop/src/util.tsx 0.00% <0.00%> (ø)
products/jbrowse-react-app/src/rpcWorker.ts 0.00% <0.00%> (ø)
.../jbrowse-react-linear-genome-view/src/rpcWorker.ts 0.00% <0.00%> (ø)
products/jbrowse-web/src/rpcWorker.ts 0.00% <0.00%> (ø)
... and 2 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Jul 12, 2023
@cmdcolin cmdcolin merged commit ebb1625 into main Jul 12, 2023
@cmdcolin cmdcolin deleted the worker_cjs_plugin branch July 12, 2023 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fetching CJS plugin on desktop - worker support?
2 participants