Comments (4)
I think I'm in favor of this proposal. It makes sense to me to let react-server users ship ES6/esnext directly to browsers that support it.
I haven't thought deeply about what would be required from the technical side, but it seems like we'll probably want to ship both pre-transpiled and non-transpiled code for at least a little while to give existing users a chance to migrate.
Also, I assume that as part of this proposal we'd be renaming all the files in react-server to .esm.js?
And looking further down the road, if we're shipping untranspiled code, we'll probably want some way of communicating what level of ES we support in that code, to make it easy for users to know what all the need to transpile it, if necessary?
from react-server.
@roblg My plan was to submit a PR that uses Rollup to generate a non-transpiled ESM bundle and a transpiled UMD bundle (same as what is currently being produced). No need to change any existing filenames to .esm.js...just the final bundle.
I was also planning to create an entry in the documentation on how to use the ESM bundle and that the implementer has to take ownership of transpiling any features as they see fit (i.e. recommend the Babel settings). I've been thinking through the question of "do we need to share what level of ES is supported in the code" in my personal projects and I think the answer, in general is "no, we don't." If I use ES6 in my project and React Server uses ES7, Babel will transform all of code to whatever the transform target is. If that target is ES5, then both ES6 and ES7 code is transpiled/polyfilled to ES5. If that target is ES6, then just the React Server ES7 code is transpiled. None of that is ever communicated by the React Server project though...just that fact that it must be transpiled by the end user...that's it.
from react-server.
I'm planning to work on this over the next 2 weeks, so I'll have a rough codebase to share soon.
from react-server.
If I use ES6 in my project and React Server uses ES7, Babel will transform all of code to whatever the transform target is.
In this scenario, I was imagining that React Server would tell the user via docs "We're using ES7, so transpile that however you want.", or "We're using ES7 + <this one random experimental feature that has a plugin >", as a sort of contract between us and them. It'd be super annoying if users had to figure out what they needed to transpile by trial and error.
I thin the rest makes sense to me. 👍
from react-server.
Related Issues (20)
- Upgrade to Webpack 4 + Babel 7 HOT 1
- compileOnStartup feature left out
- finishRoute() never fired when all elementPromises don't resolve
- Question:how does react-server achieve stream pre-rendered HTML
- Hi
- TODO IE8-9 Detection
- TODO if OSX && key is.Meta?
- ReactServerAgent only suited for use in pages?
- Page request fired twice when using bundleData
- Make react-loadable in the react-server HOT 1
- Hash fragment removed from URL in browser in version 0.8.1, how can I save it in URL for scroll to section?
- https://react-server.io/ returning 503 HOT 2
- TODO: handle compilation errors with a --reportwarnings flag
- TODO: create a READEME.md for flab
- TODO: use config for env var in repo.js
- TODO: support dash-separated options in config
- Improve Lerna + NPM Integration
- NPM Audit
- Do Lint Better
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-server.