sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

Replace sorcery #637

Closed benmccann closed 3 weeks ago

benmccann commented 3 weeks ago

Is your feature request related to a problem? Please describe.

sorcery is outdated and unmaintained. It prints deprecation warnings for users. It also adds a dependency that isn't used elsewhere in the Svelte ecosystem

Describe the solution you'd like

Replace sorcery with @ampproject/remapping like we do in Svelte

https://github.com/sveltejs/svelte-preprocess/blob/276037a78b8b0e30d99d042e84dda61e79c3a918/src/transformers/typescript.ts#L263

https://github.com/sveltejs/svelte/blob/84ad208f2e986fa549683a12e7f999c3d31b127f/packages/svelte/package.json#L132

I wonder if we even need to combine source maps though? What is injectVarsToCode doing?

Describe alternatives you've considered

Update sorcery. But even then it'd be nice to have fewer dependencies in a new SvelteKit app

How important is this feature to you?

Important at the moment because it's causing https://github.com/sveltejs/kit/issues/12258

benmccann commented 3 weeks ago

This would fix https://github.com/sveltejs/svelte-preprocess/issues/636 as well

benmccann commented 3 weeks ago

We're fixing up sander right now, which makes this less necessary, but it'd still be nice to do to reduce the dependency footprint of svelte-preprocess

dummdidumm commented 3 weeks ago

This can be ripped out entirely as part of a major if we do one soon - this code is from a time when typescript didn't have good support for separating between value and type imports

dummdidumm commented 3 weeks ago

Removed as part of #640