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

Add babel/runtime to dependencies #2923

Merged
merged 2 commits into from
Apr 18, 2022
Merged

Add babel/runtime to dependencies #2923

merged 2 commits into from
Apr 18, 2022

Conversation

garrettjstevens
Copy link
Collaborator

Our root babel.config.js uses @babel/transform-runtime. According to the docs here, anything that uses that plugin needs to include @babel/runtime as a dependency. This PR adds that dependency to anything that uses the root babel.config.js.

It also removes the .babelrc files from the individual plugins since @babel/preset-react and @babel/preset-env are already included in the root babel config. It also adds the loose: false option to the root babel config since it was used in the plugin configs.

I noticed this because when I tried to upgrade jbrowse-plugin-apollo to the latest version of @jbrowse/core, I got build errors about not being able to find various babel runtime files. This PR fixes those errors.

@garrettjstevens garrettjstevens added the bug Something isn't working label Apr 18, 2022
@garrettjstevens garrettjstevens self-assigned this Apr 18, 2022
@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

Merging #2923 (25a4348) into main (c6426d6) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2923   +/-   ##
=======================================
  Coverage   59.92%   59.93%           
=======================================
  Files         587      587           
  Lines       26641    26641           
  Branches     6476     6476           
=======================================
+ Hits        15965    15966    +1     
+ Misses      10372    10371    -1     
  Partials      304      304           
Impacted Files Coverage Δ
.../linear-genome-view/src/LinearGenomeView/index.tsx 85.27% <0.00%> (+0.17%) ⬆️

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 c6426d6...25a4348. Read the comment docs.

@cmdcolin
Copy link
Collaborator

this is probably ok. it might be good to modernize our babel config somewhat too e.g. we probably don't need node:8 in babel/env, and we probably don't need to transpile Set/Map to make it necessary to have loose:false ?

@cmdcolin
Copy link
Collaborator

I don't know a lot about transform-runtime also but we could even consider removing it

@garrettjstevens
Copy link
Collaborator Author

Turns out we don't need to specify loose: false in the top-level config, since it's the default. It was in the plugin-specific configs to override a TSDX-specific preset, which isn't an issue anymore.

I think it's worth keeping transform-runtime, since it keeps helpers from being added to every file, and our code is spread out over a lot of files.

@cmdcolin
Copy link
Collaborator

sounds good :)

@cmdcolin cmdcolin merged commit 3896bb3 into main Apr 18, 2022
@cmdcolin cmdcolin deleted the babel_runtime_deps branch April 18, 2022 20:51
@garrettjstevens
Copy link
Collaborator Author

Also, I agree it would be good to modernize the babel config at some point, maybe in a separate PR or PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants