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

use sveltejs/adapter-auto #100

Merged
merged 9 commits into from
Sep 5, 2022
Merged

use sveltejs/adapter-auto #100

merged 9 commits into from
Sep 5, 2022

Conversation

ak4zh
Copy link
Collaborator

@ak4zh ak4zh commented Aug 27, 2022

Switched @sveltejs/adapter-netlify to @sveltejs/adapter-auto
Will close #74

Working deployments:

  • Netlify
  • Vercel
  • Cloudflare

@swyxio
Copy link
Owner

swyxio commented Aug 27, 2022

sounds good. i have my own skepticism of adapter-auto, as it means we are constrained to using lowest-common-denominator features of all 3 platforms. but not backed by any research.

@ak4zh
Copy link
Collaborator Author

ak4zh commented Aug 27, 2022

@sw-yx I am not sure, but it seems adapter-auto detects the platform and installs the latest version of the platform specific adapter.
Additionally, if you want to lock the adapter version it seems we can add platform specific adapter alog with the auto.

I haven't tried, but as per the adapter-netlify readme it seems this should be possible.

If you're using adapter-auto, you don't need to install this unless you need to specify Netlify-specific options, since it's already included.

"@sveltejs/adapter-auto": "^1.0.0-next.66",
"@sveltejs/adapter-netlify": "^1.0.0-next.71",

@swyxio
Copy link
Owner

swyxio commented Aug 28, 2022

yeah so the question is what exactly are the netlify specific options, and when do we want to use them

for example the edge rendering looks really good. not sure how adapter-auto works with vercel/cloudflare offerings

@ak4zh
Copy link
Collaborator Author

ak4zh commented Aug 28, 2022

@sw-yx I think everything you set as adapter options are the platform specific options.

To emable edge in verdel you do following:

import adapter from '@sveltejs/adapter-vercel';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter({ edge: true }),
	}
};

for netlify it’s:

import adapter from '@sveltejs/adapter-netlify';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter({ edge: true }),
	}
};

I am not sure if setting the edge to true in adapter-auto enabled for both, if not then may be we need to add a new var PLATFORM and import the adapter depending on the env var.
Or may be dig deeper into the adapter-auto code to see how it detects the platform and use appropriate adapter.

For now we are not using any platform specific options so it is safe to use adapter-auto as it deploys on with netlify and vercel.

@swyxio
Copy link
Owner

swyxio commented Aug 28, 2022

ok lets see how it goes - is this PR still in draft or is it good to go?

@ak4zh ak4zh marked this pull request as ready for review August 28, 2022 09:18
@swyxio
Copy link
Owner

swyxio commented Sep 5, 2022

failling build now
image

@swyxio
Copy link
Owner

swyxio commented Sep 5, 2022

this works so sticking with this for now but i have reported the issue in sveltejs/kit#6592

@swyxio swyxio merged commit 72b3860 into swyxio:main Sep 5, 2022
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 this pull request may close these issues.

Use adapter-auto to allow deploy on other supported platform
2 participants