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

type fixes for adapter-node and adapter-static #1578

Merged
merged 2 commits into from
May 29, 2021
Merged

type fixes for adapter-node and adapter-static #1578

merged 2 commits into from
May 29, 2021

Conversation

quentin-fox
Copy link
Contributor

@quentin-fox quentin-fox commented May 28, 2021

The adapter-node and adapter-static do not actually require any arguments, which is shown in the documentation here: https://github.com/quentin-fox/kit/blob/3f82e80f14b8ebfe0d004c004b5109d70f902a47/documentation/docs/10-adapters.md#L9-L18

The Typescript types for the adapters do not indicate that the options object are optional, even though they are not required.

I also added the null type to the fallback param, since the default value is null.

@quentin-fox quentin-fox changed the title allow optional "options" params for adapter params allow optional "options" param for adapter-node and adapter-static May 28, 2021
pages?: string;
assets?: string;
fallback?: string;
fallback?: string | null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make the default undefined to simplify the types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell that'd be fine, I can't see any places where fallback couldn't be undefined instead of null, and lots of the other adapters don't specify a fallback key in utils.prerender, so that seems pretty safe. Will push that change now!

@benmccann benmccann changed the title allow optional "options" param for adapter-node and adapter-static type fixes for adapter-node and adapter-static May 29, 2021
@benmccann benmccann merged commit 6a77df0 into sveltejs:master May 29, 2021
sidharthv96 added a commit to sidharthv96/kit that referenced this pull request May 29, 2021
* 'master' of https://github.com/sveltejs/kit:
  Version Packages (next) (sveltejs#1543)
  type fixes for adapter-node and adapter-static (sveltejs#1578)
  Upgrade to Vite 2.3.3 (sveltejs#1580)
  fix: improve getRawBody parsing & handle error(s) (sveltejs#1528)
  create-svelte: add svelte-check for TS (sveltejs#1556)
  pass validated svelte config to adapters (sveltejs#1559)
  types: group related and reduce potential inconsistencies (sveltejs#1539)
  Use sveltekit tag on StackOverflow (sveltejs#1558)
  Fix create-svelte build-template script (sveltejs#1555)
  Remove err param from Polka .listen() callback (sveltejs#1550)
  bump: polka and sirv versions (sveltejs#1548)
  svelte-kit package (sveltejs#1499)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants