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

Give the user a warning when using unoptimized JSX code #359

Merged
merged 3 commits into from
Sep 19, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions vendor/browser-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var load = exports.load = function(url, callback) {
var xhr;
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP')
: new XMLHttpRequest();

// Disable async since we need to execute scripts in the order they are in the
// DOM to mirror normal script loading.
xhr.open('GET', url, false);
Expand Down Expand Up @@ -79,6 +80,8 @@ runScripts = function() {
return script.type === 'text/jsx';
});

console.warn("You are using the in-browser JSX transformer. Be sure to precompile your JSX for production - http://facebook.github.io/react/docs/tooling-integration.html#JSX");

jsxScripts.forEach(function(script) {
if (script.src) {
load(script.src);
Expand Down