Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Updates to Sapper for a smoother transition to SvelteKit #1791

Open
btakita opened this issue Jul 19, 2021 · 1 comment
Open

Updates to Sapper for a smoother transition to SvelteKit #1791

btakita opened this issue Jul 19, 2021 · 1 comment

Comments

@btakita
Copy link
Contributor

btakita commented Jul 19, 2021

Sapper development has ended but SvelteKit & Vite are not yet stable & currently not ready for some projects, particularly re: SSR issues (vitejs/vite#4230).

As anybody who has gone through a migration with a large project can attest to, unforeseen edge cases often occur. There is also hidden downstream technical risk to the SvelteKit migration being successful at this time. This often occurs where it's difficult to justify prioritizing the migration when balancing with client project needs.

In the meantime, some projects on Sapper are waiting for SvelteKit to mature to a point to where the risk of a migration is minimized. I went through the steps of transition to SvelteKit due to needing SPA support which will not occur with Sapper (#383), including converting all dependent libraries to "type": "module" among other changes suggested in https://kit.svelte.dev/migrating.

Now having to go back to supporting Sapper due to running into SSR issues including sveltejs/kit#1947, I realize that Sapper does not support ES modules & has a different api from SvelteKit. It would be great if Sapper could be retrofitted to support some of the SvelteKit configurations & api so a future transition is made easier & the migration process can be de-risked by allowing failed migrations to be transitioned back to Sapper.

The changes should be minor, such as allowing rollup.config.mjs to support ES modules (#1204). Another nice to have would be support for the load (an alternative to preload) function with the same api as SvelteKit. Any other compatible SvelteKit updates can also be backported.

Deprecation of Sapper's unique api & compatible with SvelteKit behavior may also be useful to encourage existing Sapper projects to consider & move over to SvelteKit.

btakita added a commit to btakita/hbr-sapper that referenced this issue Jul 19, 2021
@btakita
Copy link
Contributor Author

btakita commented Jul 20, 2021

I have a PR cooking to add ESM support & a global fetch via server.mjs. There's a dependency PR for cheap-watch Conduitry/cheap-watch#10. Since using a pnpm vendor multirepo to test this on my project, will need to have the cheap-watch PR merged before posting a PR for sapper.

btakita added a commit to btakita/hbr-sapper that referenced this issue Jul 20, 2021
	ESM
	+ ssr: global fetch,Request,Response,Headers
	sveltejs#1791
btakita added a commit to btakita/hbr-sapper that referenced this issue Jul 21, 2021
btakita added a commit to btakita/hbr-sapper that referenced this issue Apr 18, 2022
More similar to SvelteKit:

	ESM
	+ ssr: global fetch,Request,Response,Headers
	sveltejs#1791
btakita added a commit to btakita/hbr-sapper that referenced this issue Apr 18, 2022
More similar to SvelteKit:

	ESM
	+ ssr: global fetch,Request,Response,Headers
	sveltejs#1791

support rollup.config.mjs & webpack.config.mjs

	sveltejs#1791
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant