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

Defer loading Babel until it is needed #2

Closed
bvaughn opened this issue Oct 6, 2017 · 7 comments · Fixed by #100
Closed

Defer loading Babel until it is needed #2

bvaughn opened this issue Oct 6, 2017 · 7 comments · Fixed by #100

Comments

@bvaughn
Copy link
Contributor

bvaughn commented Oct 6, 2017

We currently load Babel via CDN (which is nice) but we load it in the <head> of the page (which is not so nice). We should only load it on pages that actually use it (eg pages that use the CodeEditor).

Check out the Babel website's REPL for an example of similar deferred loading.

@renanpvaz
Copy link
Contributor

Is it necessary to use a worker or could it be achieved through XHR + eval?

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 6, 2017

Worker is totally not necessary (but a nice touch). I built a non-worker based version for Babel REPL initially. (It's there in the Git history if you're curious.)

@renanpvaz
Copy link
Contributor

Okay, I'll look into it and then attempt to fix the issue.

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 6, 2017

Okay. I've tagged this as "in-progress" then. Please let me know if you decide not to submit a PR and I'll remove that label so someone else can claim the task.

@renanpvaz
Copy link
Contributor

@bvaughn should docsearch be loaded the same way?

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 9, 2017

Could be pretty cool to just-in-time load Algolia too, yeah. 😄

I plan to remove it in favor of a client-side search solution like js-worker-search at some point in the future so I hadn't considered it much. That being said, it might take me a long time to get to that so...

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 9, 2017

Check out issue #98 for my thoughts on that if you're interested

mjackson added a commit that referenced this issue Jan 12, 2018
Add "Using Props Other Than Render" to Render Props
alexkrolick referenced this issue in alexkrolick/reactjs.org Mar 6, 2018
Create "Accessing refs" section above specific examples
gaearon pushed a commit to gaearon/reactjs.org that referenced this issue Feb 9, 2019
* Added page translation: basics -> hello world

* hello-world: improvements

* hello-world: fixes

* hello-world: improvements

* Update content/docs/hello-world.md

Typo correction

Co-Authored-By: ModPhoenix <ivanchenko.b@gmail.com>

* Update content/docs/hello-world.md

Improvement

Co-Authored-By: ModPhoenix <ivanchenko.b@gmail.com>

* Improved translation
@kail-287 kail-287 mentioned this issue Dec 19, 2019
jhonmike pushed a commit to jhonmike/reactjs.org that referenced this issue Jul 1, 2020
* Update 2019-08-15-new-react-devtools.md

* Apply suggestions from code review

Co-Authored-By: Júlio Campos <jcserracampos@gmail.com>

* Apply suggestions from code review reactjs#2

Co-Authored-By: Jhon Mike <developer@jhonmike.com.br>
gaearon added a commit that referenced this issue Oct 4, 2022
* Added documentation for React.createFactory

* Update beta/src/content/apis/react/createFactory.md

Co-authored-by: Strek <ssharishkumar@gmail.com>

* minor editorial updates (#2)

* Update createFactory.md

* Update createFactory.md

* edits

Co-authored-by: Strek <ssharishkumar@gmail.com>
Co-authored-by: Holly Sweeney <77758406+holly1238@users.noreply.github.com>
Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants