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

JSFiddle integration #30

Closed
wants to merge 2 commits into from
Closed

JSFiddle integration #30

wants to merge 2 commits into from

Conversation

vjeux
Copy link
Contributor

@vjeux vjeux commented May 30, 2013

This is a small snippet that exploits the fact that we can run custom script on jsfiddle before the Javascript1.7 transpiler is executed. We change the script type to text/jsx to run our transpiler pipeline instead.
http://facebook.github.io/react/js/JSFiddleIntegration.js

This is a small snippet that exploits the fact that we can run custom script on jsfiddle before the Javascript1.7 transpiler is executed. We change the script type to text/jsx to run our transpiler pipeline instead.
http://facebook.github.io/react/js/JSFiddleIntegration.js
@petehunt
Copy link
Contributor

@jeffreylin can you take this one for CDN stuff?

@jeffreylin
Copy link
Contributor

FWIW, I think the selector is fragile - In the languages selector on the left in jsfiddle, you can pick between JS, JS1.7, and Coffeescript - I think this script only works for the JS1.7 option...

I wouldn't merge this unless we're sure this works on al "language" options or at least the one out of the box w/ a message - tbh I think the one out of the box is regular JS and not JS1.7.

@jeffreylin
Copy link
Contributor

@petehunt sure thing

@vjeux
Copy link
Contributor Author

vjeux commented May 30, 2013

We can't make it work with the default language unfortunately. It is a <script> tag that executes automatically. We need to use Javascript1.7 or CoffeeScript.

The goal is to provide a HelloWorld JSFiddle that people can modify and fork that is properly configured.

@zpao
Copy link
Member

zpao commented May 30, 2013

This might be OK to do short term, but we should do our best to get JSX to a point where we can ask to add JSX to the language choices.

@vjeux
Copy link
Contributor Author

vjeux commented May 30, 2013

This would be ideal indeed, but meanwhile this is a working solution

@vjeux
Copy link
Contributor Author

vjeux commented May 30, 2013

Let me update it so we have to put /** @jsx React.DOM */ in the code instead of having the script automatically inserting it.

@jeffreylin
Copy link
Contributor

Okay cool - I guess as long we tell people to fork off that JSFiddle, it should be good. =D

Maybe add an alert("Requires the Javascript 1.7 language in JSFiddle.") to the script if it can't find the script tag - just incase people copy pasta the script src.

Now using .replace instead of hardcoded numbers for readability

I had a version without document.querySelector but JSFiddle doesn't work for IE7 and IE8 :x
@vjeux
Copy link
Contributor Author

vjeux commented May 30, 2013

http://jsfiddle.net/vjeux/25Rhk/ Here's how the new base fiddle

@vjeux
Copy link
Contributor Author

vjeux commented May 30, 2013

Using JS1.7 we lose syntax highlighting unfortunately. We can already make it work with the normal Javascript but since the code is executed it displays a javascript error every time you run it. I haven't found a way to make that parsing error go away without also losing syntax highlighting :(

@vjeux
Copy link
Contributor Author

vjeux commented May 30, 2013

I just mailed Piotr Zalewa the author of JSFiddle about the issue.

@vjeux
Copy link
Contributor Author

vjeux commented Jun 1, 2013

Ping

@petehunt
Copy link
Contributor

petehunt commented Jun 1, 2013

@zpao where should this file live?

Definitely not docs/js. Maybe docs/_js

@jeffreylin
Copy link
Contributor

This lgtm - I can just toss it on fb.me if you want - lmk what URI you want. Also fwiw, it doesn't have to be the final version - we can always change where the fb.me URI points.

@vjeux
Copy link
Contributor Author

vjeux commented Jun 1, 2013

Something like: http://fb.me/react-js-fiddle-integration.js

I don't really care about the name as long as you give me the final url

@vjeux
Copy link
Contributor Author

vjeux commented Jun 1, 2013

Thanks!

@vjeux vjeux closed this Jun 1, 2013
@jeffreylin
Copy link
Contributor

@vjeux - cool - uploaded to http://fb.me/react-js-fiddle-integration.js - appears to work! =] http://jsfiddle.net/MmRXB/2/

@petehunt
Copy link
Contributor

petehunt commented Jun 1, 2013

@vjeux can you send out a pull to add this to the docs somewhere?

bvaughn added a commit that referenced this pull request Mar 14, 2018
Added React.forwardRef support to react-reconciler based renders and the SSR partial renderer.
LeonYuAng3NT pushed a commit to LeonYuAng3NT/react that referenced this pull request Mar 22, 2018
Added React.forwardRef support to react-reconciler based renders and the SSR partial renderer.
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
Added React.forwardRef support to react-reconciler based renders and the SSR partial renderer.
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

Successfully merging this pull request may close these issues.

None yet

4 participants