Skip to content

Fix for #204 - #401

Merged
rauchg merged 1 commit into
vercel:masterfrom
arunoda:fix-204
Dec 16, 2016
Merged

rauchg merged 1 commit into
vercel:masterfrom
arunoda:fix-204

Conversation

@arunoda

@arunoda arunoda commented Dec 16, 2016

Copy link
Copy Markdown
Contributor

Fixes #204

React addons require React in a special way.
That causes Webpack to push React into the app's bundle.
This fix adds new externals entries to prevent that.

React addons require React in a special way.
That causes Webpack to push React into the app's bundle.
This fix adds new externals entries to prevent that.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 34.211% when pulling d05909a on arunoda:fix-204 into 45e36fd on zeit:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 34.211% when pulling d05909a on arunoda:fix-204 into 45e36fd on zeit:master.

@rauchg

rauchg commented Dec 16, 2016

Copy link
Copy Markdown
Member

Beautiful. Yet, pretty strange that react addons require react like that? What's the rationale?

@arunoda

arunoda commented Dec 16, 2016

Copy link
Copy Markdown
Contributor Author

Not exactly sure. But that might be the case that, FB uses their own module resolver for React.

@rauchg

rauchg commented Dec 16, 2016

Copy link
Copy Markdown
Member

@gaearon what's the rational behind the ./React thing?

@arunoda

arunoda commented Dec 16, 2016

Copy link
Copy Markdown
Contributor Author

May be related. See: react/react#6343

@gaearon

gaearon commented Dec 16, 2016

Copy link
Copy Markdown
Contributor

what's the rational behind the ./React thing?

It's just importing React entry point from the same folder. react/lib/TransitionGroup imports react/lib/React.

@arunoda

arunoda commented Dec 16, 2016

Copy link
Copy Markdown
Contributor Author

Thanks @gaearon
Oh I forgot to see other files :D

@frol

frol commented Dec 16, 2016

Copy link
Copy Markdown
Contributor

@arunoda Are you sure that this fix is correct?

Yes, these modules only work when packaged with the react module from npm (it does this because we need access to private APIs). If you want to use the prepackaged React and an addon, then we recommend use ReactWithAddons and map react-addons-css-transition-group to React.addons.CSSTransitionGroup.

(c) react/react#6343

I am not a JS expert, so I am not exactly sure, but it feels like this patch will just break the addons.

@arunoda

arunoda commented Dec 17, 2016

Copy link
Copy Markdown
Contributor Author

@frol it works. (and it should be).
It maps the internal .React with the one we've in the bundle.
Anyway, we are getting rid of the next-bundle soon. (#406)
With that there'll be no problem like this.

@arunoda
arunoda deleted the fix-204 branch December 17, 2016 04:18
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants