Skip to content
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

adapter-static documentation out of sync with NPM #4850

Closed
elliott-with-the-longest-name-on-github opened this issue May 8, 2022 · 2 comments · Fixed by #4875
Closed

adapter-static documentation out of sync with NPM #4850

elliott-with-the-longest-name-on-github opened this issue May 8, 2022 · 2 comments · Fixed by #4875

Comments

@elliott-with-the-longest-name-on-github
Copy link
Contributor

Describe the bug

The NPM page for adapter-static is missing the latest updates to the documentation. I can see at least these parts missing:

// svelte.config.js
import adapter from '@sveltejs/adapter-static';

export default {
  kit: {
    adapter: adapter({
      // default options are shown
      pages: 'build',
      assets: 'build',
      fallback: null,
      precompress: false
    }),
-
-    prerender: {
-      // This can be false if you're using a fallback (i.e. SPA mode)
-      default: true
-    }
  }
};

And this whole section:

When operating in SPA mode, you can omit config.kit.prerender.default (or set it to false, its default value), and only pages that have the prerender option set will be prerendered at build time.

SvelteKit will still crawl your app's entry points looking for prerenderable pages. If svelte-kit build fails because of pages that can't be loaded outside the browser, you can set config.kit.prerender.entries to [] to prevent this from happening. (Setting config.kit.prerender.enabled also has this effect, but would prevent the fallback page from being generated.)

⚠️ During development, SvelteKit will still attempt to server-side render your routes. This means accessing things that are only available in the browser (such as the window object) will result in errors, even though this would be valid in the output app. To align the behavior of SvelteKit's dev mode with your SPA, you can call resolve() with a parameter of {ssr: false} inside the handle() hook.

Reproduction

Linked to the NPM page above. Compare to the GitHub README.

Logs

N/A

System Info

N/A

Severity

annoyance

Additional Information

Confusing people in Discord. :(

@Conduitry
Copy link
Member

I guess what this comes down to is "which readme updates warrant a changeset so that they then get published in a timely fashion" and I don't have a good answer to that. The npm readme is only updated when the package is published, and it's been a couple of months since then.

@elliott-with-the-longest-name-on-github
Copy link
Contributor Author

If it's a low-velocity package, it seems like any changes should trigger a patch. Otherwise, what's the point of changing the documentation? For higher-velocity ones (like Kit), I could see rolling them into releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants