svelte-adapter-azure-swa icon indicating copy to clipboard operation
svelte-adapter-azure-swa copied to clipboard

Move to latest Node version

Open geoffrich opened this issue 9 months ago • 5 comments

Docs and demo app are still using Node 18.

geoffrich avatar Mar 03 '25 05:03 geoffrich

20 is in preview at the moment https://learn.microsoft.com/en-us/azure/static-web-apps/languages-runtimes#api Would say not a high prio.

ktarmyshov avatar Mar 03 '25 09:03 ktarmyshov

Node 18 will be EoS on May 31 2025 and Node 20 is not in preview anymore

fuji97 avatar Apr 11 '25 09:04 fuji97

@geoffrich I did the migration in my fork here: https://github.com/kt-public/svelte-adapter-azure-swa. I have not tested it with my project yet, demo-app works fine. But it's a massive update with a lot of automation (retry for azure, dependabot & generation of release notes, codeql, etc.). So maybe this should go not to main, but to a separate branch first, which you could review when you get the time and take over, what suits you. So let me know, if I should create a PR and to which branch.

@fuji97 If you under pressure, I published this experimental here: https://www.npmjs.com/package/svelte-adapter-azure-swa-next, but you may want to fix the exact version, cause I'm updating that one as I'm gonna proceed with my app.

Cheers, Konstantin

ktarmyshov avatar Apr 12 '25 16:04 ktarmyshov

@ktarmyshov Thank you for the release, but I'm not under pressure until Azure doesn't completely remove node 18 from the available runtimes. I just want to be sure that eventually the adapter will be ported to node 20.

fuji97 avatar Apr 16 '25 08:04 fuji97

For my reference, this is the commit from the fork that moves to node 20: https://github.com/kt-public/svelte-adapter-azure-swa/commit/1281d72f4ced5a1a88f7e6ebece05eeaed6671e6

Hoping to test & release the change this week, but it's a busy week for me and could slip to next week.

If anyone needs the change sooner, you should be able to override the function's api runtime with the customStaticWebAppConfig option, e.g.

export default {
	kit: {
		...
		adapter: azure({
			customStaticWebAppConfig: { 
				platform: {
					apiRuntime: 'node:20'
				}
			}
		})
	}
};

geoffrich avatar Apr 16 '25 16:04 geoffrich

v0.22 generates a Node 20 Azure function for server rendering by default.

geoffrich avatar May 01 '25 17:05 geoffrich