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

Override babelrc for the node related code #4451

Merged
merged 4 commits into from
Oct 18, 2018

Conversation

igor-dv
Copy link
Member

@igor-dv igor-dv commented Oct 16, 2018

Issue: We may optimize the Node related code to be transpired for Node. That will reduce the package size a bit and will ease a debugging

What I did

I've added the Node specific .babelrc in a few places
Overridden the root babelrc for the Node related code

@codecov
Copy link

codecov bot commented Oct 16, 2018

Codecov Report

Merging #4451 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4451      +/-   ##
==========================================
- Coverage   35.96%   35.94%   -0.03%     
==========================================
  Files         555      555              
  Lines        6653     6658       +5     
  Branches      871      869       -2     
==========================================
  Hits         2393     2393              
- Misses       3813     3820       +7     
+ Partials      447      445       -2
Impacted Files Coverage Δ
lib/core/src/server/config.js 0% <0%> (ø) ⬆️
lib/core/src/server/loadCustomAddonsFile.js 0% <0%> (ø) ⬆️
...ddons/storyshots/storyshots-puppeteer/src/index.js 0% <0%> (ø) ⬆️
lib/core/src/server/core-preset-webpack-custom.js 0% <0%> (ø) ⬆️
app/react-native/src/server/config/utils.js 0% <0%> (ø) ⬆️
lib/core/src/server/core-preset-prod.js 0% <0%> (ø) ⬆️
...es__/update-addon-info/update-addon-info.output.js 0% <0%> (ø) ⬆️
lib/core/src/server/core-preset-dev.js 0% <0%> (ø) ⬆️
app/react-native/src/server/index.js 0% <0%> (ø) ⬆️
lib/core/src/server/build-static.js 0% <0%> (ø) ⬆️
... and 14 more

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 aad49fe...623ef68. Read the comment docs.

@igor-dv igor-dv requested a review from Hypnosphi as a code owner October 16, 2018 16:14
@Hypnosphi
Copy link
Member

Hypnosphi commented Oct 16, 2018

You can use overrides instead
https://babeljs.io/docs/en/options#overrides

@igor-dv
Copy link
Member Author

igor-dv commented Oct 16, 2018

Oh, that's much better

@igor-dv igor-dv changed the title Add special "babelrc"s for the node related code Override babelrc for the node related code Oct 16, 2018
"./addons/storyshots",
"./addons/storysource/src/loader",
"./app/**/src/server/**"
],
Copy link
Member

Choose a reason for hiding this comment

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

I think you can also add lib/cli here, and remove lib/cli/.babelrc

Copy link
Member

Choose a reason for hiding this comment

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

  • lib-codemod

Copy link
Member Author

Choose a reason for hiding this comment

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

Added codemod.
lib/cli seems not transpiled like other packages (there is no src dir in)

Copy link
Member

Choose a reason for hiding this comment

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

it's using babel-register

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but the "scripts/compile-js" is not handling this I think... I mean, do you think I need to change this?

Copy link
Member

@Hypnosphi Hypnosphi Oct 17, 2018

Choose a reason for hiding this comment

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

I think there's nothing special about lib/cli package, so we can switch it from babel-register to transpiling

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool. Will wait for #4236 to be finished. Then will move it to src dir.

.babelrc Show resolved Hide resolved
@ndelangen ndelangen added this to the next milestone Oct 17, 2018
@ndelangen ndelangen merged commit a041e81 into master Oct 18, 2018
@ndelangen ndelangen deleted the babel-optimization-for-node branch October 18, 2018 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants