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

Proper loading of asynch script setup #1327

Merged

Conversation

justin808
Copy link
Member

@justin808 justin808 commented Sep 2, 2020

Async script loading optimizes page load speed. With this fix, a bundle
can be loaded "async" and a handler function can determine when to hydrate.

See https://github.com/shakacode/react_on_rails/blob/master/docs/api/view-helpers-api.md#renderer-functions-function-that-will-call-reactdomrender-or-reactdomhydrate

For an example of this, see the docs for loadable-components SSR
https://loadable-components.com/docs/server-side-rendering/#4-add-loadableready-client-side

Loadable-Components is supported by React on Rails Pro:
https://www.shakacode.com/react-on-rails-pro


This change is Reviewable

Async script loading optimizes page load speed. With this fix, a bundle
can be loaded "async" and a handler function can determine when to hydrate.
For an example of this, see the docs for loadable-components SSR
https://loadable-components.com/docs/server-side-rendering/#4-add-loadableready-client-side

Loadable-Components is supported by React on Rails Pro:

https://www.shakacode.com/react-on-rails-pro
@justin808 justin808 merged commit 7b301f9 into master Sep 3, 2020
@justin808 justin808 deleted the justin808/trigger-init-if-not-loading-enable-async-scripts branch September 3, 2020 00:02
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.

1 participant