feat: stabilize text imports#34238
Conversation
| locker: locker.as_mut().map(|l| l as _), | ||
| unstable_bytes_imports: self.cli_options.unstable_raw_imports(), | ||
| unstable_text_imports: self.cli_options.unstable_raw_imports(), | ||
| unstable_text_imports: true, |
There was a problem hiding this comment.
Can you open a PR to deno_graph yo remove this setting?
bartlomieju
left a comment
There was a problem hiding this comment.
Maybe update some tests to not use the flag?
fibibot
left a comment
There was a problem hiding this comment.
This needs a direct regression test for the stabilized behavior. The PR updates the missing-unstable dynamic case from text to bytes, which preserves the negative coverage for bytes, but I don't see a positive spec that runs with { type: "text" } without --unstable-raw-imports. Most existing text import specs still opt into raw-imports, so CI can pass without proving the stable path works for static and/or dynamic text imports.
Please update one of the existing text-import specs to drop the unstable flag, or add a focused spec that imports text without --unstable-raw-imports.
- Add tests/specs/run/bytes_and_text_imports/stable_text spec that exercises static and dynamic text imports without --unstable-raw-imports, proving the stabilized path works. - cli/tools/doc.rs: set unstable_text_imports to true for the builtin types graph for consistency with cli/graph_util.rs.
|
Pushed a fix addressing the review:
|
Text imports were stabilized in denoland#34238, but `deno publish` still rejected `with { type: "text" }` imports as `unstable-raw-import` because the publish diagnostic flagged any asset import (both text and bytes). Only bytes imports remain unstable, so the diagnostic now only flags `type: "bytes"` imports. Closes denoland#34389
This stabilizes `text` imports, so that:
```ts
import hello from "./hello.txt" with { type: "text" };
```
will not require the `--unstable-raw-imports` flag.
This is as the tc39 proposal is stage 3, and the html spec changes
required are already landed.
---------
Co-authored-by: crowlbot <[email protected]>
This stabilizes
textimports, so that:will not require the
--unstable-raw-importsflag.This is as the tc39 proposal is stage 3, and the html spec changes required are already landed.