fix: revert breaking change for compiler/preprocess types location#6100
fix: revert breaking change for compiler/preprocess types location#6100
compiler/preprocess types location#6100Conversation
Reverts the change in `interface` locations in abf11bb No functionality changes.
|
I think doing a reexport at |
|
thanks for tagging me. I've got to fix the types in vite-plugin-svelte too (currently copied, but they should point to sveltes own and would then also be affected by this) Unfortunately my experience with api-extractor is limited to reusing the existing setup from vite. An alternative could be tsup https://tsup.egoist.sh/#generate-declaration-file . I agree that having an index that reexports public api is a good approach. |
It's 100% public API since it's the only location/way to access these types. It's best to make all That said, a change like ^^ cannot happen until a 4.0 release (if we're to only maintain a single access point) because it'd still be breaking. I'll update the PR to re-export types, since they've lived at their new address for 3 minor-versions & there may now be dependents relying on the new location. |
…ocation" This reverts commit 94c271c.
If they are reexported from the index, they should be imported from there - at least that's what I'm argueing.
I agree with that. Do you have an idea how to achieve that? Right now if you reexport them I think both locations will be part of the public api unless we cleanup the types afterwards in some way. |
Yes, this is the change I just made, but only to accommodate the fact that there have been 3 minor releases w/ types in the new location. The original contents of this PR would be breaking for any new imports to the new surprise location.
I manage my definition files manually because (D)TS tooling isn't worth the headspace. The best I've seen is But again – we cannot do this until 4.0. It will be a breaking change. |
Reverts the relocation of all
interfaces in abf11bbThis unintentionally introduced a breaking change in
3.32.0– this is because all/typesare auto-generated, making our source structure the/typesdistribution structure. Any file renames/relocations become a breaking change as it means that access to the types for X are now somewhere else.For a single user application, this isn't a huge deal as you can just update a single import. But it poses a bigger issue for third-party dependencies (like the Rollup plugin, or like
svelte-preprocess-esbuild) that rely on some minimum version of Svelte as a peer dependency.In code:
PR introduces no functionality changes.
Alternative solution:
We could add
export * from './typesfrom theindex.tsfile, but this means that these types now exist in two locations.