Comments (8)
It all depends on whether std is supposed to be versioned as one package, or fully separated. If there will be separate versioning it makes most sense to publish separate packages and vice versa. If std will continue to be a "blob" i would prefer @deno/std to @std/xyz.
from deno_std.
Without this, it sounds like currently people would need to have an import map entry for each submodule they use from the standard library, where they are repeatedly specifying the version for each one that they use. Then to update std, they would have to update the version in all those import map lines.
{
"imports": {
"@std/assert", "jsr:@std/[email protected]",
"@std/fs", "jsr:@std/[email protected]",
}
}
import { assertEquals } from "@std/assert";
import { exists } from "@std/fs";
I think since std is a package made by the deno organization and that all submodules within it share the same version, it would make the most sense for std to be a package in the @deno scope along with other packages like Fresh that are made and maintained by Deno. It would also make it more clear to users that std was created by deno.
{
"imports": {
"@deno/std", "jsr:@deno/[email protected]"
}
}
import { assertEquals } from "@deno/std/assert";
import { exists } from "@deno/std/fs";
With this single package approach, it is much easier to bump the version of the standard library that you are using and will reduce the odds of you ending up using a variety of different std versions due to not updating one of your import map lines.
from deno_std.
Here's one use case, or view on why this would be a nice feature.
I tend to update std versions as well as all other libraries for all of my (monorepo) code when new Deno version comes out. Here's my current ritual, which is weekly or biweekly along with deno releases:
deno upgrade
sudo setcap CAP_NET_BIND_SERVICE=+eip ~/.deno/bin/deno
(I really hope this could be handled by deno upgrade but it is what it is)- open import_map.json
- click every external url in import map to open them in browser tabs to manually see if any new versions are available (this includes the std url)
- manually change every updated dependency
- run test suite to verify everything works with all the updated stuffs
Step 4 is the most tedious and relevant part here. I really always want to update everything to latest unless problems are detected on step 6. Along with std I only have four or so other dependencies, so manually checking everything isn't too bad.
But if std became 10+ separate libraries each with different version, the manual work for this already somewhat tedious update ritual would multiply three-fourfold. Higher amount of manual update work would possibly discourage the practice of regularly bumping dependencies to latest version.
I respect any decision you make on this. But hopefully this can clarify why an all-encompassing package might be useful.
from deno_std.
My (unsolicited) opinion is std shouldn't have versions once it becomes stable. If you really want to create a standard library for JavaScript, it should be treated as if it were a web standard. In the same way that there's no versions for fetch
, URL
or GPU
, there shouldn't be versions for std functions.
For example, if path.dirname
becomes stable, the function signature and behavior should be frozen. Issues and detected bugs must be fixed (obviously) but without changing the behavior and always keeping backward compatibility.
This split the definition from implementation details. The same function can have different implementations for different runtimes (Deno, browser, Node, Bun, etc) but the behavior is the same everywhere.
To me, this is the difference between a standard library and any other dependency.
from deno_std.
Packages within the Standard Library will have separate versions, so there's no manageable way to have this done.
from deno_std.
I'm in favor having all-in-one @std/std
as convenient entrypoint for all modules.
I think we need some consideration about versioning of it.
- Does major version bump of any stable submodule cause major version bump of
@std/std
? - What happens when 'unstable' module did a breaking change?
from deno_std.
I'm -1 for this. Having two sets of versions (std
as a whole and individual modules) makes navigating versions more complicated than it is worth for maintainers and users. It also muddies the idea that the Standard Library will be a collection of modules, which is what we're trying to do by enabling workspaces functionality and JSR.
It appears this is all to avoid having a few extra imports, which doesn't seem like a problem to me. We do it for all other dependencies. Why should the Standard Library be any different?
from deno_std.
To better clarify my point here, I think a std library should be imported like this:
import join from "std:path/join";
Instead of this:
import join from "jsr:@std/[email protected]/join";
Std library shouldn't have a versions because it's not like another dependency. It's a collection of functions provided by the runtime, similar to node:
modules, but with cross-runtime support.
from deno_std.
Related Issues (20)
- suggestion: mention deprecated module before removal HOT 1
- 0.222.0 introduced breaking std/log behavior HOT 5
- suggestion: simplify `load()` from `std/dotenv` HOT 5
- suggestion: add hexdump format for `ArrayBuffer` HOT 11
- suggestion: add guide on how to use the Standard Library in the browser HOT 1
- Change publish workflow to use canary HOT 1
- todo: split `toml/test.ts` into separate files HOT 2
- [http/file_server] Show local network IP HOT 4
- The Road to Stabilizing the Standard Library HOT 2
- todo: create test for `std/http/file-server` HOT 1
- `csv/parse_test.ts` has type errors, but they are not caught in CI HOT 1
- Add a lazy method
- `it.ignore` and friends not type checking correctly when consumed from jsr.io HOT 2
- proposal: stabilize `std/bytes`
- [testing/bdd] async `describe`
- todo: document migration guides for deprecated APIs
- suggestion: deprecate `std/collections` APIs in favour of new `Set` methods
- proposal: stabilize `std/collections`
- chore: improve the output of `_tools/check_circular_package_dependencies.ts`
- `jsr:@std/http/file-server` stucks the compiled programs. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno_std.