Comments (5)
It sounds like you just need to load a global from a different WebJar. But I don't fully understand the problem.
from react.
What webjar would you suggest?
Based on the discussion in the fb issue (linked to here) it seems like the problem is that during the creation of the js files (browserify or what else is being used) the ReactDOMServer reference is not exported (unlike ReactDOM does)
Can that be fixed during the preparation of the js files?
from react.
Yes, the problem is that only React
and ReactDOM
objects are exposed to global, but not ReactDOMServer
. So if you don't have access to require
(all systems but Node basically), there is no way (any more) to use renderToString
since it has moved from React
to ReactDOMServer
.
I get that you want to minimize the API footprint/surface area. We don't want a whole bunch of objects in global. But what about a middle ground where we expose ReactDOMServer
via one of the objects that are already in global?
E.g. I'd love to be able to do this:
var ReactDOMServer = ReactDOM.ReactDOMServer;
It would be a single line of code in the React codebase and would make it much simpler to use React on e.g. Nashorn. As it stands we are forced to either polyfill the CommonJS module system or use Node+Broswerify+Babel / Node+Webpack+Babel etc combinations to build a bundle file that does expose ReactDOMServer
.
from react.
Can that be fixed during the preparation of the js files?
There isn't any preparation for this WebJar. The upstream zip is downloaded and then repackaged into a WebJar.
I'm not sure if there is anything that can be done in the WebJar. But I'll leave this open since I don't fully understand the issue.
from react.
It is my understanding that this pull request will fix this issue. So I think this one can be closed.
from react.
Related Issues (20)
- React 0.12.2 Released
- Upgrade to reactjs 0.13 HOT 1
- Upgrade to 0.13.1
- Upgrade to 0.13.3
- Package 0.14.0
- React 0.14.1 and 0.14.2 released HOT 1
- Update to ReactJs 0.14.7 HOT 1
- Update to 0.14.8
- Update to 0.15.0
- Version 15.0.1 is out
- Update to React 15.1.0
- Upgrade to React 15.3.2
- Please Release Version: 15.6.1
- v15.6.1 does not resolve HOT 6
- Please Release Version: 16.2.0
- Please Release Version: 16.3.2
- Please Release Version: 16.4.2 HOT 3
- Please Add React-Dom files to this webjar HOT 2
- Please Release Version: 16.5.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.