Repository navigation
feat: add unstable BytePath - #9730
lloydrichards wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 4202920 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
9a8b537 to
106c67d
Compare
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
106c67d to
b40e7e5
Compare
5c4b648 to
542cb2c
Compare
b40e7e5 to
70458f2
Compare
542cb2c to
36cf926
Compare
70458f2 to
d0cd9bf
Compare
36cf926 to
dbca9bc
Compare
7870d9c to
fdf57f7
Compare
ee781bb to
9fe24b9
Compare
53e13de to
7c8ebdb
Compare
8e6e2e0 to
005c3dd
Compare
ed5e85c to
1b0f32b
Compare
d9e64c1 to
b6088d4
Compare
8f33205 to
0c47ccc
Compare
b6088d4 to
83f2eb5
Compare
0c47ccc to
eaf1e00
Compare
83f2eb5 to
2d3f2b6
Compare
eaf1e00 to
e4182ca
Compare
2d3f2b6 to
4432032
Compare
e4182ca to
afc0394
Compare
4432032 to
4f24db0
Compare
afc0394 to
5a41feb
Compare
4f24db0 to
8dc3e74
Compare
6cab2e6 to
4e68a37
Compare
e34a3cf to
5c7af4b
Compare
c76ac0e to
2262361
Compare
8dc3e74 to
4202920
Compare
fubhy
left a comment
There was a problem hiding this comment.
This deserves some extra consideration into whether our current Path module should instead be an enriched bytes data type instead of adding a new one in parallel here.
With node:path being entirely string based, this would then mean we'd have to ship our own platform dependent path string operations (join, split, etc.). But since node:fs offers bytes apis throughout it might be feasible.
Rust has a rich path manipulation story with various representations across both strings and buffers. Worth a look.
Type
Description
Part of porting over the
VirtualFileSystemas discussed with @fubhy on moving smaller building blocks first. Here i'm addingeffect/BytePathfor immutable POSIX path bytes, including filenames that cannot be represented as UTF-8. Very important for representing file system paths.fromBytes,fromStringanddecodeStringreturnResultwith aBytePathError(NulByte,InvalidUtf16,InvalidUtf8orInvalidBuffer). Each has an*Unsafevariant that throws instead. Input and exported bytes are copied, and text conversion is strict. Empty values and exact spellings are preserved. Values support equality, hashing, unsigned byte ordering,isAbsoluteand inspection.Schema.BytePathvalidates existing values.Schema.BytePathFromBytescopies bytes on decode and encode. Both derive Base64 JSON codecs and support Schema code generation.Related
Closes EFF-2754