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
how does astro resolve client island dependencies referenced in astro file?
fundamental difference is that astro can "discover" client component by <Comp client:... /> directive inside server file itself. On the other hand, RSC convention is that it needs to discover via "use client" by reading the file of importee import { Comp } from "some-dep".
okay, I remembered it's fine if dependency is externalized both server and client. The peculiarity of RSC is that we need to inline server component library, but then at that point, it's not possible to keep externalized (i.e. optimizable) client resolution.
is it a thing to have .astro file as external package and have island inside? that would give a similar situation.
interestingly, at least astro resolves renderer-url using client module graph? e.g.
probably ModuleLoader.resolveId during initial ssr is going to help collecting dependency on initial render without explicitly doing optimizeDeps.entries.
server page hmr?
can it preserve client component state? (again similar to 1st point, it needs to preserve ?t=... etc...)
it looks like it's browser full-reload.
server island
does it have round trip for server island fetching? or is server island rendering concatenated to prerendered html (like prerender/resume api)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
<Comp client:... />
directive inside server file itself. On the other hand, RSC convention is that it needs to discover via"use client"
by reading the file of importeeimport { Comp } from "some-dep"
..astro
file as external package and have island inside? that would give a similar situation.renderer-url
using client module graph? e.g.renderer-url="/node_modules/.vite/deps/@astrojs_react_client__js.js?v=3f033ca6"
component-url="/node_modules/.vite/deps/react-wrap-balancer.js?v=c0973f4b"
SSRResult.resolve, DevPipeline.resolve, resolveIdToUrl, ModuleLoader.resolveId
seems to be the key.resolveIdToUrl
looks familiar normalization trick.optimizeDeps.entries
#560ModuleLoader.resolveId
during initial ssr is going to help collecting dependency on initial render without explicitly doingoptimizeDeps.entries
.?t=...
etc...)Beta Was this translation helpful? Give feedback.
All reactions