typst / packages

Packages for Typst.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: mini- and maximum supported Typst version for packages

emilyyyylime opened this issue · comments

Having a package break because you have the wrong Typst version could really suck. Then having to go through and painstakingly find the exact package version that supports your Typst version? Ugh.

This could be easily solvable if we let the packages themselves declare the range of Typst versions they support

Duplicate of #74? Specifying a max version is difficult because the max version for a package version will most likely not have been released yet by the time the package version is released.

Yeah this may be considered a duplicate. But if ever something is deprecated that a certain version of a package uses it would be nice to have proper error messages rather than something cryptic about this and that not being found

It's hard to make that work though since packages are immutable by design. (Minor docs fixes were made, but adding a max version would not be a minor docs fix.)

Well we could have it such that you are required to have a max version, which initially will be the same as the min version — and as Typst gets updated, you can push it back as far as you can. That way, packages never get a breaking change by limiting the supported versions, only expanding them

And besides, adding a maximum version should only need to happen if Typst itself introduces a breaking change, which should not happen often, and when it does; the motivation for it should also justify packages breaking

The thing is that we can't update the version without publishing a new package. Packages are immutable and will be cached forever once downloaded.

Closing in favor of #74

I don't think maximum version is possible.

Minimum version is implemented now, see #74.

Sorry for the necrobump, I'm having a hard time responding to things quickly lately, but

The thing is that we can't update the version without publishing a new package. Packages are immutable and will be cached forever once downloaded.

I did not realise packages are cached indefinitely; in that case, I think a good solution would be a 'target' Typst version, rather than a minimum. Using that, Typst could at the very least warn you if you're using a package targeting a different Typst version, and if you see it not working, you can figure out the connection there.

But many packages will not be broken by updates and then you will get many unnecessary warnings. Basically, I don't want to add a manifest key that breaks a package even if it wouldn't have been broken.

I get that, I guess I just don't want a package to be broken with no direct indication for that

Could Typst only output a warning if it finds a version of that package that targets a more recent version of Typst?