partial-app-loading for an isomorphic app
See original GitHub issueLooking at the partial-app-loading example, it seems it will work only for client side:
var PreDashboard = React.createClass({
mixins: [ AsyncElement ],
bundle: require('bundle?lazy!./dashboard.js'),
preRender: function () {
return <div>Loading dashboard...</div>;
}
});
In an isomorphic environment, I get the following error when I run it Server side:
Error: Cannot find module 'bundle?lazy!./dashboard.js'
It seems that bundle-loader
doesn’t recognize the module server side.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
partial-app-loading for an isomorphic app · Issue #1435 - GitHub
Looking at the partial-app-loading example, it seems it will work only for client side: var PreDashboard = React.
Read more >What is an isomorphic application? - Lullabot
In web development, an isomorphic application is one whose code (in this case, JavaScript) can run both in the server and the client....
Read more >An Introduction to Isomorphic Web Application Architecture
An isomorphic app is a web app that blends a server-rendered web app with a single-page application. On the one hand, we want...
Read more >Chapter 1. Introduction to isomorphic web application ...
An isomorphic app is a web app that blends a server-rendered web app with a single-page application. On the one hand, we want...
Read more >The Pain and the Joy of creating isomorphic apps in ReactJS
Writing isomorphic application is the simplest and the most suitable solution in this case. What parts of your app should be isomorphic?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, so I’d advise you switch to using require.ensure on the client side and a synchronous polyfill on the server.
Something like:
Your code would then also need changing from
require('bundle?lazy'...
to something more like:This will still use the
load
function fromAsyncElement
and should replicate the functionality you had previously with the bundle-loader. Let me know if it works!you just shim require.ensure in node-land to be synchronous and then it can work. I haven’t done it yet, but there will eventually be a demo.