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

Notify application when JSXTransformer has completed processing JSX #1913

Closed
fleaflicker opened this issue Jul 22, 2014 · 5 comments
Closed

Comments

@fleaflicker
Copy link

As first discussed in #1558 (comment) .

Use case: Application code is in app.js; react code is in file ui.jsx. In development, both are included along with JSXTransformer. There's no way for app.js to reliably reference components defined in ui.jsx. (In production, JSX is first translated, then all JS files are combined/compiled together, so this is not an issue.)

As noted in the above comment, there are workarounds.

@syranide
Copy link
Contributor

Just a side-note, I really recommend that you use the jsx --watch util instead. JSXTransformer is inherently flawed with respect to script loading, use the jsx-tool and you have identical behavior for DEV and PROD (and also correct sources for all errors, in all browsers).

@zpao
Copy link
Member

zpao commented Aug 5, 2014

@RReverser if you're really interested in doing this, I don't mind. I think this is slightly more practical than #1995, but it still could encourage the wrong behavior. What do you think?

@RReverser
Copy link
Contributor

@zpao Well, if you're going to combine functionality of react-tools and JSXTransformer into single place/file, then it doesn't make much sense to add any API changes before that. Or did I misunderstand you?

@zpao
Copy link
Member

zpao commented Aug 6, 2014

I think the combining might end up being a bit more of a convergence. These things overlap a lot with slight API differences. The other big difference is that JSXTransformer finds script tags. I was considering smoothing out API differences, then having JSXTransformer be the browserify override. Any new functionality we add to JSXTransformer now would in turn make it to the new place too.

@sophiebits
Copy link
Collaborator

If you need this, I believe you can add

<script type="text/jsx">
MyApp.init();
</script>

or similar after the external script tags and that will queue it correctly.

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

4 participants