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

Docs for writing an adapter API #1846

Merged
merged 9 commits into from
Jul 8, 2021
Merged

Docs for writing an adapter API #1846

merged 9 commits into from
Jul 8, 2021

Conversation

benmccann
Copy link
Member

People have always written adapters by copying an existing one. We should probably provide more guidance. This can probably be fleshed out a bit more, but hopefully it's a starting point that we can add to

@jthegedus @jpaquim let me know if you have any suggestions from your work on writing the Firebase and Deno adapters

@ryanb I hope this helps as you take a look at writing a Begin adapter. Let me know as you go through the process if there are things missing

@benmccann benmccann added the documentation Improvements or additions to documentation label Jul 7, 2021
@changeset-bot
Copy link

changeset-bot bot commented Jul 7, 2021

⚠️ No Changeset found

Latest commit: 0821d3e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jthegedus
Copy link
Contributor

I think linking to each of the types when they're mentioned would significantly reduce time spent reading SvelteKit codebase searching for stuff, though that is in itself valuable and should probably be encouraged.

As would showing which package init and render come from.

That is if the goal of the docs is to not force people to copy/paste from another adapter.

@benmccann
Copy link
Member Author

Which types do you mean? Like where it says import('@sveltejs/kit').Adapter?

@jthegedus
Copy link
Contributor

jthegedus commented Jul 8, 2021

For types I mean:

  1. {utils, config}
  2. Converts from the patform's request to a SvelteKit request, call render, convert from a SveteKit reponse to the platform's

    request and response should link to those types in the SvelteKit repo

@benmccann
Copy link
Member Author

Thanks! Those were good suggestions. I'm going to go ahead and merge this to get something out there, but feel free to leave additional comments or send PRs against it

@benmccann benmccann merged commit d2d99e0 into master Jul 8, 2021
@benmccann benmccann deleted the adapter-api-docs branch July 8, 2021 17:49
sidharthv96 added a commit to sidharthv96/kit that referenced this pull request Jul 11, 2021
* 'master' of github.com:sidharthv96/kit: (1114 commits)
  Version Packages (next) (sveltejs#1858)
  Bump vite-plugin-svelte to 1.0.0-next.12 (sveltejs#1869)
  [fix] preserve user defined config and files on `svelte-kit package` (sveltejs#1735)
  [fix] handle undefined body on endpoint output (sveltejs#1808)
  [fix] copy essentials files from root on packaging (sveltejs#1747)
  [docs] sort config alphabetically (sveltejs#1867)
  add config.kit.package.emitTypes option (sveltejs#1852)
  [fix] add $lib alias to js/tsconfig (sveltejs#1860)
  Pass along custom properties added to Error (sveltejs#1821)
  Version Packages (next) (sveltejs#1840)
  Improve grammar in packages FAQ
  Docs for writing an adapter (sveltejs#1846)
  Additional documentation around pnpx changeset usage
  [feat] expose Vite.js `mode` from `$app/env` (sveltejs#1789)
  Service worker files exclusion support (sveltejs#1645)
  chore: Enable `vite.server.fs.strict` internally by default (sveltejs#1842)
  Test with the latest version of Svelte (sveltejs#1848)
  [docs] don't need to run pnpm install twice
  Improve HN example docs
  [fix] correct `ReadOnlyFormData` generator implementation (sveltejs#1837)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants