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

Interactive documentation for JSX #26

Closed
bvaughn opened this issue Oct 6, 2017 · 6 comments
Closed

Interactive documentation for JSX #26

bvaughn opened this issue Oct 6, 2017 · 6 comments

Comments

@bvaughn
Copy link
Contributor

bvaughn commented Oct 6, 2017

This issue was originally reported by @viebel via facebook/react/issues/10646:

The interactive version of the "JSX in depth" article got a nice traction today on Hacker News.

The interactive snippets are powered by the Klipse plugin (I'm the author of the plugin). The evaluation is done on the client side: no server is involved at all!

Would you consider trying the Klipse plugin on the official react documentation?

@viebel
Copy link

viebel commented Oct 8, 2017

Hello guys,
Please share your thoughts and concerns about this idea.

As a starter, here is the main value points and the concerns as I see it:

Value to the readers

they can experiment with the code snippets without having to leave the page.

Concerns

the size of the javascript files:

  • klipse plugin: 1.1 MB, 224KB zipped
  • babel: 1.4 MB, 459 KB zipped
  • codemirror: a few KBs

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 8, 2017

Those file sizes are valid concerns certainly. I think we could potentially do some things to mitigate them. On the Babel REPL (source code here) we do a couple of things to help with this:

  • Load all big libs (eg Babel, big plug-ins) from CDN to benefit from browser cache.
  • Defer loading any plug-ins until needed.
  • Load them into a web-worker context so that compilation doesn't slow down the UI thread.

@viebel
Copy link

viebel commented Oct 10, 2017

Before reducing the footprint, would you like to give it a try on one or two pages of the react documentation and feel how it feels both on desktop and on mobile?

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 10, 2017

I think it would be reasonable to put together a minimal proof-of-concept to see how the UX was before we worry too much about performance optimizations, sure.

@viebel
Copy link

viebel commented Nov 2, 2017

Hello guys,

I've been working on an integration of Klipse using [gatsby-plugin-klipse] (https://github.com/ahmedelgabri/gatsby-plugin-klipse) written by @ahmedelgabri. Here is the Work-In-Progress pull request #236
Let's continue the discussion there.

@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 6, 2017

I'm going to close this issue for now, for the reasons I mentioned in my comment on PR #236. I'm happy to keep talking about and re-evaluate any new ideas of proofs of concept though! ❤️

@bvaughn bvaughn closed this as completed Nov 6, 2017
jhonmike pushed a commit to jhonmike/reactjs.org that referenced this issue Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants