Skip to content

Remove PartialOrd and Ord for FileId - #7708

Merged
laurmaedje merged 1 commit into
mainfrom
remove-file-id-ord
Jan 16, 2026
Merged

laurmaedje merged 1 commit into
mainfrom
remove-file-id-ord

Conversation

@laurmaedje

Copy link
Copy Markdown
Member

These are kinda dangerous because the are totally unsemantical and just compare the raw number. In some cases this can be useful, e.g. if you want to use a FileId in a BTreeMap and don't care about the semantics of the ordering, but in those cases it would be better to use a wrapper type that makes use of FileId::into_raw to make this explicit.

@laurmaedje
laurmaedje added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 9f3a9e7 Jan 16, 2026
@laurmaedje
laurmaedje deleted the remove-file-id-ord branch January 16, 2026 11:17
jassielof pushed a commit to jassielof/typst that referenced this pull request Jan 16, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 15, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 24, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request Jun 1, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin added a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 15, 2026
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top
of the world/output API group and keeps this slice focused on the new
Typst path model.

## Upstream Typst Changes

- [`typst/typst#7555` Add file `path`
type](typst/typst#7555)
- Introduces the new rooted path model around `RootedPath`,
`VirtualRoot`, and `VirtualPath`.
- `RootedPath` identifies a virtual file location as a pair of root plus
virtual path.
- `VirtualRoot::Project` represents the canonical project root;
`VirtualRoot::Package(PackageSpec)` represents a package root.
- `FileId` is now backed by an interned rooted path instead of the old
optional-package plus path shape. This is why tinymist code now creates
file IDs with `RootedPath::new(...).intern()` / `FileId::unique(...)`
and reads roots through `file_id.root()`.
- Tinymist must preserve its own workspace, untitled, rootless, and
package-root concepts on top of Typst's new project/package root model.

- [`typst/typst#7688` Robust `VirtualPath` type that pre-validates
paths](typst/typst#7688)
- `VirtualPath` construction is no longer just a lossy wrapper around
arbitrary paths; it validates the path shape up front.
- Call sites that previously used raw `Path` conversion now need
`VirtualPath::new(...)`, `VirtualPath::virtualize(...)`, `join(...)`,
`realize(...)`, `get_with_slash()`, or `get_without_slash()` depending
on whether the value is still virtual or should be rendered as a
platform path.
- Tinymist updates workspace entry selection, mock VFS/world paths,
query fixtures, docs imports, rename resolution, and document-link
resolution so virtual paths remain valid and source-relative.

- [`typst/typst#7708` Remove `PartialOrd` and `Ord` for
`FileId`](typst/typst#7708)
- `FileId` should be treated as an opaque interned identifier, not as a
stable ordering key.
- Tinymist replaces ordering-sensitive behavior with explicit
package/path keys where determinism matters, e.g. coverage summaries and
fixture/test ordering.

- [`typst/typst#8215` Request standard library from `World` once
upfront](typst/typst#8215)
- This PR does not include the runtime/engine adaptation from that
group.
- It only carries over the minimal `typst-utils` workspace dependency
because the original nightly order introduced that dependency before
`444c2f2a`, while this logical path-model group already needs
`typst-utils.workspace = true` in `tinymist-query`.

## Tinymist Changes

- Ports the VFS path mapper to `RootedPath`, `VirtualRoot`, and
validated `VirtualPath` operations.
- Updates `EntryState`, mock VFS/world helpers, and tests to create
valid virtual paths instead of relying on raw path wrapping.
- Updates workspace/package/rootless path resolution so tinymist's
workspace IDs continue to map onto Typst package roots where needed.
- Updates analysis, docs, package import, rename, and document-link code
to resolve relative imports from the source file's parent in the new
path model.
- Simplifies import path parent resolution so invalid parent paths
naturally short-circuit instead of falling back to the original virtual
path.
- Adds compatibility helpers in `typst-shim`:
- `as_rooted_path_compat()` for rendering a `VirtualPath` with a leading
slash across stable/nightly Typst APIs.
- `as_rootless_path_compat()` for rendering the same path without a
leading slash.
- `package_compat()` for obtaining the package root through the old or
new `RootedPath` API.
- Keeps snapshot churn and unrelated analysis/runtime changes out of
this PR; those remain for later groups.

---------

Co-authored-by: paran3xus <[email protected]>
Myriad-Dreamin added a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 15, 2026
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top
of the world/output API group and keeps this slice focused on the new
Typst path model.

- [`typst/typst#7555` Add file `path`
type](typst/typst#7555)
- Introduces the new rooted path model around `RootedPath`,
`VirtualRoot`, and `VirtualPath`.
- `RootedPath` identifies a virtual file location as a pair of root plus
virtual path.
- `VirtualRoot::Project` represents the canonical project root;
`VirtualRoot::Package(PackageSpec)` represents a package root.
- `FileId` is now backed by an interned rooted path instead of the old
optional-package plus path shape. This is why tinymist code now creates
file IDs with `RootedPath::new(...).intern()` / `FileId::unique(...)`
and reads roots through `file_id.root()`.
- Tinymist must preserve its own workspace, untitled, rootless, and
package-root concepts on top of Typst's new project/package root model.

- [`typst/typst#7688` Robust `VirtualPath` type that pre-validates
paths](typst/typst#7688)
- `VirtualPath` construction is no longer just a lossy wrapper around
arbitrary paths; it validates the path shape up front.
- Call sites that previously used raw `Path` conversion now need
`VirtualPath::new(...)`, `VirtualPath::virtualize(...)`, `join(...)`,
`realize(...)`, `get_with_slash()`, or `get_without_slash()` depending
on whether the value is still virtual or should be rendered as a
platform path.
- Tinymist updates workspace entry selection, mock VFS/world paths,
query fixtures, docs imports, rename resolution, and document-link
resolution so virtual paths remain valid and source-relative.

- [`typst/typst#7708` Remove `PartialOrd` and `Ord` for
`FileId`](typst/typst#7708)
- `FileId` should be treated as an opaque interned identifier, not as a
stable ordering key.
- Tinymist replaces ordering-sensitive behavior with explicit
package/path keys where determinism matters, e.g. coverage summaries and
fixture/test ordering.

- [`typst/typst#8215` Request standard library from `World` once
upfront](typst/typst#8215)
- This PR does not include the runtime/engine adaptation from that
group.
- It only carries over the minimal `typst-utils` workspace dependency
because the original nightly order introduced that dependency before
`444c2f2a`, while this logical path-model group already needs
`typst-utils.workspace = true` in `tinymist-query`.

- Ports the VFS path mapper to `RootedPath`, `VirtualRoot`, and
validated `VirtualPath` operations.
- Updates `EntryState`, mock VFS/world helpers, and tests to create
valid virtual paths instead of relying on raw path wrapping.
- Updates workspace/package/rootless path resolution so tinymist's
workspace IDs continue to map onto Typst package roots where needed.
- Updates analysis, docs, package import, rename, and document-link code
to resolve relative imports from the source file's parent in the new
path model.
- Simplifies import path parent resolution so invalid parent paths
naturally short-circuit instead of falling back to the original virtual
path.
- Adds compatibility helpers in `typst-shim`:
- `as_rooted_path_compat()` for rendering a `VirtualPath` with a leading
slash across stable/nightly Typst APIs.
- `as_rootless_path_compat()` for rendering the same path without a
leading slash.
- `package_compat()` for obtaining the package root through the old or
new `RootedPath` API.
- Keeps snapshot churn and unrelated analysis/runtime changes out of
this PR; those remain for later groups.

---------

Co-authored-by: paran3xus <[email protected]>
Myriad-Dreamin added a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 15, 2026
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top
of the world/output API group and keeps this slice focused on the new
Typst path model.

- [`typst/typst#7555` Add file `path`
type](typst/typst#7555)
- Introduces the new rooted path model around `RootedPath`,
`VirtualRoot`, and `VirtualPath`.
- `RootedPath` identifies a virtual file location as a pair of root plus
virtual path.
- `VirtualRoot::Project` represents the canonical project root;
`VirtualRoot::Package(PackageSpec)` represents a package root.
- `FileId` is now backed by an interned rooted path instead of the old
optional-package plus path shape. This is why tinymist code now creates
file IDs with `RootedPath::new(...).intern()` / `FileId::unique(...)`
and reads roots through `file_id.root()`.
- Tinymist must preserve its own workspace, untitled, rootless, and
package-root concepts on top of Typst's new project/package root model.

- [`typst/typst#7688` Robust `VirtualPath` type that pre-validates
paths](typst/typst#7688)
- `VirtualPath` construction is no longer just a lossy wrapper around
arbitrary paths; it validates the path shape up front.
- Call sites that previously used raw `Path` conversion now need
`VirtualPath::new(...)`, `VirtualPath::virtualize(...)`, `join(...)`,
`realize(...)`, `get_with_slash()`, or `get_without_slash()` depending
on whether the value is still virtual or should be rendered as a
platform path.
- Tinymist updates workspace entry selection, mock VFS/world paths,
query fixtures, docs imports, rename resolution, and document-link
resolution so virtual paths remain valid and source-relative.

- [`typst/typst#7708` Remove `PartialOrd` and `Ord` for
`FileId`](typst/typst#7708)
- `FileId` should be treated as an opaque interned identifier, not as a
stable ordering key.
- Tinymist replaces ordering-sensitive behavior with explicit
package/path keys where determinism matters, e.g. coverage summaries and
fixture/test ordering.

- [`typst/typst#8215` Request standard library from `World` once
upfront](typst/typst#8215)
- This PR does not include the runtime/engine adaptation from that
group.
- It only carries over the minimal `typst-utils` workspace dependency
because the original nightly order introduced that dependency before
`444c2f2a`, while this logical path-model group already needs
`typst-utils.workspace = true` in `tinymist-query`.

- Ports the VFS path mapper to `RootedPath`, `VirtualRoot`, and
validated `VirtualPath` operations.
- Updates `EntryState`, mock VFS/world helpers, and tests to create
valid virtual paths instead of relying on raw path wrapping.
- Updates workspace/package/rootless path resolution so tinymist's
workspace IDs continue to map onto Typst package roots where needed.
- Updates analysis, docs, package import, rename, and document-link code
to resolve relative imports from the source file's parent in the new
path model.
- Simplifies import path parent resolution so invalid parent paths
naturally short-circuit instead of falling back to the original virtual
path.
- Adds compatibility helpers in `typst-shim`:
- `as_rooted_path_compat()` for rendering a `VirtualPath` with a leading
slash across stable/nightly Typst APIs.
- `as_rootless_path_compat()` for rendering the same path without a
leading slash.
- `package_compat()` for obtaining the package root through the old or
new `RootedPath` API.
- Keeps snapshot churn and unrelated analysis/runtime changes out of
this PR; those remain for later groups.

---------

Co-authored-by: paran3xus <[email protected]>
Dikluwe pushed a commit to Dikluwe/typst-crystalline that referenced this pull request Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant