This website requires JavaScript.
Explore
Help
Sign in
michael
/
astro
Watch
1
Star
0
Fork
You've already forked astro
0
Code
Issues
Pull requests
Projects
Releases
Packages
Wiki
Activity
58c499dc85
astro
/
test
/
fixtures
/
astro-fallback
/
astro.config.mjs
6 lines
63 B
JavaScript
Raw
Normal View
History
Unescape
Escape
Implement fallback capability (#44) * Implement fallback capability This makes it possible for a dynamic component to render fallback content on the server. The mechanism is a special `static` prop passed to the component. If `static` is true then the component knows it can render static content. Putting aside the word `static`, is this the right approach? I think giving components the flexibility to make the decision themselves *is* the right approach. However in this case we have a special property that is passed in non-explicitly. I think we have to do it this way because if the caller passes in a prop it will get serialized and appear on the client. By making this something we *add* during rendering, it only happens on the server (and only when using `:load`). Assuming this is the right approach, is `static` the right name for this prop? Other candidates: * `server` That's all I have! * Use `import.meta.env.astro` to tell if running in SSR mode. * Run formatter
2021-03-31 20:10:27 +00:00
export
default
{
extensions
:
{
Allow no config (#61) * Allow no config * Update README
2021-04-05 21:56:46 +00:00
'.jsx'
:
'preact'
,
}
,
Implement fallback capability (#44) * Implement fallback capability This makes it possible for a dynamic component to render fallback content on the server. The mechanism is a special `static` prop passed to the component. If `static` is true then the component knows it can render static content. Putting aside the word `static`, is this the right approach? I think giving components the flexibility to make the decision themselves *is* the right approach. However in this case we have a special property that is passed in non-explicitly. I think we have to do it this way because if the caller passes in a prop it will get serialized and appear on the client. By making this something we *add* during rendering, it only happens on the server (and only when using `:load`). Assuming this is the right approach, is `static` the right name for this prop? Other candidates: * `server` That's all I have! * Use `import.meta.env.astro` to tell if running in SSR mode. * Run formatter
2021-03-31 20:10:27 +00:00
}
;
Reference in a new issue
Copy permalink