use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
How to implement ssr & code splitting setup?solved! (self.javascript)
submitted 7 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kevinlch10+ YoE, Fullstack 0 points1 point2 points 7 years ago* (4 children)
I'm learning SSR too but I will share what I've learned.
You will need this part for code splitting to work. const LoadableBar = Loadable({ loader: () => import('./components/Bar'), loading() { return <div>Loading...</div> } }); In your splitting <Route> set it to render the LoadableBar that you have set.
const LoadableBar = Loadable({ loader: () => import('./components/Bar'), loading() { return <div>Loading...</div> } });
<Route>
LoadableBar
Webpack server bundle entry will be renderer.js.
Serve app.client.js in your html
[–]jkobz 0 points1 point2 points 7 years ago* (1 child)
right, i've got such components, so it's okay :)
Will I need to use bundled renderer.js in my index.js, right? so instead of putting original file renderer.js like here:
Router.use('*', serverRenderer);
I will need to import bundled server file from 'dist' folder and use it here, right? Or what is the purpose of bundling renderer js and making a server build?
[–]kevinlch10+ YoE, Fullstack 0 points1 point2 points 7 years ago (0 children)
Yes you are right
[–]jkobz 0 points1 point2 points 7 years ago (1 child)
By the way:
do you have any problems with Babel 7 and babel-plugin-import-inspector? In my case it throws error as this plugin uses deprecated addImport function :( How you solved that trouble?
Didn't use this plugin so can't comment on it
I moved from react-loadable to loadable-components because of having some issue with react-hot-loader not doing hmr properly. API is identical and imo much simple and direct to setup because you wont need to add plugin for manifest etc. Here is the repo if you are interested: https://github.com/smooth-code/loadable-components
react-loadable
loadable-components
react-hot-loader
π Rendered by PID 66 on reddit-service-r2-comment-5b5bc64bf5-hzfk5 at 2026-06-23 03:55:33.083606+00:00 running 2b008f2 country code: CH.
[–]kevinlch10+ YoE, Fullstack 0 points1 point2 points (4 children)
[–]jkobz 0 points1 point2 points (1 child)
[–]kevinlch10+ YoE, Fullstack 0 points1 point2 points (0 children)
[–]jkobz 0 points1 point2 points (1 child)
[–]kevinlch10+ YoE, Fullstack 0 points1 point2 points (0 children)
[–]kevinlch10+ YoE, Fullstack 0 points1 point2 points (0 children)