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

Expose react/lib/* for plugins #1906

Closed
mjackson opened this issue Jul 21, 2014 · 13 comments
Closed

Expose react/lib/* for plugins #1906

mjackson opened this issue Jul 21, 2014 · 13 comments

Comments

@mjackson
Copy link
Contributor

It's currently difficult (impossible?) to create plugins for React that use any of the stuff in lib without using crazy hacks.

What's the best way to do this? Separate modules?

@pieterv
Copy link
Member

pieterv commented Jul 21, 2014

Very much agree with this issue, the only way we (react-bootstrap project) have been able to support both amd/bower and cjs/npm environments whilst using stuff in lib's is by copying the react files into our project.

@sophiebits
Copy link
Collaborator

Can everyone who's interested in this list the specific modules/functions you're interested in? We intentionally ship a small public API so that we can feel free to make internal changes.

@mjackson
Copy link
Contributor Author

I guess the main ones I'm using right now are ExecutionEnvironment and ReactUpdates. I also use invariant and warning, but those would be pretty trivial to implement myself.

@pieterv
Copy link
Member

pieterv commented Jul 21, 2014

cloneWithProps is the big one for us, react/addons is a nightmare to configure across amd/bower and cjs/npm so not really an option.

We also use EventListener, cx, ReactTransitionEvents, invariant, merge but could understand the need to keep some of them private.

@sophiebits
Copy link
Collaborator

cx is public as React.addons.classSet so that falls into almost the same category as cloneWithProps. What are you using EventListener for?

@pieterv
Copy link
Member

pieterv commented Jul 21, 2014

We use EventListener to bind to global events with IE8 support.

@sophiebits
Copy link
Collaborator

Okay, going to count that feature request as a vote for #285.

@pieterv
Copy link
Member

pieterv commented Jul 22, 2014

Yes #285 would be prefect for what we are doing!

Also merge will no longer be needed if we can rely on Object.assign.

@davidaurelio
Copy link
Contributor

+1
I’d like to have access to ReactTransitionEvents.

@sophiebits
Copy link
Collaborator

It's unlikely we'll ever expose ReactTransitionEvents as a public API as it's just a thin wrapper around browser events and is used only in ReactCSSTransitionGroup, not more widely. (Essentially, we don't want to commit to supporting that module.)

@davidaurelio
Copy link
Contributor

That makes perfect sense, of course. It just seems so unnecessary to duplicate functionality like that when it’s “already there”.

@syranide
Copy link
Contributor

#2251 (comment)

@mjackson
Copy link
Contributor Author

It's clear now that if you're using internals, you're using them at your own risk. Going to close this for now. If anyone knows a specific internal they'd like to expose, please follow up in a separate issue.

doctyper pushed a commit to nfl/react-helmet that referenced this issue Jun 28, 2015
React’s official policy on these helpers is “use at your own risk”:
- facebook/react#1906 (comment)
- facebook/react#2251 (comment)
- facebook/react#2317
power1220 added a commit to power1220/react-helmet that referenced this issue Apr 4, 2023
React’s official policy on these helpers is “use at your own risk”:
- facebook/react#1906 (comment)
- facebook/react#2251 (comment)
- facebook/react#2317
LucSPI added a commit to LucSPI/React-Helmet that referenced this issue Feb 12, 2024
React’s official policy on these helpers is “use at your own risk”:
- facebook/react#1906 (comment)
- facebook/react#2251 (comment)
- facebook/react#2317
AMagicHarry added a commit to AMagicHarry/react-helmet that referenced this issue Mar 11, 2024
React’s official policy on these helpers is “use at your own risk”:
- facebook/react#1906 (comment)
- facebook/react#2251 (comment)
- facebook/react#2317
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

No branches or pull requests

5 participants