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

WIP: Support Babel 7 #11

Closed
wants to merge 1 commit into from

Conversation

jamesreggio
Copy link

@babel/template has a new API in Babel 7 that requires positional replacements (i.e., those with numbered placeholders like $0 and $1) to be passed in via a single array argument.

This PR makes the needed change, which was all that was needed to get this plugin to run in a Babel 7 environment.

The PR is not clean to merge because it regresses Babel 6 functionality. I would suggest updating the package dependencies to Babel 7 if you'd like to eventually merge this — though the lazy option in the Babel 7 commonjs plugin may obviate the need for this package, per the discussion here.

@milesj
Copy link

milesj commented Sep 6, 2018

@zertosh This is needed to unblock Babel 7 for Jest: jestjs/jest#6949

@zertosh
Copy link
Owner

zertosh commented Sep 7, 2018

@milesj, the tests are failing

@milesj
Copy link

milesj commented Sep 7, 2018

@jamesreggio Ping

@jamesreggio
Copy link
Author

jamesreggio commented Sep 8, 2018

Sorry, @zertosh and @milesj, but all of the tests need to be migrated to Babel 7. I spent an hour on it so far and cannot even get a single test to run on Babel 7. I don't have any more time to spend, especially since I'm not using this package myself. (We're just using the lazy option from the first-party @babel/plugin-transform-modules-commonjs itself, per these docs.)

I'm going to close this, but you may consider using my adjustments to the plugin code in any future attempt you make to support Babel 7.

@jamesreggio jamesreggio closed this Sep 8, 2018
reid pushed a commit to reid/babel-plugin-transform-inline-imports-commonjs that referenced this pull request Feb 20, 2019
This change builds on zertosh#11 by upgrading the Babel dev dependencies
to Babel 7. Various packages were renamed and changed for Babel 7
and the generated code is different.

- Switch to new `@babel` packages.
- `es2015` and `es3` were removed from plugin names.
- Continue to use select legacy es3 plugins which continue to work
  with Babel 7.
- `@babel/preset-react` no longer strips Flow types.
  Include `@babel/plugin-transform-flow-strip-types` to strip Flow.
- Include the Babel bridge package.
- `babel-plugin-check-es2015-constants` was removed in favor of
  `@babel/plugin-transform-block-scoping` which violated the ES spec.
  See: babel/babel#6987
@reid reid mentioned this pull request Feb 20, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants