-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Warn against JSX transform failure for non-HTTP-served JSX #4357
Conversation
I was actually thinking that this comment would go above the source code provided in the starter kit. I tend to think it doesn't need to go in the online documentation, since I think most javascript developers will have run into this before (it's standard javascript sandboxing) and will know what the browser's error message means. The comment is not intended as a unique thing about React that we are telling all readers about; it's intended more so that if someone runs the code in the starterpack, gets the error, and looks through the source code, we have a little note for them. Also, the gatekeepers for this change should probably be @spicyj or @zpao anyway. |
Sounds good - thanks for the clarification. The error is thrown on line 215 in |
SInce this is a newbie mistake, it's probably more readily findable in the html markup right above the script tag for the transform. The bug #4354 mentions helloworld.html, so that's a good place, there may be other intro-examples (the advanced examples probably don't need it, since people will work up to the advanced examples and anyone who hits it should hit the issue fairly early in their learning of React). That's my two cents anyway. Ultimate gatekeeper for this change is @spicyj or @zpao. |
This (as written at time of comment, in the JS) will probably help maybe 1 in 10 people who have the issue. It might be more effective to add to the documentation in the "Getting Started" section where you had issues. I didn't see what you had initially but it sounds like that's the direction you headed. Let's do that, and just do it in English (let translators pick up the changes in other languages). It's not a unique thing about React but it is definitely related to the use of JSXTransformer (though of course you can hit the issue with any local XHR). Also, we're not going to be building JSXTransformer in 0.14 and we're unlikely to ship anything more to 0.13 so this won't end up in user's hands. @jimfb FWIW, it's not really standard sandboxing. Different browsers have different security settings. The |
By standard, I meant it's a browser thing and not react-specific, but yeah. The specifics of the rules vary browser to browser, but protocol sandboxing is implemented in every browser. I figured people would have hit this in the past (when first learning ajax, for instance). But yeah, if people are hitting it for the first time because they're using the React transform, then we should document it for them. I have no objections to it being in the online docs if @zpao likes it there. :) |
Hi @zpao, Yes, that's where I had issues and where I initially put the comment. (Can't see it in the revision history since I rebased that those commits and force-pushed.) I just updated the PR; moved the comment to that part of the documentation where I hit the problem. |
👍 That sounds good to me. If people have more issues we can always expand on the topic. |
Warn against JSX transform failure for non-HTTP-served JSX
Warn against JSX transform failure for non-HTTP-served JSX (cherry picked from commit e9915f0)
Failures have been observed in Chrome 43 for JSX requested via XHR through file:// protocol.
Resolves #4354.
I ran the text for the English changeset through Google Translate to get the Korean, Chinese, and Japanese versions. For the Chinese version, I used "Chinese (Simplified)" as opposed to "Chinese (Traditional)".