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

Pick-and-choose addons with Sprockets directives #457

Merged
merged 2 commits into from
Feb 2, 2016
Merged

Pick-and-choose addons with Sprockets directives #457

merged 2 commits into from
Feb 2, 2016

Conversation

danott
Copy link
Contributor

@danott danott commented Jan 26, 2016

The desire for this feature is mentioned in the comments of #447, which is mentioned in the 2.0.0 issue (#448).

With these changes, a consumer of react-rails can now pick-and-choose which add-ons they'd like to have using Sprockets require directives.

The desire for this feature is mentioned in the comments of #447, which
is mentioned in the 2.0.0 issue (#448).

With these changes, a consumer of react-rails can now pick-and-choose
which add-ons they'd like to have using Sprockets require directives.
I had done this before I finalized my actual changes! This correctly
builds the Sprockets requirable assets.
@rmosolgo
Copy link
Member

rmosolgo commented Feb 2, 2016

👍 So nice! I see this includes an update to 0.14.6 too, right? Thanks for that!

rmosolgo pushed a commit that referenced this pull request Feb 2, 2016
Pick-and-choose addons with Sprockets directives
@rmosolgo rmosolgo merged commit 833b04a into reactjs:master Feb 2, 2016
@dezmathio
Copy link

@danott @rmosolgo Does this PR only affect official React Addons or could this be used for any component? even things specifically installed via npm ?

@rmosolgo
Copy link
Member

rmosolgo commented Feb 3, 2016

Only official react addons!

@rmosolgo
Copy link
Member

Oops, I didn't realize til now -- some of these addons have require("react") and the like, which causes those dependencies to be bundled in by webpack. As a result, the addon files may also include a lot of duplicated framework code and be much larger than just the addon!

I think that's why some of them are so big:

image

I noticed this because I'm working with ReactDOMServer and it's doing the same thing! Hmmm...

@valff
Copy link

valff commented Feb 17, 2016

Such duplication causes a lot of react errors:

Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's 'render' method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

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.

5 participants