-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPA mode #1181
SPA mode #1181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to make lots of people super happy! Big announcement for the Summit 😄
Do you think it's worth filing an issue about force disabling SSR as well? #754 (comment)
packages/adapter-static/index.js
Outdated
|
||
return adapter; | ||
}; | ||
import commonjs from './index.cjs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be worth adding a comment here explaining why we need to use CommonJS with an ESM wrapper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realised there's actually no benefit to this file — removed
packages/adapter-static/package.json
Outdated
"format": "prettier --write . --config ../../.prettierrc --ignore-path .gitignore", | ||
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore" | ||
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore", | ||
"test": "rm -rf test/apps/*/build && uvu test test.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1183 this change can make test work in windows
I'd rather wait for that to come up organically — I would rather we investigate alternatives (like static analysis) before providing an 'eject' button that is likely to be misused. People will just forcibly disable SSR as soon as they run into the smallest SSR problem if the option is available to them, rather than working through the problem and preserving SSR-ability where possible. That would be bad stewardship on our part. |
@@ -1,4 +1,4 @@ | |||
module.exports = function ({ pages = 'build', assets = 'build' } = {}) { | |||
module.exports = function ({ pages = 'build', assets = pages, fallback = null } = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this file need to be renamed to .cjs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a requirement package an app using the |
Closes #754.
With this, we can specify a
fallback
page when usingadapter-static
. This page contains no content, but will load the SvelteKit app and invoke the router, making it suitable as a200.html
with e.g. Surge, or anindex.html
with sirv withopts.single
.If a fallback is specified,
adapter-static
won't forcibly prerender every page, just the ones withprerender = true
.I added a test suite to
adapter-static
.Before submitting the PR, please make sure you do the following
Tests
pnpm test
and lint the project withpnpm lint
Changesets
pnpx changeset
and following the prompts