Skip to content

Idea: Host codemods on the website #11080

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

Closed
gaearon opened this issue Oct 4, 2017 · 8 comments
Closed

Idea: Host codemods on the website #11080

gaearon opened this issue Oct 4, 2017 · 8 comments

Comments

@gaearon
Copy link
Collaborator

gaearon commented Oct 4, 2017

It would be nice to provide a REPL for codemods on the website, especially for createClass or PropTypes conversion. This is handy for one-offs like converting StackOverflow answers or fiddles, but also introduces people to the idea of codemodding in a playful way. The REPL can include instructions on running it locally on the bottom.

@bvaughn
Copy link
Contributor

bvaughn commented Oct 4, 2017

Sounds fun. How do you see this in relation to reactjs/react-codemod? Does one link to the other? Or would we fork a few of the more common code-mods for this REPL?

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 4, 2017

I imagined we'd somehow just run those in the browser. To be honest I didn't think how to do it 🙈

@bvaughn
Copy link
Contributor

bvaughn commented Oct 4, 2017

Fair!

Seems like we could add the NPM react-codemod module to the website's deps and embed a few of them that way.

I'd be happy to play around with this at some point. I enjoy REPL stuff.

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 4, 2017

Another thing that's missing is HTML -> JSX converter. There is one at https://github.com/reactjs/react-magic/blob/master/README-htmltojsx.md but apparently it points back to our website which doesn't provide it anymore 😛 We should just host it and then link "Invalid prop className" warnings to it.

@bvaughn
Copy link
Contributor

bvaughn commented Oct 5, 2017

There isn't actually one on our site:
https://github.com/facebook/react/blob/master/docs/html-jsx.html

Let's just update the doc you're talking about to point to http://magic.reactjs.net/htmltojsx.htm so we don't need to continue to support the redirect? There's no reason for the react-magic docs to link to the React website to then redirect back to the react-magic website

Edit I'll open a PR: reactjs/react-magic/pull/145

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 5, 2017

Let's just update the doc you're talking about to point to http://magic.reactjs.net/htmltojsx.htm so we don't need to continue to support the redirect?

Sorry I didn’t clarify. I meant that I would prefer it to be an official tool, not just a volunteer-run project that breaks every time we do a release. Only then would I feel comfortable linking to it from the warnings.

So I don’t mean just hosting it, but making it visible somewhere on the website (and not just if you know the link), and actually making it a solid official tool. Of course that would involve some work which we don’t currently have time to do.

@bvaughn
Copy link
Contributor

bvaughn commented Oct 6, 2017

Well the PR I sent should pull us out of the loop so that it wouldn't break when we did future releases.

@bvaughn
Copy link
Contributor

bvaughn commented Oct 6, 2017

Moved to reactjs/react.dev/issues/12!

@bvaughn bvaughn closed this as completed Oct 6, 2017
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

2 participants