Releases: ipld/go-ipld-prime
v0.24.0
What's Changed
- build(deps): bump github.com/ipfs/boxo from 0.38.0 to 0.39.0 in /storage/bsadapter by @dependabot[bot] in #628
- build(deps): bump github.com/ipfs/boxo from 0.38.0 to 0.39.0 in /storage/bsrvadapter by @dependabot[bot] in #627
- build(deps): bump github.com/polydawn/refmt from 0.89.1-0.20231129105047-37766d95467a to 0.90.0 by @dependabot[bot] in #629
- feat(dagcbor): enforce strict decode defaults by @rvagg in #630
- Enable stricter DAG-CBOR decode checks by default using refmt's canonical-form options. Reject indefinite-length CBOR in all modes, and reject non-minimal CBOR heads, NaN, infinity, and duplicate map keys by default.
- Add
RelaxedDecodeas an opt-out for legacy non-canonical inputs while leaving known remaining gaps explicit: map key order and non-64-bit float encodings are still accepted for now.
Full Changelog: v0.23.0...v0.24.0
v0.23.0
What's Changed
- build(deps): bump github.com/ipfs/go-datastore from 0.9.0 to 0.9.1 in /storage/dsadapter by @dependabot[bot] in #614
- ci: uci/update-go by @web3-bot in #616
- chore(docs): s/AllowBudget/AllocationBudget by @rvagg in #617
- build(deps): bump github.com/ipfs/boxo from 0.35.0 to 0.38.0 in /storage/bsrvadapter by @dependabot[bot] in #623
- build(deps): bump github.com/ipfs/go-cid from 0.6.0 to 0.6.1 in /storage/bsadapter by @dependabot[bot] in #624
- build(deps): bump github.com/ipld/go-ipld-prime from 0.21.0 to 0.22.0 in /storage/bsadapter by @dependabot[bot] in #618
- build(deps): bump github.com/ipfs/go-cid from 0.6.0 to 0.6.1 in /storage/bsrvadapter by @dependabot[bot] in #621
- build(deps): bump github.com/ipfs/boxo from 0.35.0 to 0.38.0 in /storage/bsadapter by @dependabot[bot] in #622
- build(deps): bump github.com/ipfs/go-cid from 0.6.0 to 0.6.1 by @dependabot[bot] in #620
- feat(codec): MaxDepth on DecodeOptions & more bounds testing by @rvagg in #625
Full Changelog: v0.22.0...v0.23.0
v0.22.0
What's Changed
- fix(bindnode): provide correct err msg on union member non-match by @rvagg in #535
- ci: uci/delete-templates by @web3-bot in #536
- ci: uci/copy-templates by @web3-bot in #537
- fix: upgrade specs with downgraded go.mod by @rvagg in #538
- ci: uci/copy-templates by @web3-bot in #539
- build(deps): bump github.com/ipfs/go-block-format from 0.0.3 to 0.2.0 in /storage/bsadapter by @dependabot[bot] in #540
- build(deps): bump github.com/ipfs/go-block-format from 0.0.3 to 0.2.0 in /storage/bsrvadapter by @dependabot[bot] in #541
- docs: add SelectLinks example by @rvagg in #542
- chore(deps): update storage package dependencies by @rvagg in #543
- Corrected texts by @criadoperez in #544
- build(deps): bump github.com/gogo/protobuf from 1.2.1 to 1.3.2 in /storage/benchmarks by @dependabot[bot] in #545
- build(deps): bump github.com/ipfs/boxo from 0.12.0 to 0.13.1 in /storage/bsadapter by @dependabot[bot] in #548
- build(deps): bump github.com/ipfs/boxo from 0.12.0 to 0.13.1 in /storage/bsrvadapter by @dependabot[bot] in #547
- Multiple text corrections by @criadoperez in #551
- Text corrections by @criadoperez in #552
- feat: add EmptyPathSegment, distinct from PathSegment{} by @rvagg in #546
- Corrections on go files by @criadoperez in #553
- build(deps): bump github.com/google/go-cmp from 0.5.9 to 0.6.0 by @dependabot[bot] in #554
- chore: add garbage roundtrip tests for dag-json to check refmt changes/fixes by @rvagg in #550
- build(deps): bump github.com/ipfs/boxo from 0.13.1 to 0.15.0 in /storage/bsrvadapter by @dependabot[bot] in #555
- build(deps): bump github.com/ipfs/boxo from 0.13.1 to 0.15.0 in /storage/bsadapter by @dependabot[bot] in #556
- build(deps): bump github.com/ipfs/boxo from 0.15.0 to 0.16.0 in /storage/bsrvadapter by @dependabot[bot] in #558
- build(deps): bump github.com/ipfs/boxo from 0.15.0 to 0.16.0 in /storage/bsadapter by @dependabot[bot] in #557
- build(deps): bump golang.org/x/crypto from 0.1.0 to 0.17.0 by @dependabot[bot] in #559
- build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /storage/bsrvadapter by @dependabot[bot] in #560
- build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /storage/bsadapter by @dependabot[bot] in #561
- ci: uci/update-go by @web3-bot in #566
- ci: uci/copy-templates by @web3-bot in #567
- feat(schema): expose useful functions for building schemas by @hannahhoward in #569
- ci: uci/update-go by @web3-bot in #570
- basicnode: don't panic on negative index by @MichaelMure in #571
- Thread bindnode options through convenience calls by @hannahhoward in #572
- Named type converters by @hannahhoward in #573
- build(deps): bump golang.org/x/crypto from 0.17.0 to 0.31.0 in /storage/bsadapter by @dependabot[bot] in #575
- build(deps): bump golang.org/x/crypto from 0.17.0 to 0.31.0 in /storage/bsrvadapter by @dependabot[bot] in #577
- build(deps): bump golang.org/x/crypto from 0.17.0 to 0.31.0 by @dependabot[bot] in #576
- build(deps): bump github.com/ipfs/go-cid from 0.4.1 to 0.5.0 by @dependabot[bot] in #582
- build(deps): bump github.com/ipfs/go-cid from 0.4.1 to 0.5.0 in /storage/bsrvadapter by @dependabot[bot] in #581
- build(deps): bump github.com/ipfs/go-cid from 0.4.1 to 0.5.0 in /storage/bsadapter by @dependabot[bot] in #579
- ci: uci/update-go by @web3-bot in #587
- build(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0 by @dependabot[bot] in #588
- ci: uci/copy-templates by @web3-bot in #600
- ci: uci/update-go by @web3-bot in #609
- chore: update deps by @rvagg in #610
- feat(dagcbor): make decode budget configurable via DecodeOptions by @rvagg in #611
New Contributors
- @criadoperez made their first contribution in #544
- @MichaelMure made their first contribution in #571
Full Changelog: v0.21.0...v0.22.0
v0.21.0
go-ipld-prime's release policy says that:
even numbers should be easy upgrades; odd numbers may change things
This release is an odd number, and it does change some minor things.
🛠 Breaking
- Build: The minimum version of Go has been bumped from 1.18 to 1.19.
- Dependencies: The go-cid dependency was upgraded from v0.3.2 to v0.4.1. This is a relatively minor change but the introduction of
ErrInvalidCidwrapping may be breaking for some users. - Selectors: Remove hard error when a traversal encounters a slice matcher with a node that is not a string or bytes, by @rvagg #529
🔦 Features
- Traversal:
Preloaderfunctionality, by @hannahhoward and @rvagg #452- See the traversal package documentation for more information on how a
Preloadercan be used to introduce parallelism into a traversal. The Lassie project is currently using this functionality to speed up Bitswap block fetching; future releases of go-ipld-prime may include additional functionality being prototyped in Lassie to manage parallelism and caching.
- See the traversal package documentation for more information on how a
- Schemas: Support
listpairsstruct representation in DSL parsing, by @rvagg #514 - Schemas: Support
inlineunion representation in DSL parsing, by @rvagg #527 - Bindnode: Support
listpairsstruct representation, by @rvagg #514 - Selectors: Support negative values for slice matcher's
FromandTo, by @rvagg #530- The slice matcher is currently being used to support byte-range fetching for the IPFS Trustless Gateway specification. Work is ongoing and can be seen in both the Lassie and Frisbii projects.
- Please note that this feature is currently considered experimental and shoule be used with care and with the expectation that it may change in the near future. Expect a release or two before this feature is considered stable.
🩹 Fixes
- Traversal:
StartAtPathwork properly for matching walks, by @rvagg #500 - Traversal:
WalkTransforming()work properly, by @EdSchouten #516 - Basicnode:
basic.NewInt()returns a pointer like other constructors, by @hacdias #525 - Selectors: Cache offsets for sequential reads in slice matcher, by @rvagg #529
🌟 Thanks!
Thanks to @hacdias and @EdSchouten for their first contributions to go-ipld-prime!
v0.20.0
go-ipld-prime's release policy says that:
even numbers should be easy upgrades; odd numbers may change things
As such, v0.20.0 is a relatively minor release with a grab-bag of small improvements and fixes.
2023 February 11
What's Changed
Schema errors can now errors.Is:
- [
61c9ab10d4] - feat: support errors.Is for schema errors (Ian Davis) #476
Schema DMT (schema/dmt) is now more usable from the outside and has a new ConcatenateSchemas function that can be used to combine two schemas into one:
- [
db9d8a7512] - Export schema/dmt.TypeSystem. (Eric Myhre) #483 - [
39818c169a] - Add a SchemaConcatenate operation. (Eric Myhre) #483 - [
c68ba53c67] - More accurate name for structure that contains easy access to prototypes. (Eric Myhre) #483 - [
2ecabf1217] - Add several pieces of docs to schema/dmt. (Eric Myhre) - [
33475f0448] - Fix mispatched package declaration. (Eric Myhre)
The DAG-CBOR codec now has an DontParseBeyondEnd option (default false) that allows it to parse undelimited streamed objects. This matches the same functionality already in DAG-JSON and should only be used for specialised cases:
- [
7b00b1490f] - feat(dagcbor): mode to allow parsing undelimited streamed objects (Rod Vagg) #490
datamodel.Copy got some direct test coverage and will now complain if you try to copy a nil node:
- [
f4bb2daa27] - fix(datamodel): add tests to Copy, make it complain on nil (Rod Vagg) #491
The LinkSystem data loading check will compare links (CIDs) to ensure it loaded what you wanted; this now properly supports the case where your link is a pointer:
- [
1fc56b8e7a] - Fix hash mismatch error on matching link pointer (Masih H. Derkani) #480
New Contributors
Full Changelog: v0.19.0...v0.20.0
v0.19.0
go-ipld-prime's release policy says that:
even numbers should be easy upgrades; odd numbers may change things
The only major, potentially disruptive change in this release is a bump to Go 1.18.
🛠 Breaking Changes
Update go.mod to Go 1.18.
🔦 Highlights
- Codecs: Correct JSON codec Bytes handling. This change does not impact DAG-JSON, which is the generally recommended codec for JSON output as the JSON codec cannot properly handle Bytes or Links.
- Dependencies:
- Update to go-multihash@v0.2.1: https://github.com/multiformats/go-multihash/releases/tag/v0.2.1
- Update to go-multicodec@v0.6.0: https://github.com/multiformats/go-multicodec/releases/tag/v0.6.0
- Update to go-cid@v0.3.2: ipfs/go-cid@v0.2.0...v0.3.2
v0.18.0
go-ipld-prime's release policy says that:
even numbers should be easy upgrades; odd numbers may change things
So, as an even number, this v0.18.0 release should be a smooth ride for upgraders from v0.17.0. We have 3 major feature additions, all focused on Bindnode.
🔦 Highlights
- Bindnode: Custom Go type converters - Bindnode performs bidirectional mapping of Go types to the IPLD Data Model, and in doing so, it assumes a straightforward mapping of values to their encoded forms. But there are common cases where a Go type doesn't have a straightforward path to serialization, either because the encoded form needs a custom layout, or because bindnode doesn't have enough information to infer a serialization pattern. Custom Go type converters for bindnode allow a user to supply a pair of converter functions for a Go type that dictate how to map that type to an IPLD Data Model kind. See the bindnode documentation for more information.
- Bindnode: Type registry - Setting up Go type mappings with Bindnode involves some boilerplate. A basic type registry is now available that takes some of this boilerplate away; giving you a single place to register, and perform conversions to and from Go types, Data Model (
Node) forms or directly through serialization. See the bindnode/registry documentation for more information. - Bindnode: Full
uint64support - theuint64support introduced in go-ipld-prime@v0.17.0 has been wired into Bindnode. The Data Model (Node) forms expose integers asint64values, which is lossy for unsigned 64-bit integers. Bindnode Go types usinguint64values are now lossless in round-trips through serialization to codecs that support the full range (DAG-CBOR most notably).
You can see all of these new features in action using Filecoin Go types, allowing a mapping between Go types, Data Model (Node) forms, and their DAG-CBOR serialized forms with data-transfer vouchers. These features also allow us to interact with the original Go types, without modification, including big.Int serialization to Bytes, Filecoin Signature serialization to a byte-prefix discriminated Bytes and more. Since the Go types are unchanged, they can also simultaneously support cbor-gen serialization, allowing an easier migration path.
v0.17.0
go-ipld-prime's release policy says that:
even numbers should be easy upgrades; odd numbers may change things
In that spirit, this v0.17.0 release includes some potentially breaking changes. Although minor, they are marked below and they may lead to behavioral changes in your use of this library.
🛠 Breaking Changes
- Codecs:
- DAG-CBOR, DAG-JSON: Error on
cid.Undeflinks in dag{json,cbor} encoding - previously, encoding Link nodes that were empty CIDs (uninitialized zero-value or explicitlycid.Undef) would have passed through the DAG-CBOR or DAG-JSON codecs, silently producing erroneous output that wouldn't successfully pass back through a decode. (Rod Vagg)
- DAG-CBOR, DAG-JSON: Error on
- Bindnode:
- Panic early if API has been passed ptr-to-ptr - previous usage of bindnode using pointers-to-pointers may have deferred (or in some cases avoided) panics until deeper usage of the API, this change makes it earlier to make it clear that pointer-to-pointer is not appropriate usage. (Rod Vagg)
- Build:
- Drop Go 1.16.x testing & begin testing Go 1.18.x (Daniel Martí)
- Note also that in this release, the github.com/ipfs/go-cid dependency is upgraded from 0.0.4 to 0.2.0 which includes a breaking change with the removal of the
cid.Codecsandcid.CodecToStrmaps which may disruptive. See the go-cid@0.2.0 release page for details.
🔦 Highlights
- Data Model:
- Bindnode:
- Fuzzing and hardening for production use (Daniel Martí)
- Refuse to decode empty union values (Daniel Martí)
- Allow nilable types for IPLD
optional/nullable(Daniel Martí) - More helpful error message for common enum value footgun (Rod Vagg)
- Infer links and
Anyfrom Go types (Rod Vagg)
- Schemas:
- DMT: Proper checking for unknown union members (Daniel Martí)
- DMT: Enum representations must be valid members (Daniel Martí)
- DMT: Reject duplicate or missing union representation members (Daniel Martí)
- DSL: Support
stringjoinstruct representation andstringprefixunion representation (Eric Evenchick) - DMT, DSL: Enable inline types (Rod Vagg)
- Patch:
- Add initial version of IPLD Patch feature (Eric Myhre) (helped across the line by mauve and Rod Vagg)
- Codecs:
- DAG-CBOR: Reject extraneous content after valid (complete) CBOR object (Rod Vagg)
- DAG-CBOR: add
DecodeOptions.ExperimentalDeterminism(currently only checking map sorting order) (Daniel Martí) - Printer: Fix printing of floats (Dustin Long)
- DAG-JSON: Add option to not parse beyond end of structure (Petar Maymounkov)
- Build:
- Fix macOS and Windows testing (Rod Vagg)
- Fix 32-bit build support (Rod Vagg)
- Make staticcheck and govet happy across codebase (Rod Vagg)
- Enable full unified-ci GitHub Actions suite, including auto-updating (Rod Vagg)
- Enable dependabot, with monthly checks (and update all dependencies) (Rod Vagg)
Special thanks to Daniel Martí for many bindnode improvements and hardening, fuzzing across the library and improvements to the Schema DMT and DSL.
v0.16.0
This release is a smooth-sailing release. (The even number represents the intention of even-keel smooth sailing.) It's mostly improvements to features that are already familiar, and a few new features. (Some of which are really neat!)
There haven't been any major API departures or changes in quite a while now. This should be an easy upgrade to make. And you probably want it! Especially, if you use the bindnode system, the quality of life has gone up drastically in the last few points releases, and jumps again in this release too.
See the complete list and further details below:
- New:
traversal.WalkTransformingis finally implemented! (It's been a stub for quite a while.) This works similarly to the other transform features, but can do more than change to the structure during a single walk. - New: Selectors support partial/ranged match on bytes or strings nodes. (This is also a new feature for Selectors, recently specified.)
[#375; seealso specs in ipld#184] - New: there's a
datamodel.LargeBytesNodeinterface, which makes it possible to handle "large" blobs of bytes as aNode, without necessarily forcing them all into memory at once. (This is optional; you add the methods to match the interface if your Node implementation supports the feature.)
[#372]- Slightly more specifically: this interface is
Nodeplus a method that returns anio.ReadSeeker. (Pretty standard golang I/O and byte slice management concepts should carry you from there in the usual ways.) - This is a really big deal -- for example, this means that an ADL can support reading of arbitrarily large bytes without an issue. (Hello, transparently readable large sharded blobs!)
- Slightly more specifically: this interface is
- New: there's a "resume" (or, skipahead) mechanism for traversals and selectors. Engage it by simply setting the
traversal.Config.StartAtPathfield.
[#358] - New:
dagcbornow has aEncodedLength(Node) intfunction, which can calculate the expected serial message length without actually encoding. (The usefulness of this may be situational, but it's there if you want it.) - Improved:
bindnode, yet again, in more ways that can easily be summarized.- Better support for pointers in more places in your golang types.
- Many panics either fixed or routed into calmer errors.
- Unsigned intergers are now supported in your golang types.
- Some fixes for AssignNode working correctly (e.g. at the type or representation level, as appropriate; sometimes previously it would use the type level incorrectly).
- Various fixes to handling absent fields correctly.
- A
datamodel.Nodecan now be used for ananyfield.
- Fixed: selectors now behave correctly for a recursion clause that just contains a recursion edge immedately. (It's still not a sensible selector, really, but it's valid.) Previously this would panic, which was nasty.
- Fixed:
bindnodenow correctly doesn't include absent fields in the count of length when looking at the representation-level view of structs. - Improved: all our batteries-included codecs double check while encoding that the number iterator steps over a map matches its self-reported length. (This doesn't matter in many cases, but does defend you a little better against a
Nodeimplementation with a bug, if you happen to be so unlucky.) - Improved: miscellaneous performance work in the
schema/*area.
In addition, several point releases have transpired since v0.14.0: v0.14.1, v0.14.2, v0.14.3, and v0.14.4 -- all flew by were in rapid succession. Their changes are compressed into one heap here for brevity:
- New: Selectors can include clauses for signalling the use of ADLs!
[#301; seealso specs in ipld#149+ipld#170]- Also kindly note that there are expected to be many ways of signalling ADL invocations -- this is only one of them.
See the IPLD website for more on this topic as a whole: https://ipld.io/docs/advanced-data-layouts/signalling/
- Also kindly note that there are expected to be many ways of signalling ADL invocations -- this is only one of them.
- Improved:
bindnode, in ways more various than can easily be summarized.- The
cidlink.Linktype can be bound to links in the data. - Enums are now supported.
- The
anytypekind is now supported.
- The
- Improved: both the
schema/dmtandschema/dslpackages (and in some cases, theschemapackage itself) continue to be improved and become more complete.- Structs with tuple representation are now supported.
- Enums with int representation are now supported.
- The
anytypekind is now supported.
- Changed: the dag-json codec will tolerate padded base64 in bytes content upon read. It does so silently. (It is not still possible to emit this kind of serial data with this library; it is noncanonical.)
[#309] - Changed: the cbor and dag-cbor codec will now tolerate CBOR's "undef" token. It will coerce it to a null token when reading. Previously, encountering the undef token would result in a parse error. (It is still not possible to emit this token with this library.)
[#308] - New: the
traversalpackage gained aWalkLocalfunction. This simply does a walk that does not cross any links.
Thank you to @mvdan, @warpfork, @hannahhoward, @rvagg, @willscott, @arajasek and others
for all their work that went into making this release (as well as all the point releases in v0.14.x leading up to it) happen.
Finally, please note that we're starting to try out some new (and slightly more formal) governance and review and merge processes.
Check out #370 for more information.
The aim is to make things generally more inclusive and involve more contributors!
This is still experimental and may be subject to change, but if you'd like to have better expectations about who can review and what the process should be like, we hope this will be a step in a helpful direction.
(Feedback about this experiment welcome!)
v0.14.0
2021 November 11
This release is a smooth-sailing release, and mostly contains new features, quality-of-life improvements,
and some significant improvements to the completeness and usability of features that have been in development across previous releases.
There shouldn't be a lot of surprises, and upgrading should be easy.
Some of the biggest improvements include: bindnode now supports most IPLD features and is increasingly stable;
the schema system now has functioning schema/dmt and schema/dsl packages, and can parse schema documents smoothly(!);
if you haven't seen the printer package that first quietly appeared in v0.12.2, you should definitely check it out now;
and we have some new storage APIs that might be worth checking out, too.
There are also many, many other smaller improvements.
See the complete list and further deatils below
(and don't forget to check out the notes under the other v0.12.* headings, if you haven't absorbed those updates already, too!):
- New:
datamodel.Copy: a helper function to do a shallow copy from one node to another.- You don't often need this, because nodes are supposed to be immutable!
But it still sometimes comes in handy, for example, if you want to change the memory layout you're using by moving data into a different node implementation.
- You don't often need this, because nodes are supposed to be immutable!
- Improved: documentation of APIs. (Especially, for subtler bits like
NodeAssembler.AssignNode.) - New:
datamodel.Linknow requires aBinary()function. In contrast toLink.String()(which is supposed to return something printable),Link.Binary()should give you the rawest thing possible. (It's equivalent togo-cid.CID.KeyString.) - New: a new storage API, including one batteries-included filesystem storage implementation, and adapters to several other different storage APIs. [#265, #279]
- The primary goal of this is the "batteries included" part: using the new
storage/fsstorepackage, you should now be able to make simple applications with IPLD and use a simple sharded disk storage system (it'll look vaguely like a.git/objectsdirectory), and do it in about five minutes and without pulling in any additional complex dependencies. - If you want to develop new storage systems or make adapters to them: the APIs in
storagepackage are designed to be implemented easily.- The
storageAPIs are designed entirely around types found in the golang standard library. You do not need to import anything in thestoragepackage in order to implement its interfaces! - The minimal APIs that a storage system has to implement are very small. Two functions. Every additional feature, or optimization that you can offer: those all have their own interfaces, and we use feature-detection on them. You can implement as much or as little as you like.
- The
- As a user of the storage APIs: use the functions in the
storagepackage. Those functions take a storage system as a parameter, and will do feature detection for you.- This means you can always write your code to call the APIs you want, and the
storagefunctions will figure out how to map it onto the storage system that you have (whatever it supports) in the most efficient way it can.
- This means you can always write your code to call the APIs you want, and the
- As a user of the
LinkSystemAPI: you can ignore most of this! If you want to use the newstorageAPIs, there are setup methods onLinkSystemthat will take them as a parameter. If you have existing code wired up with the previous APIs, it still works too. - As someone who already has code and wonders how to migrate:
- If you're using the
linking.Storage*OpenerAPI: you don't have to do anything. Those still work too. - If you were using code from other repos like
ipfs/go-ipfs-blockstoreoripfs/go-datastoreor so on: those have adapters now in thestorage/*adapterpackages! You should now be able to use those more easily, with less custom glue code. (There's also now a migration readme in the repo root: check that out.)
- If you're using the
- If you would like to ask: "is it fast?" -- yes. You'll find that the new
storage/fsstore, our batteries-included filesystem storage system, is comparable (or beating) thego-ds-flatfspackage that you may have been using in the past. (More benchmarks and any performance improvement patches will of course be welcome -- but at the very least, there's no reason to hold back on using the new system.)
- The primary goal of this is the "batteries included" part: using the new
- New:
LinkSystemhas some new methods:LoadRawandLoadPlusRawgive you the ability to get data model nodes loaded, and also receive the raw binary blobs.- This can be useful if you're building an application that's piping data around to other serial APIs without necessarily transforming it. (No need to reserialize if that's your journey.)
- New: a CLI tool has begun development!
- ... and almost immediately been removed again, to live in its own repo: check out https://github.com/ipld/go-ipldtool .
- Improved: many more things about
bindnode.bindnodenow understandsgo-cid.CIDfields.- Kinded unions are much more completely supported.
- Many TODO panics have gone away, replaced by finished features.
bindnodewill increasingly check that the golang types you give it can be structurally matched to the schema if you provide one, which gives better errors earlier, and increases the ease and safety of use drastically.
- Improved: the
schema/dmtandschema/dslpackages are increasingly complete.- There are also now helper functions in the root package which will do the whole journey of "load a file, parse the Schema DSL, compile and typecheck the DMT, and give you the type info in handy golang interfaces", all at once! Check out
ipld.LoadSchema!
- There are also now helper functions in the root package which will do the whole journey of "load a file, parse the Schema DSL, compile and typecheck the DMT, and give you the type info in handy golang interfaces", all at once! Check out
- New: there is a codegen feature for
bindnodewhich will produce very terse golang structs matching a schema and ready to be bound back tobindnode!- This competes with the older
gengocode generator -- by comparison, thebindnodecode generator produces much, much less code. (However, be advised that the performance characteristics are probably also markedly different; and we do not have sufficient benchmarks to comment on this at this time.)
- This competes with the older
- Internal: many tests are being ported to
quicktest. There should be no external impact to this, but we look forward to removing some of the other test libraries from our dependency tree in the near future. - Improved:
printernow supports links and bytes! - Improved:
printeris now more resilient and works even on relatively misbehavedNodeimplementations, such as those which implementschema.TypedNodebut then rudely and nonsensically return nil type info. (We don't expect all code to be resilient against misbehavedNodeimplementations... but for a debug tool in particular? It's good to have it handle as much as it can.)
This, and the last few releases tagged in the v0.12.* series, include invaluable contributions from
@mvdan, @warpfork, @rvagg, @willscott, @masih, @hannahhoward, @aschmahmann, @ribasushi,
and probably yet more others who have contributed through code and design reviews,
or by using these libraries and demanding they continue to become better.
Thanks to each and every one of the people who carry this project forward!
In addition, the following minor releases have transpired since v0.12.0:
v0.12.3
2021 September 30
- Fixed: using
SkipMein a traversal now skips only that subtree of nodes, not the remainder of the block!
[#251] - New:
traversalfeatures now have budgets! You can set a "budget" value, and watch it monotonically decrement as your operations procede. This makes it easy to put limits on the amount of work you'll do.
[#260] - New:
traversalfeatures can be configured to visit links they encounter only once (and ignore them if seen again).
[#252]- Note that this is not without caveats: this is not merely an optimization; enabling it may produce logically different outcomes, depending on what your selector is.
This is because links are ignored when seen again, even if they're seen for a different reason, via a different path, etc.
- Note that this is not without caveats: this is not merely an optimization; enabling it may produce logically different outcomes, depending on what your selector is.
- Fixed: a very nasty off-by-one in unions produced by the "gogen" codegen.
[#257] - Improved: the test suites for typed nodes now provide much better coverage (to prevent something like the above from happening again, even in other implementations).
- New:
schema/dsl! This package contains parsers for the IPLD Schema DSL, and produces data structures inschema/dmtform. - Removed: other misc partially-complete packages. (This will surely bother no one; it's just cleanup.)
- Removed:
codec/jst. If you were using that,jsthas its own repo now. - Improved:
traversalnow uses the error wrapping ("%w") feature in more places. - Changed:
printerkeeps empty maps and lists and strings on a single line. - Changed:
schema.TypeNameis now just an alias ofstring. This may result in somewhat less casting; or, you might not notice it. - Improved: the
schema/dmtpackage continues to be improved and become more complete.- Some changes also track fixes in the schema spec, upstream. (Or caused those fixes!)
- New/Improved: the
schemapackage describes several more things which it always should have. Enums, for example.
v0.12.2
2021 September 8
- New: the
printerpackage has appeared, and aims to provide an information-rich, debug-readable, human-friendly output of data from an IPLD node tree. [#238]- This works for both plain data model data, and for typed d...