You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The Package System Should have a LATEST and STABLE version #1632
However, if I have to manually track the version of each published package this defeats the purpose, as I will have to track the versions manually and/or update all .typ files (per find/perl script).
I have up to now symlinked tablex.typ from a central location so only needed to worry about one file.
Use Case
I would propose, if not already done, to mandate that a package MUST have at least a STABLE and/or a LATEST (perhaps even a NIGHTLY) version, which could be by symlinked, perhaps, so that in the example of tablex@PgBiel could replace
#import"@preview/tablex:0.0.4": *
by
#import"@preview/tablex:STABLE": *
for example, to automate this.
Reacted by MindGirl, Rolf Bremer, Navdeeppal Singh, maxwell-thum, MHellmund, Y. Xu, KellyNyanbinary, Quinn, Nibs and Derived Cat
I strongly agree with this, but I also know that there are strong opinions from the other camp as well. The motivation is that documents should be reproducible.
Personally I'd rather have the convenience and accept the risk.
My idea for a less verbose way of ensuring reproducible documents is to set a date in the document, and packages will then use the version that was current at that date.
Personally, I mostly prefer the safety of having reproducible documents. But I understand that it could be nice to easily have common versions for multiple files in a project. In that sense, however, maybe a better approach could be to use a re-exports file, like some Rust crates do? Not sure here.
We have use cases for both ways (reproducible and latest versions). It would be nice to not only have it both ways, but to be able to "freeze" a version automatically in the release pipeline. "Freezing" means, the current version gets fixed for the document during the release step.
I think good editor support for autocompleting the latest version is better. If we support "latest" or "stable", then people will just use it all the time and we'll get lots of breakage down the road.
Reacted by Rolf Bremer, PgBiel, Bryce Corrigan, Migoyan and aarneng
I mean that if use the web app or have a language server installed, the package list will be autocompleted for you. This makes it easy to use the most recent version.
And about the second, so what?
Breakage is generally something we should avoid. Sometimes it's good to be forced to do something the right way rather than the easy way. Down the road someone will be happy that their document still compiles.
Oh, ok, additional complication, I have googled
https://lsp.sublimetext.io/language_servers/#typst but this is not
trivial (and should therefor not be assumed).
While I agree that breakage should be avoided, it makes the command line
tool much more cumbersome to work with.
If a package has an issue (such as tablex at the moment), any fix bumps
the version number and now one has to find all typst files that
reference that package and change the version number. With a large
number of files this can be come quite frustrating, especially for the
casual command line user, who has limited regex knowledge.
I agree that it's not ideal if you have to fix it in multiple files. You can put all your imports in a helper file and import that, but I acknowledge that this is a bit of a workaround. I could imagine allowing a typst.toml file for project configuration (think also root, exports, etc. which could be configured there) which allows to specify a project-wide default version for a package. But that could also be a bad idea in the end.
Unfortunately the import file must reside below the document root so
while very helpful for individual projects it would still require a
find/perl/regex or you must pay real attention of symlinking it from
one central location. That also works, but is complicated.
My perspective is that in addition to being powerful and fast, typst
should also be easy to use for large(er) scale document production, such
as in law offices or medical practices, where GDPR/HIPAA "forbid"
storage of documents in the cloud. Secretaries usually balk at LaTeX
and LyX, while easier, is even slower.
But, as a "normal user", most if the time I don't care. If I install some package/library, with pip in python, with cabal in Haskell, with Pkg.jl in Julia, I don't provide a version number and expect the ecosystem to deliver a sensible default (such as, the latest stable release).
Of course it is good that we can add the version number for fully reproducible documents.
With pip, I frequently run into problems specifically because of this. Old projects don't work anymore because the dependencies aren't accurately specified.
With editor support or the TOML file and a CLI command, you can have a similar workflow to pip, which specifies the most current in the project TOML file, while still having fully reproducible results.
I know this issue is a little stale, but I think having the TOML file + CLI command is the best solution. It sounds like what Rust currently does if I'm not mistaken.
It meets many needs:
If you want a specific version, you just put it in the TOML file.
If you just want the latest version, the CLI command can take the package name, find the latest stable version, and add that to the TOML file, just like cargo add does.
In any .typ files, you only need to specify the package name, not the version.
The versions are still pinned, so documents are reproducible.
Also, packages & templates already have a typst.toml file. Parsing this file is already implemented in Typst, so all that would be required is adding logic for a new dependency section.
I think this should be optional, though, and package versions should still be able to be specified in the #import statement. This would keep Typst simple, as single-file documents would still be possible. The main problem with requiring pinned versions was within multi-file projects anyways; adding a TOML file in that case isn't as big of a deal if the project is already complex.
The current plans are pretty much what @kdkasad describes above. A typst.toml file would give a convenient way to deduplicate versions across files and could also go hand in hand with allowing git imports in a safe way.
There are no plans to support downloading always the latest versions at the moment, for the reproducibility reasons laid out above, so I'll go ahead and close this.
Activity
Enivex commentedon Jun 30, 2023
I strongly agree with this, but I also know that there are strong opinions from the other camp as well. The motivation is that documents should be reproducible.
Personally I'd rather have the convenience and accept the risk.
My idea for a less verbose way of ensuring reproducible documents is to set a date in the document, and packages will then use the version that was current at that date.
ondohotola commentedon Jun 30, 2023
PgBiel commentedon Jul 1, 2023
Personally, I mostly prefer the safety of having reproducible documents. But I understand that it could be nice to easily have common versions for multiple files in a project. In that sense, however, maybe a better approach could be to use a re-exports file, like some Rust crates do? Not sure here.
RolfBremer commentedon Jul 1, 2023
We have use cases for both ways (reproducible and latest versions). It would be nice to not only have it both ways, but to be able to "freeze" a version automatically in the release pipeline. "Freezing" means, the current version gets fixed for the document during the release step.
laurmaedje commentedon Sep 4, 2023
I think good editor support for autocompleting the latest version is better. If we support "latest" or "stable", then people will just use it all the time and we'll get lots of breakage down the road.
ondohotola commentedon Sep 4, 2023
laurmaedje commentedon Sep 4, 2023
I mean that if use the web app or have a language server installed, the package list will be autocompleted for you. This makes it easy to use the most recent version.
Breakage is generally something we should avoid. Sometimes it's good to be forced to do something the right way rather than the easy way. Down the road someone will be happy that their document still compiles.
ondohotola commentedon Sep 4, 2023
laurmaedje commentedon Sep 4, 2023
I agree that it's not ideal if you have to fix it in multiple files. You can put all your imports in a helper file and import that, but I acknowledge that this is a bit of a workaround. I could imagine allowing a typst.toml file for project configuration (think also root, exports, etc. which could be configured there) which allows to specify a project-wide default version for a package. But that could also be a bad idea in the end.
ondohotola commentedon Sep 4, 2023
MHellmund commentedon Sep 5, 2023
Sometimes one wants to fix the package version.
But, as a "normal user", most if the time I don't care. If I install some package/library, with
pipin python, withcabalin Haskell, withPkg.jlin Julia, I don't provide a version number and expect the ecosystem to deliver a sensible default (such as, the latest stable release).Of course it is good that we can add the version number for fully reproducible documents.
laurmaedje commentedon Sep 5, 2023
With
pip, I frequently run into problems specifically because of this. Old projects don't work anymore because the dependencies aren't accurately specified.With editor support or the TOML file and a CLI command, you can have a similar workflow to pip, which specifies the most current in the project TOML file, while still having fully reproducible results.
kdkasad commentedon Mar 19, 2024
I know this issue is a little stale, but I think having the TOML file + CLI command is the best solution. It sounds like what Rust currently does if I'm not mistaken.
It meets many needs:
cargo adddoes..typfiles, you only need to specify the package name, not the version.Also, packages & templates already have a
typst.tomlfile. Parsing this file is already implemented in Typst, so all that would be required is adding logic for a new dependency section.I think this should be optional, though, and package versions should still be able to be specified in the
#importstatement. This would keep Typst simple, as single-file documents would still be possible. The main problem with requiring pinned versions was within multi-file projects anyways; adding a TOML file in that case isn't as big of a deal if the project is already complex.laurmaedje commentedon Apr 8, 2024
The current plans are pretty much what @kdkasad describes above. A typst.toml file would give a convenient way to deduplicate versions across files and could also go hand in hand with allowing git imports in a safe way.
There are no plans to support downloading always the latest versions at the moment, for the reproducibility reasons laid out above, so I'll go ahead and close this.