Comments (9)
👍
What are you thinking as a substitute? We should cover in-browser transforms as well as something like require.js (with or without in-browser transforms). Have you thought of using the Module.react.js
convention? If we went with that, all the editors will not break.
from react.
Well, we need to consider if we want JSX to be general purpose. As we talk about pulling it into it's own project we need to think about how it'll get used. If we want to keep with this idea that it's generic and you can plug in any "namespace", then we need to keep that working. Right now the transform takes @jsx Namespace
and uses that to turn <div>
into Namespace.div
. But then we also have to make sure we support other transforms (e.g. React's displayName) that will be tool specific. Also, if I plug in a pure wrapper that does document.createElement
, then I don't want to support custom components.
If we didn't have the concern of supporting other targets, then I would just say we'll transform anything that's type="text/jsx"
and *.jsx
on the command line (or *.react.js
).
For the in-browser transform, we talked about doing something like <script src="file.js" type="text/jsx" data-jsx-namespace="React.DOM"></script>
. Still doesn't quite solve the multiple transform possibilities without a map from namespace to transforms (React.DOM would use react and reactDisplayName).
For bin/jsx
we could start accepting a list of transforms? If we assume JSX is a separate package, it ships the jsx
executable. Then React would depend on JSX. React could ship the set of transforms it needs and maybe create a customized reactjsx
executable that is basically just an alias to jsx --transform react --transform reactDisplayName $1
or whatever.
from react.
Would the noise be so bad if it didn't have to be first (or specially structured)?
/**
* MyComponent
*
* This will render a super awesome component!
*
* @param object
* @returns object
* @jsx React.DOM
*/
var MyComponent = (function(React) {
return React.createClass({ ... });
}(React);
Besides that, I've been using .jsx
. I would assume anything explicitly passed to bin/jsx
or the transform script wouldn't have to check for the docblock...
from react.
That long docblock should just work right now actually :) We aren't that strict about the format so long as it's in the first docblock in the file. I haven't tested but if that doesn't work, let me know.
And that assumption that anything passed to bin/jsx
just works is a good one to make. But it doesn't actually work right now :/
from react.
Related to #832.
from react.
I'd say #1551 is kind of related too, if we go that way.
from react.
from react.
this change really disturbed my jsx usage for mithril. have to see if the new version will work somehow
from react.
@fyyyyy You can continue to use react-tools 0.11 or make your own custom transformer, like https://github.com/Raynos/mercury-jsx.
from react.
Related Issues (20)
- Bug: Empty `style={}` object values cause hydration warnings in React 18.3.1 - Includes solution
- [React 19] Cannot assign to readonly property HOT 8
- Unexpected Initial State Jump in 'useEffect" with 'setTimeout' and State Dependencies HOT 3
- React[19] Module '"react"' has no exported member 'useActionState'. HOT 2
- Bug: effect runs with stale state values outside of Concurrent React HOT 1
- Feature Request: ESLint hooks rule for accessing previous state when deriving new state
- Bug: Weird Behavior of useCallback() hook When Variables or States Are defined before and after the Callback (ES5) HOT 5
- Bug: div: `ref` is not a prop HOT 2
- Bug: useFormStatus pending state is reset when component state is updated HOT 3
- [React 19] TEST HOT 1
- `FALLBACK_THROTTLE_MS` slows tests down significantly - could it be configurable? HOT 4
- Unexpected state behavior when updating nested state objects HOT 3
- Make pre-release version naming align with semver 2 HOT 5
- [React 19] Omit the false value for custom element is an incorrect behaviour HOT 3
- Remove references to legacy class-based component architecture in error messages
- Bug: deleting structure via DOM API breaks state updates
- Module '"react"' has no exported member 'use' HOT 2
- Bug: Unexpected characters appear in the Chinese encoding during streaming HOT 4
- Bug: useState, state does not update inside websocket.onmessage rather the state value is preserved untill the next render HOT 1
- Bug: When input type=number, input 1-1 cannot trigger an onchange and cannot be set to an empty string
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.