-
Notifications
You must be signed in to change notification settings - Fork 376
Conversation
Why do you think this fixes #211? This does not add the runtime dependency to the packages in https://github.com/LedgerHQ/ledgerjs/tree/master/packages |
@webmaster128 If the target project using these libraries has See this https://github.com/liquality/chainabstractionlayer |
@webmaster128 yep! agreed. Let me update the description. |
As a consequence, we also have: if the target project already includes babel-runtime from Babel 6, this PR will create a missing dependency on @babel/runtime and break builds that worked before |
@webmaster128 I think if it breaks projects currently using the old Babel, this fix can be released with a major semver release. Also see #218 (comment) |
Ya, that’d be great if both projects can use different version. I’m wondering, would it not increase the size of the final build of the target project if Ledgerjs uses Babel 6 and target project uses Babel 7 or vice-versa? |
Yes, since babel-runtime and @babel/runtime plus their dependencies will both be included. But I have no idea how big the impact really is. I'd see #211 as the first step and this as a nice-to-have optimization on top of that. |
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-stage-0": "^7.0.0", | ||
"@babel/runtime": "^7.1.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime is necessary to handle babel helper aliasing in the codebase. Here: https://babeljs.io/docs/en/babel-plugin-transform-runtime#helper-aliasing
package.json
Outdated
"@babel/preset-env": "^7.1.6", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-stage-0": "^7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which stage 0 features are used in codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an extraneous dependency. I'll remove it.
@webmaster128 Since #211 is now closed, how should #241 be moved forward? |
I have no idea. #332 (comment) is the best workaround I know to pull in the required runtimes manually. After all this months of all this mess with runtime dependencies of the jedgerjs I'm quite disappointed. It feels like nobody at LedgerHQ really knows what they are doing and this is a big trial and error in production software. So personally I did not look into this anymore because it somehow works for me. |
If we could revive this PR and ensure it works in main depending projects like ledger-live-common or ledger-live-desktop, we would ability merge it. Afterall, this project is open source and Ledger Live team bandwidth is limited. We happily accept contributions. |
Babel 7 has land on master branch. will shortly release new major version of the library. |
Fixes #218.
In addition to this, if the target project already uses Babel 7 and has
@babel/runtime
as a dependency, this PR is a workaround for #211.