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

JSXSpreadChildren #4988

Merged
merged 3 commits into from Dec 16, 2016
Merged

JSXSpreadChildren #4988

merged 3 commits into from Dec 16, 2016

Conversation

jridgewell
Copy link
Member

Q A
Bug fix? No
Breaking change? No
New feature? Yes
Deprecations? No
Spec compliancy? Yes?
Tests added/pass? Yes
Fixed tickets Fixes #3575
License MIT
Doc PR No
Dependency Changes N/A

Follow up to #3575, since that one seems to have stalled. Adds throwing when transform-react-jsx encounters a spread child.

@codecov-io
Copy link

codecov-io commented Dec 11, 2016

Current coverage is 89.10% (diff: 100%)

No coverage report found for master at 7b5e6f1.

Powered by Codecov. Last update 7b5e6f1...4d4da01

@hzoo
Copy link
Member

hzoo commented Dec 12, 2016

I forgot what the end result was - so we add it as a node but if it's used in react throw?

Ok cool and since its already unknown this won't be breaking

@hzoo hzoo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories and removed i: bug i: enhancement labels Dec 15, 2016
@hzoo hzoo added this to the Next Patch milestone Dec 15, 2016
@hzoo
Copy link
Member

hzoo commented Dec 15, 2016

cc @sebmarkbage @syranide

@hzoo hzoo merged commit 2bbc36d into babel:master Dec 16, 2016
@teknologist
Copy link

teknologist commented Dec 17, 2016

This is breaking, had to remove react preset from project. Otherwise meteor would Throw this on build...

While processing files with ecmascript (for target os.osx.x86_64):
   /Users/eric/.meteor/packages/ecmascript/.0.6.1.puk6rj++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-traverse/lib/visitors.js:196:13:
   You gave us a visitor for the node type "JSXSpreadChild" but it's not a valid type
   at verify
   (/Users/eric/.meteor/packages/ecmascript/.0.6.1.puk6rj++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-traverse/lib/visitors.js:196:13)
   at Function.explode
   (/Users/eric/.meteor/packages/ecmascript/.0.6.1.puk6rj++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-traverse/lib/visitors.js:72:3)
   at Plugin.normaliseVisitor
   (/Users/eric/.meteor/packages/ecmascript/.0.6.1.puk6rj++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-core/lib/transformation/plugin.js:155:29)
   at new Plugin...

Discussion here, as multiple people were impacted throughout the day:

Link Meteor Forum Discussion

Any idea on how to fix this ? Is it safe to remove react preset ? The app seems to work perfectly with "stage-2" preset.

Many thanks!

@jridgewell
Copy link
Member Author

@hzoo, seems babel-types didn't get a version bumb?

@jquense
Copy link
Contributor

jquense commented Dec 17, 2016

we're seeing a similar error on our CI runs (not using meteor)

@teknologist
Copy link

teknologist commented Dec 17, 2016

@jquense Well I think it is not particularly related to meteor as the meteor build tool uses the babel setup from package.json/.babelrc so it should happen on any js/react/babel project that uses babel-plugin-transform-react-jsx...

@teknologist
Copy link

@jridgewell Thanks for having a look, even if it is a pre xmas weekend! ;-)

I guess I can live without the react preset until this is fixed.

@hzoo
Copy link
Member

hzoo commented Dec 17, 2016

Babel-types is published 77d9e3e the issue seems to be that unless you rm node_modules the server version is still satisfied on an older version such that you get that error because a different pkg updated but babel-types isn't updated

@hzoo
Copy link
Member

hzoo commented Dec 17, 2016

Stuck at the airport, but sounds like we may need to just revert or republish all pkgs again?

@teknologist
Copy link

teknologist commented Dec 17, 2016

@hzoo No worries! As far as I am concerned I will enjoy the rest of the weekend and get back to the task on Monday!

@zachariahtimothy
Copy link

FWIW If you are using React Intl this is a show stopper. Removing the react preset allows the app to boot and load, but now the babel-plugin-react-intl plugin is not working, causing the translation step to fail (no messages detected) and in turn the pages will not load. I tried downgrading babel but still the same issue. What else can I try to get back up and running?

@teknologist
Copy link

teknologist commented Dec 18, 2016

@zachariahtimothy That is exactly what puzzles me. How downgrading the package doesn't solve the issue. It literally freaks me out...tough lesson learned on npm package/dependency management.
Potential disasters in the making. But this is a discussion to have elsewhere.
Hope you get yourself out of this nightmare.

@hzoo
Copy link
Member

hzoo commented Dec 18, 2016

So sorry about this, been trying to figure out releases/versioning in Babel for a while and haven't really figured out much. Hopefully we can solve this kind of issue in the future. Downgrading babel-core doesn't do anything because the error has to do with a dep breaking on an older version of babel-types while something else is later - seems to be a issue with us + monorepo without updating all packages but not entirely sure.

@teknologist
Copy link

@hzoo thanks for the update. I hope we can get back to work soon...

@hzoo
Copy link
Member

hzoo commented Dec 18, 2016

We're planning on rolling back the babel-helper-builder-react-jsx/src/index.js change to as a workaround for now to fix the immediate issue.

loganfsmyth added a commit to loganfsmyth/babel that referenced this pull request Dec 18, 2016
loganfsmyth added a commit that referenced this pull request Dec 18, 2016
Revert babel-helper-builder-react-jsx change from #4988
@loganfsmyth
Copy link
Member

Alright I've published babel-helper-builder-react-jsx@6.21.1, which reverts the lines that were added that caused the

You gave us a visitor for the node type "JSXSpreadChild" but it's not a valid type

error. It should be pulled in automatically since things depend on general ranges.

@teknologist Please ensure you get that new version and let us know how things look.

@teknologist
Copy link

teknologist commented Dec 18, 2016

@loganfsmyth Yes, seems fixed.
What I did is remove babel-core and re-add it together with babel-react-preset (I know it is an overkill but I just wanted to make sure). Then reactivated the preset in my .babelrc.

babel-helper-builder-react-jsx is at the right version:

├─┬ babel-preset-react@6.16.0
│ ├─┬ babel-plugin-transform-react-jsx@6.8.0
│ │ └── babel-helper-builder-react-jsx@6.21.1
│ ├── babel-plugin-transform-react-jsx-self@6.11.0
│ └── babel-plugin-transform-react-jsx-source@6.9.0

Error is gone indeed. Many thanks!

@zachariahtimothy
Copy link

It is working for me again, both reading messages, starting app, and unit tests. Thanks a bunch @loganfsmyth !

panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
benjamn added a commit to benjamn/ast-types that referenced this pull request Mar 19, 2017
danez added a commit that referenced this pull request Jan 6, 2019
This reverts commit dbc0722.

# Conflicts:
#	packages/babel-helper-builder-react-jsx/src/index.js
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants