Comments (9)
Your code seems to be ok. Let me check what is wrong.
from react-imported-component.
Your example is perfectly working for me. Visually. Both for dev and SSR modes.
But - rehydrateMarks
by fact does nothing - it could not found a mark to rehydrate, and not preloading async chunk before react hydrate
(causing "blink")
Something like today I am going to publish a new minor version, which changes the SSR approach. It will fix everything for any bundler you may use(thats the goal).
from react-imported-component.
To clarify, I see the client render too, but in view-source://localhost:1234/codeSplit, I don't see the script/link tags for additional css/js and the html that makes up the page.
I'll wait for your change and try again with any new logic. Thanks so much for your reply!
from react-imported-component.
There will be no additional scripts on the page. "Translating" the imports into bundler specific files is a dead end.
React-imported-component repeats the imports
you wrote in your code. From one point of view - it will delay loading by one "hop", requiring main bundle to be loaded in front, but from another - it will just work with parcel, not only with webpack, as usual.
from react-imported-component.
Is what I'm describing even possible? For SEO reasons the contents of a page (component) should be rendered by the server first. I noticed with react universal component I got as far as rendering the "Loading..." message but it did not render the component. Is this functionality unavailable in the ecosystem right now?
from react-imported-component.
All "SSR-Aware" loaders could do this. They will keep your pre-rendered content unchanged unless they will be fully prepared to replace(rehydrate) it.
But usually you have to kick loader into this waiting. Here this command names rehydrateMarks
, and it is broken a bit for parcel.
from react-imported-component.
Ok, it lead to the major version change.
v4 just got published, and your example was used as example :)
Could confirm that everything works just perfect.
from react-imported-component.
Oh wow, such an honor thank you 💃 !
I will check this out tonight. I mean, this is something quite special really. SSR, code-split react with fast compilation and zero configuration... very cool.
from react-imported-component.
Not zero :)
from react-imported-component.
Related Issues (20)
- LazyBoundry fallback doest not work with react-router-dom HOT 1
- Error: react-imported-component: no import meta-information found. Have you imported async-requires?
- Babel options to use import instead of require (for rollup) HOT 5
- Can I use ssr without nodejs? HOT 1
- [DISCUSSION] Don't Understand the Magic Comment HOT 2
- useImported on testing with react testing library HOT 2
- Unknown mark error with Module Federation SSR
- `.imported.js` uses different paths
- Is there way to fetch other chunks with main.js? HOT 2
- getFunctionSignature is slow
- [Question] Is there any way to extract the functionality of `importedComponent` ? HOT 2
- Example using Vite SSR
- Using react import component with swc compiler HOT 1
- Async non-components modules HOT 2
- Components blinks during/after application rendering. How to debug and fix that kind of issues? HOT 2
- When to use LazyBoundary in application? HOT 1
- Vite Support HOT 6
- Using react-imported-component with react 18 HOT 3
- react importeted components and esbuild-loader or swc-loader HOT 5
- react imported component and future upgrades HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-imported-component.