You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[react-prerendered-component](https://github.com/theKashey/react-prerendered-component) for prerendering, partial hydration and react fragment caching
73
+
-[used-style](https://github.com/theKashey/used-styles) for CSS and critical CSS extraction
74
+
-[devolution](https://github.com/theKashey/devolution) for shipping legacy/modern bundles
What you could load using `useImported`? Everything - `imported` itself is using it to import components.
149
154
155
+
> `useImported` is an excellent example for loading translations, which are usually a simple json, in a _trackable_ way.
156
+
150
157
<aname="api"/>
151
158
152
159
# API
@@ -506,6 +513,25 @@ It does not matter how do you bundle your application - it could be even browser
506
513
- You might even dont have any separated chunk on the server side - it would still works.
507
514
- You might even ship module/nomodule scripts, using, for example, [devolution](https://github.com/theKashey/devolution) - no additional configuration would be required.
508
515
516
+
## Why you need SSR
517
+
In case of imported component SSR is a "dry run" of your application - an easy way to discover required pieces
518
+
powered by zero latency(you are already on the server) and super fast speed connection (all scripts are in memory).
519
+
520
+
However - you dont need SSR to get the same benefits on pure ClientSideRendered solutions - _prediction_ would be enought.
521
+
The common approach is to
522
+
- load first part of components, including Providers, which would load something they need. Like translations.
523
+
- then hit, and load the current route
524
+
- then do the same with the sub route
525
+
526
+
This causes effect known as `loading waves`, the effect SSR could mitigate almost in full.
527
+
528
+
However, nothing stops you from loading translation data in the parallel to the routes, and loading
529
+
route and sub route in the same time, not sequentially.
530
+
You can have backend-for-frontend, why not to have frontend-for-frontend?
531
+
Just handle route, cookies, and whatever you could handle, outside of React. [Redux-first-router](https://github.com/faceyspacey/redux-first-router) and principles behind it
532
+
are the great example of this idealogy.
533
+
534
+
509
535
### Not using React.Lazy with React-Hot-Loader
510
536
There is design limitation with React.lazy support from RHL size, so they could not be reloaded without
511
537
state loss if `lazy` is created not in the user space. At it would be created inside imported.
0 commit comments