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

Use a user-supplied fetchCJS callback to import CJS plugins #2904

Merged
merged 3 commits into from
Apr 14, 2022

Conversation

cmdcolin
Copy link
Collaborator

This PR is similar to #2891 but for jbrowse-desktop, which can import CJS modules

Without this PR, a 'http' module polyfill (stream-http) is bundled in jbrowse-web

screenshots with npx source-map-explorer build/static/js/*.js in jbrowse-web

before (see stream-http)
Screenshot from 2022-04-14 06-39-32

after (stream-http removed)
Screenshot from 2022-04-14 06-39-37

Also uses window.require instead of __non_webpack_require__ which sort of ensures that the electron require machinery is used instead of bundled

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Apr 14, 2022
@cmdcolin cmdcolin added internal and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Apr 14, 2022
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #2904 (4e6eb22) into main (8c0c603) will increase coverage by 0.03%.
The diff coverage is 3.03%.

@@            Coverage Diff             @@
##             main    #2904      +/-   ##
==========================================
+ Coverage   59.90%   59.93%   +0.03%     
==========================================
  Files         587      587              
  Lines       26630    26633       +3     
  Branches     6472     6473       +1     
==========================================
+ Hits        15952    15962      +10     
+ Misses      10376    10369       -7     
  Partials      302      302              
Impacted Files Coverage Δ
products/jbrowse-desktop/src/StartScreen/util.tsx 0.00% <0.00%> (ø)
packages/core/PluginLoader.ts 24.17% <14.28%> (+5.75%) ⬆️
packages/core/util/layouts/GranularRectLayout.ts 87.17% <0.00%> (+0.42%) ⬆️
...inearGenomeView/components/RefNameAutocomplete.tsx 80.80% <0.00%> (+3.03%) ⬆️
...lignments/src/BamAdapter/BamSlightlyLazyFeature.ts 84.37% <0.00%> (+3.12%) ⬆️
packages/core/TextSearch/TextSearchManager.ts 100.00% <0.00%> (+3.44%) ⬆️
...src/SvgFeatureRenderer/components/FeatureLabel.tsx 86.20% <0.00%> (+6.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c0c603...4e6eb22. Read the comment docs.

@cmdcolin
Copy link
Collaborator Author

tested with the cjs bundle of jbrowse-plugin-systeminformation example from https://github.com/garrettjstevens/jbrowse-plugin-systeminformation and worked :)

@cmdcolin cmdcolin merged commit 5801056 into main Apr 14, 2022
@cmdcolin cmdcolin deleted the cjs_desktop_only branch April 14, 2022 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant