From b1583d25fc65a14873523a0fcda82956d71f21bf Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Tue, 3 Nov 2026 22:14:35 -0800 Subject: [PATCH] docs: drop MIGRATE.md until the first release Nothing is released yet, so there is no one to migrate. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 1 - CONTRIBUTING.md | 2 +- ffi/MIGRATE.md | 109 ----------------------- ts/MIGRATE.md | 217 ---------------------------------------------- uniffi/MIGRATE.md | 24 ----- 5 files changed, 1 insertion(+), 352 deletions(-) delete mode 100644 ffi/MIGRATE.md delete mode 100644 ts/MIGRATE.md delete mode 100644 uniffi/MIGRATE.md diff --git a/AGENTS.md b/AGENTS.md index e964b7694..f2716b8e0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,7 +44,6 @@ Each project lives in its own top-level directory; the [quest tree](quest/README # Public API - Report the public API impact of every change in the PR description. -- A breaking change adds an entry under `## Unreleased` in the affected package's `MIGRATE.md`. - Keep things private until a consumer needs them. - Never add `foo_with_x`, `foo_checked`, or a compatibility shim. Make the breaking change to `foo` instead. - Name by role, not today's implementation. Short names under a module namespace. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 02133f1f0..d09a31cb6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ Have at least these sections: - **Problem**: a summary of the problem and why this PR is needed. - **Approach**: a summary of the approach taken to solve the problem. -- **Impact**: a bullet point for every public API change. A breaking one also gets a `MIGRATE.md` entry. +- **Impact**: a bullet point for every public API change. - **Alternatives**: any alternative approaches considered. - **Follow-ups**: any issues encountered or quests created. diff --git a/ffi/MIGRATE.md b/ffi/MIGRATE.md deleted file mode 100644 index 5f43997ce..000000000 --- a/ffi/MIGRATE.md +++ /dev/null @@ -1,109 +0,0 @@ -# Migrating - -## Unreleased - -- A C field or parameter named as a C or C++ keyword, or as one the header generates such - as `err` or `data`, takes a trailing `_` rather than a leading one, as C++'s names do: - moq's `catalog::H264::inline` is the field `inline_`, since MSVC reads `_inline` as a - keyword. A name already ending in `_` takes another, so `data_` is `data__` beside - `data`'s `data_`. A name starting with a digit, such as a tuple's `_0`, keeps its leading - `_`. -- C++ objects own their handle through `std::unique_ptr`, or `std::shared_ptr` where - copies may share one value. A `Clone` type whose copies may not, such as moq's - producers and consumers, no longer copies: `T copy = t;` is `T copy = t.clone();`, and - a braced list of such objects, which copies them, is built with `push_back` instead. - Such a type with a method named `clone` takes a `rename`. A copy of a type that shares, - such as moq's `path`, `timestamp`, and `url`, shares the handle rather than cloning in - Rust, and a copy of one a closure lends, kept past the call, aborts. So do `Arc`- and - `Rc`-backed types, such as moq's stats `registry`: an `Arc::strong_count` of what one - holds counts one for all its C++ copies, not one per copy. A type whose copies share - has `_borrowed` in the C header, which C++ asks before it moves out of the last - copy, so a method named `borrowed` on one takes a `rename`. -- Swift's and Python's objects have no `close()`, and Python's are no context managers: - an object's handle is freed once its last reference goes, in Swift's `deinit` or - CPython's deallocation, so no reference can outlive it. Drop the reference instead of - calling `close()`, and replace `with obj as x:` with `x = obj`. Where a free must land at - a point, such as a driver that finishes once its origin's last owner goes, end the - reference there: `del x` in Python, and in Swift a scope or `withExtendedLifetime`, - since Swift may release a reference after its last use. A Rust method named `close` - keeps its name, not `close_`. -- Every export writes `python/.py`, so an export fails when two items take the same - Python name, such as a type `Foo` beside an error type's `FooException`, or when one - takes a name the Python's runtime uses unqualified, each starting with `_`: give it - another name with a `rename`. The crate it writes has a build script, and a `python` - feature that builds the CPython extension the Python loads. -- Every export writes `swift/.swift`, whose runtime claims the C names - `_atomic_load`, `_atomic_store`, `_atomic_add`, - `_atomic_exchange`, `_atomic_cas`, and `_ATOMICS_H`. An item that - clashes with one, or whose Swift name clashes with another's or with a standard library - name the Swift uses, such as `Data`, takes a `rename`. -- Every export writes `go/.go`. An item whose Go name clashes with another's, or - with `Bound`, `Bytes`, `NewBytes`, `ErrClosed`, or a `Tuple` the Go declares, takes a `rename`. -- Every export writes `dart/.dart`, and its crate has a `dart` feature whose glue - claims the C names starting `_dart_`. An item that clashes with one, or whose - Dart name clashes with another's or with a name the Dart's runtime declares, such as - `Cancelable`, `Cancelled`, or `SocketAddr`, takes a `rename`. -- Kotlin returns bytes as a `Bytes`, not a `ByteArray`, read through `size`, `get`, - `slice`, `copyInto`, and `toByteArray()`. It has no `buffer` and no `close()`, so no - `ByteBuffer` over Rust's memory outlives it: drop `use { }` and read `bytes.buffer`'s - contents through these instead, such as `bytes.toByteArray()` or `bytes[0]`. Rust's - buffer is freed once the GC finds no `Bytes` reaching it, its slices included. A - record's bytes field is a `Bytes` too: build one to pass in with `Bytes(byteArray)`. - A `Bytes` equals and hashes by its contents, where a `ByteArray` did by identity, so a - record holding bytes equals one holding the same, and keys a map by them; compare with - `===` for identity. Arguments stay `ByteArray`. Kotlin's objects never closed are freed - once the GC collects them, and an exported type named `bytes` clashes with the - runtime's `_bytes`, which takes a `rename`. -- A type parameter bounded by serde's `Serialize` or `Deserialize` takes - `serde_json::Value`, not `String`: C passes a `_json` it parses from JSON text - with `_json_parse`, not a buffer, and a generic type at such a parameter is - named by `json` (`moq_json_snapshot_json`), not `string`. An item that clashes with - `_json` or its functions takes a `rename`. -- A type parameter whose bounds imply bytes, through a supertrait such as moq's - `IntoBytes: AsRef<[u8]>` or a `From` implementation such as moq's - `impl> From for Timed`, exports as bytes rather than - `String`. Kotlin takes a `ByteArray` there: pass text as `"text".encodeToByteArray()`. - C and C++ keep their types, and accept a payload that is not UTF-8 rather than aborting. -- `&[T]` of any type and `SocketAddrV4` and `SocketAddrV6` map, so a struct or enum whose - fields were refused only for the socket addresses is a value now, not an object, and - an item that newly exports can clash with another's C name, which takes a `rename`. -- `Vec`, `PathBuf`, `SocketAddr`, and `url::Url` map, so a struct or enum whose - fields were refused only for them is a value now, not an object: moq-tokio's - `listen::Bind` is the C enum `moq_listen_bind`, freed with `moq_listen_bind_free(&b)`, - not a handle. An item that clashes with the new names `_socket_addr`, - `_url`, or a `_vec_` takes a `rename`. - -- Each `pub` field of an object exports a setter, `_set_`, so a method - named `set_` on the same type, such as `Limit::set_max` beside `pub max`, - clashes with it: give the method another name with a `rename`. -- A field is refused whole when its setter does not map, even if its getter did, such as - one holding a reference (`pub label: &'static str`), which a handle holds `'static` and - C's borrow for a call cannot fill: `exclude` it to leave it out. -- In `exclude` and `rename`, a path that a field shares with a method or constant of its - type, such as `Backoff::initial`, names only the method, as in rustdoc. Name the field - `field@Backoff::initial`: an `exclude` that left out both now needs both entries. -- Every export defines `_contract` and `_CONTRACT`, so an exported item - that the naming rule names either, such as a crate root's `pub fn contract` or - `pub const CONTRACT`, clashes with them: give it another name with a `rename`. -- A field, parameter, or variant named a C++ keyword, such as moq's `namespace`, takes - a leading `_` in C as a C keyword does (`_namespace`), so the header compiles as C++. -- The C++ header's runtime names (`view`, `result`, `task`, `future`, `poll_t`, and - `detail`) and every variant's payload name (`_`, even without fields) - join the names the naming rule claims, so an exported item named one clashes: give it - another name with a `rename`. -- The `instances` key is gone, top-level and under `[crates.*]`, and a config that has - it fails to parse: delete it. A generic item exports at the instances it infers from - its defaults, its inherent impls, its exports' implementations of the traits bounding - it, and the signatures that name it. Exclude an instance by its path, such as - `"Pair"`, to leave it out. -- An instance's C name is no longer the config's. It is the generic item's name, then - the last segment of each argument's, with more segments only where two instances would - share a name: `catalog::Producer` is `moq_catalog_producer_extra`, - and `Counter::seeded` at `polar::Point` beside `Point` is - `api_counter_seeded_polar_point`. An instance an upstream change adds can lengthen - another's name. -- Every export writes `kotlin/.kt`, whose runtime object `Native` makes the C - name `native` one the naming rule claims. An item Kotlin names as a type its runtime - uses unqualified, such as `String` or `Unit`, or as another item, such as a type - `FooException` beside an error type `Foo`, is an error: give it another name with a - `rename`. diff --git a/ts/MIGRATE.md b/ts/MIGRATE.md deleted file mode 100644 index 8c001e6ef..000000000 --- a/ts/MIGRATE.md +++ /dev/null @@ -1,217 +0,0 @@ -# Migrating - -## Unreleased - -- `rt.handleAllocError`, and a `LocalKey` initialized while it drops, throw `rt.Abort` - rather than an `rt.Panic`, as std aborts there without running the panic hook. An - `rt.Abort` is an `rt.Panic`, so a caller catching one still catches both; one telling - them apart by `name` sees `"Abort"`. -- `rt.boundsOf` returns a record of the range's `startBound` and `endBound`, each read as - it is called, rather than a function reading both, which `rt.Bounds` takes as before. -- `rt.ArcWaker` is gone: `Waker::from(arc)` is `rt.arcWaker(arc, wake, drop, wakeByRef?)`. - An `rt.WakerVTable` is the record of the four functions std's `RawWakerVTable` holds, - `clone`, `wake`, `wakeByRef`, and `drop`, each called on a waker's `data`, so a - hand-written `rt.Waker`'s `vtable` is an `rt.wakerVTable(...)` of functions that do what - the waker does, which `Waker::new` of its parts calls. - -- A `dyn Error`'s or `dyn Buf`'s type and classes hold only the methods some call through - one dispatches to: a TS caller can call no other, such as `getU16Le$Buf` where no Rust - call reads one through a `dyn Buf`. -- Comparing pointers to an array of other values than bytes, such as `ptr::eq` of two - `&[u16; 2]`, is refused, since a slice lends such an array as a copy of its own; compare - the indexes they were taken at instead. -- `rt.iterFrom` takes `hint`, `back`, and `len` in one `rt.Own` record after `drop`, - which also holds the crate's own `nth`, `fold`, and the rest, as in - `rt.iterFrom(source, next, drop, { hint, back, len })`. -- In its type's module, the suffix of a method of a generic type behind a reference spells - the references after the type's arguments: `&mut Take`'s `Buf::chunk` is - `chunk$bytes_Buf_bytes_Bytes_mut`, not `chunk$bytes_Buf_mut_bytes_Bytes`, which is - `Take<&mut Bytes>`'s. -- A trait object's class is its value's type's in `lib.ts`, which every trait's object of - the type shares: `of$dyns_Square` rather than `Shape.of$dyns_Square` or - `Any.of$dyns_Square`, and `ofPlace$dyns_Square` rather than `Shape.ofPlace$dyns_Square`. -- `rt.sliceSort` is the stable sorts and takes the element's size in bytes on wasm32 and - whether it is `Freeze` after the test, as in `rt.sliceSort(v, rt.lt, 4, true)`; - `rt.sliceSortUnstable` is the unstable ones and takes whether it is `Copy` too. - `rt.sliceSortBy` and `rt.sliceSortByKey` are gone: sort by `rt.cmpLt(cmp)` or - `rt.keyLt(key, lt)`. `rt.btreeCollect` takes the entry's size and whether it is - `Freeze` in place of whether it sorts, and `rt.btreeCollectKeys` takes the key's before - its test. -- `rt.iterReduce`, `rt.iterMaxBy`, `rt.iterMinBy`, `rt.iterMaxByKey`, and - `rt.iterMinByKey` take whether they own their closure, which they drop where std's do, - before the `rt.None` they take last, as in `rt.iterReduce(it, f, drops, owns, none)`. -- `rt.iterMaxByKey` and `rt.iterMinByKey` take what drops each key after whether they own - their function, before the `rt.None` they take last, as in - `rt.iterMaxByKey(it, f, lt, drops, drop, owns, dropKey, none)`. -- `rt.Hasher` has `Hasher`'s methods, `write`, `u8` to `isize`, `prefix` - (`write_length_prefix`), and `str`, and `ints`, an integer slice's `hash_slice`, in - place of `word`. A binding's `hash$Hash` writes a signed or pointer-sized integer - through `rt.hashI8` to `rt.hashI128`, `rt.hashUsize`, or `rt.hashIsize`, as its Rust - impl calls `write_i8` and the rest. `rt.hashOne` takes the hasher it hashes into, as in - `rt.hashOne(rt.buildHasher(state), value, hash)`. -- `rt.vecCapacity`, `rt.vecReserve`, and `rt.vecReserveExact` are now `Vec::capacity`, - `reserve`, and `reserve_exact` of a vector, its element size in bytes last, as in - `rt.vecReserve(v, additional, 4)`, not the arithmetic an extend reserved by; - `rt.vecPush` and `rt.vecGrow` are gone. `rt.heapClone` takes the element size after the - clone function. -- `rt.vecExtendFromSlice` takes the element size in bytes after the slice, as in - `rt.vecExtendFromSlice(v, s, 4)`. `rt.iterToArray` and `rt.iterToByteVec` take the - source element size of a `collect` that may reuse its source's buffer last. -- An `rt.VecDeque` holds std's capacity as its buffer's length and its item size as `s`, - and a deque of bytes is a `Uint8Array`: `rt.dequeNew`, `rt.dequeWithCapacity`, and - `rt.dequeFromVec` take the item size and whether it holds bytes, as in - `rt.dequeNew(4)`, and `rt.dequeCapacity`, `rt.dequeReserve`, `rt.dequeReserveExact`, - `rt.dequeShrinkTo`, `rt.dequeClone`, `rt.dequeExtend`, and `rt.dequePart` no longer take - it. `rt.dequeIter` no longer takes a dropper: `rt.dequeIntoIter` is `into_iter`. -- Every translation needs `tsc` 7.0 or later on `PATH`, not only one with bindings: it - type-checks the output, and fails at the Rust span of each error, where it succeeded - before. -- A function the config's roots don't name takes each `&[u8]` or `&[u8; N]` parameter - whose object its body never makes as its `data`, `start`, and `length`: - `read(buf, form)` is `read(buf.data, buf.start, buf.length, form)`. A caller takes - which from the output. One that returns a `Result` of byte slices - and scalars, or of numbers alone, an `Option` of one counting as a number, such as - `Result, E>`, returns its error or `undefined`, and leaves the `Ok`'s parts in a - slot `lib.ts` exports, named for the payload type, such as `out$ref_slice_u8` or `out$Option_u64`. If the - `Ok`'s first part is a number, it returns that, or `undefined` for an error, and leaves - the rest, or the error as `err`, in the slot, such as `out$tuple2_u64_ref_slice_u8`. A root still takes an `rt.ByteSlice` and returns - the `Result`. -- A struct's private `&[u8]` or `&[u8; N]` field is three fields, its bytes, start, and - length, named for it: `buf` is `bufData`, `bufStart`, and `bufLen`, and a class's - constructor takes the three in its place. A `pub` field is still an `rt.ByteSlice`. -- `rt.btreeCollect` takes whether it sorts and the keys' `!ne` after the entries, and - `rt.btreeCollectKeys` the keys' `PartialOrd::lt` and `!ne`, as in - `rt.btreeCollect(m, entries, true, Key.eq$cmp_PartialEq)`; neither takes a test for keys - whose impls are derived or std's. `rt.btreeFromSorted` takes the keys' `!ne` too, and - what drops a key. -- `rt.cmpTuple` takes the tuple type it compares and what it returns, `rt.Ordering` for - `Ord::cmp` or `rt.Ordering | undefined` for `PartialOrd::partial_cmp`, as type - arguments, as in `rt.cmpTuple<[rt.u8, Key], rt.Ordering>([rt.cmp, Key.cmp$cmp_Ord])`. - -- An instance's suffix spells each type, trait, and closure by its path, the crate's own - by its module path, a dependency's under its crate, and std's by its public path - without a module its item repeats; `&` as `ref`, `&mut` as `mut`, and a slice, array, - or tuple with its length; and a function's nested item or async block by where it is. - No name is numbered `$2` on any more: `Fault.fmt$Display` is `Fault.fmt$fmt_Display`, - `Group.encode$Encode_Version` is `Group.encode$coding_encode_Encode_lite_version_Version`, - `read$u8s` is `read$mut_ref_slice_u8`, `through$2` is `through$u16s`, and - `blocksFuture$2` is `blocksFuture$closure0`. A type declared in a function has its - module suffixed alike, `copy.Pair$run.ts`. A trait object's class is `of$` and its - type, `Shape.of$dyns_Square` for `Shape.Square`, or `ofPlace$` for one of a place, - rather than `Square$Place`. A binding's export of a trait's function names the trait by - its path too: `eq$cmp_PartialEq`, `cmp$cmp_Ord`, `deref$ops_Deref`, and - `from$convert_From_Vec_u8`. A caller takes the new names from the output. -- `rt.Waker` has `data` and `vtable`, its identity, in place of `willWake`, which is - `rt.willWake(a, b)`: a caller's own waker gives as `data` what each of its clones - shares, such as the task it wakes, and as `vtable` an object of its kind of waker. -- A `start..` is an `rt.RangeFrom`, an iterator as `rt.Range` is, rather than - `{ start }`: a caller passes one as `new rt.RangeFrom(start, rt.u64Step)`, with its - integer type's `Step`, or `rt.charStep`, and none for other types. A binding taking one - still reads its `start`. An `rt.Range` or `rt.RangeInclusive` of `char`s takes - `rt.charStep` too, to step past the surrogates. One of unsigned `NonZero`s takes - `rt.nonZeroStep` of its integer's `Step` and maximum, as in - `new rt.RangeInclusive(lo, hi, rt.nonZeroStep(rt.u8Step, 255))`. -- A generic type's field holding a reference or pointer to what only an instance decides - the form of, such as `*mut T`, `NonNull`, or `&'a mut T`, is an `rt.Ptr`, the - object, an `rt.Place`, or an `rt.ByteSlice`, rather than `rt.Place` or `T`: a - caller reading one casts it to what its instance holds, as the output does. -- A generic type's field holding a run of a type parameter is an `rt.ArrayOf` for - `[T; N]`, an `rt.SliceOf` for `[T]` behind a reference or a `Box`, an `rt.VecOf` - for `Vec`, or an `rt.CowOf` for `Cow<[T]>`, rather than `T[]` or `rt.Cow`: - each also holds the byte form of its `u8` instance, which a caller reading one casts - it to, as the output does. -- A closure, a `fn` pointer, a `dyn Fn`, or a function item as a value returns - `undefined` for `()`, not `void`, as in `(a0: rt.u8) => undefined`: a caller passes such - a parameter a function typed `=> undefined`. -- An instance of a generic std function, such as `core/option.ts`'s, is named for a hash - of its text, `map$1cf8u0y`, rather than for its type arguments and the closure of one - of the instances merged into it, `map$Option_u64_u64_rescale_closure0`. A caller that - imports one by name takes the new name from the output. -- `rt.hashInt` is one function per width, as std writes each integer: `rt.hash8` for a - `u8`, `i8`, or `bool`, `rt.hash16`, `rt.hash32` for a `char`, `usize`, or `isize` too, - `rt.hash64`, and `rt.hash128`. `rt.Hasher` is an interface, and `rt.hashFinish` of a - `DefaultHasher` is std's SipHash-1-3 of what was written, a whole `rt.u64`. -- A `&mut` to an `Arc` or a `Waker`, pinned or boxed too, is an `rt.Place` of it, as a `&mut` - to a number is, rather than the object: a caller passes one as `{ v: arc }` and reads - the `Arc` it holds after the call from `v`. -- `bytes::BytesMut` can't be bound: translation maps it, as an `rt.BytesMut`. Delete its - `[bind]` entry and the file it names. -- A binding's path names a dependency the package renames (`foo = { package = "bar" }`) - as the package does, `foo::Item`, no longer by its crate name, `bar::Item`. -- A panic aborts, as on wasm32: the output throws `rt.Panic` without running any cleanup, - so nothing drops as it unwinds, and what the translation held is undefined after one. - A caller that catches `rt.Panic` must not use the translation's values again. -- Runtime functions lost the droppers only a panic used: `rt.resultUnwrap`, - `rt.resultExpect`, `rt.resultUnwrapErr`, `rt.vecInsert`, `rt.tupleClone`, `rt.onceSet`, - `rt.onceGetOrInit`, `rt.hashInsert`, `rt.btreeInsert`, `rt.entryOrInsertWith`, - `rt.entryOrInsertWithMut`, `rt.iterInspect`, `rt.iterFold`, and `rt.iterCollectResult` - take one fewer, `hashExtend` and `hashExtendKeys` no longer take `fresh`, an `rt.Iter`'s - `fold` and `rfold` no longer take `dropAcc`, `iterToArray` no longer takes `"place"`, - and `rt.vecClone` is gone: clone an array with `map`. -- `Mutex::lock`'s result is an `rt.Result` of the guard, always `Ok`, rather than the - guard itself. -- A `Weak` and a `MutexGuard` drop: an `rt.Weak` uncounts itself from its `rt.Arc` and a - guard unlocks its `rt.Mutex`. A struct holding either is a class made with `new` rather - than an object literal, and a caller drops an `rt.Weak` it holds with `rt.drop`. -- A struct's class takes its fields as arguments in declaration order, `new C(a, b)`, - rather than as one object, `new C({ a, b })`. -- `tsc` checks a binding of a function returning `()` against `=> undefined`, not - `=> void`: type its export `: undefined`. -- `rt.ordMax`, `rt.ordMin`, and `rt.sliceSortByKey` take a `PartialOrd::lt` rather than a - `partial_cmp`, and `rt.ordClamp` takes `le`, `lt`, and `gt`; `rt.cmpLt` makes one from a - `partial_cmp`. `rt.sliceSortBy` takes only an `Ord::cmp`-like comparator: sort by an - `lt` with `rt.sliceSort`. -- A trait object in a function's suffix is named for its trait and the types it binds: - `show$dynstdfmtDebug` is `show$dyn_Debug`, and `poll$dyn_Future_u64` is a - `dyn Future`'s. -- A runtime consumer that takes an iterator by value is told whether it drops rather than - given `rt.drop`: `iterFold`, `iterForEach`, `iterSum`, `iterProduct`, `iterMax`, - `iterMin`, `iterMaxByKey`, `iterMinByKey`, and `durationSum` take `true`, and - `ownedCount` and `ownedLast` take only what drops an item. `iterToArray`, - `iterToByteVec`, `iterExtend`, `iterExtendBytes`, `dequeExtend`, `hashExtend`, - `hashExtendKeys`, `btreeExtend`, and `btreeExtendKeys` take an `rt.Take`, `"next"` or - `"fold"`, for how std's reads it; `iterToArray` takes `"place"` where its `inPlace` was - `true`. -- The runtime's `iterMax`, `iterMin`, `iterMaxByKey`, and `iterMinByKey` take a - `PartialOrd::lt` after the iterator and any key function, for items or keys of any type: - `rt.iterMax(it, rt.cmpLt(rt.cmpStr))`, or of integers, `rt.iterMax(it, rt.lt)`. -- `rt.FromUtf8Error` holds its `rt.Utf8Error` as std's does: `e.validUpTo` and - `e.errorLen` are `e.error.validUpTo` and `e.error.errorLen`. -- `ts.toml` no longer takes `ignore-macros`: `tracing`'s events are left out without it, - and no other macro is. Delete the key. -- `bytes::Bytes` and `rand::rngs::ThreadRng` can't be bound: translation maps them, a - `Bytes` as an `rt.ByteSlice`. Delete their `[bind]` entries and the files they name. -- The runtime no longer exports `ownedNth`, `ownedNthBack`, `ownedSkip`, `ownedTake`, or - `ownedStepBy`: `iterNth`, `iterNthBack`, `iterSkip`, `iterTake`, and `iterStepBy` take - what drops an item last. `rt.Iter`'s `nthItem` and `nthBackItem` are `nth` and - `nthBack`, which return `rt.DONE` past the end. -- `bool::then` and `then_some` lower from core's MIR into `core/bool.ts`, so the runtime - no longer exports `boolThen` or `thenSome`. -- Translation builds std from source for `wasm32-unknown-unknown`, so the toolchain needs - its `rust-src` component, as the flake's has, and the first run compiles std. -- `Option`'s and `Result`'s combinators lower from core's MIR into `core/option.ts` and - `core/result.ts`, so the runtime no longer exports `optionMap`, `optionMapOr`, - `optionUnwrapOr`, `optionOkOr`, `resultOk`, `resultErr`, `resultMap`, `resultMapErr`, - `resultAndThen`, `resultInspectErr`, or `resultUnwrapOr`. -- `--census` starts from the config's roots, as translation does. For the census of every - item, census with a config that names no roots: `roots = []`. -- A struct is a plain object typed by an interface, unless it may drop: build one as a - literal, `{ subscribe, sequence, frameStart: 0 }` rather than - `new Group({ subscribe, sequence, frameStart: 0 })`. -- Each type has a module of its own beside its Rust module's, holding the type and its - functions: `coding/decode.Decoder.ts` for `coding::decode::Decoder`. Import it whole, - `import * as Decoder from "./coding/decode.Decoder.ts"`, and name the type - `Decoder.Decoder`. -- A function of a type takes `self` first: `dec.slice(4)` is `Decoder.slice(dec, 4)`, - `group.encode(w, v)` is `Group.encode$Encode_Version(group, w, v)`, and - `Decoder.new(buf, form)` keeps its spelling, from the type's module. -- An enum's functions move from its companion object to its module: - `DecodeError.fmt$Display(err, f)` keeps its spelling, after - `import * as DecodeError from "./coding/decode.DecodeError.ts"`. -- A function's suffix no longer depends on what else is reached. A trait impl's function - always names its trait, with the trait's type arguments, and a generic instance or a - function of a generic type always names its type arguments: `Log.clone` is - `Log.clone$Clone`, `Version.encode` is `Version.encode$Encode_Version`, and - `Wrap.fmt$Pair` is `Wrap.fmt$Debug_Pair`. A closure type in a suffix is named for where - it is defined, `decode_closure0`. -- `rt.sliceReverse` is gone: call the array's own `reverse`. diff --git a/uniffi/MIGRATE.md b/uniffi/MIGRATE.md deleted file mode 100644 index 5d410f7a1..000000000 --- a/uniffi/MIGRATE.md +++ /dev/null @@ -1,24 +0,0 @@ -# Migrating - -## Unreleased - -- `uniffi_bindgen`: a name no longer identifies a type across crates. - `ComponentInterface::is_name_used_as_error(name)` is now `is_used_as_error(&ty)`, - `ComponentInterface::get_type(name)` finds only the crate's own types, and - `VisitMut::visit_error_name` takes the module path of the crate that defines the error. -- `uniffi-bindgen-cpp`: the `--scaffolding` flag is gone. It only stubbed out generation. -- Generated C++: async needs `error_style = "expected"`, and the default exceptions style refuses - an async function, constructor, method, or callback interface method. Its `uniffi::Future`, - `FutureResult`, `ForeignFuture`, `AsyncCancelledError`, and `AsyncDispatcherError`, and the - `Foreign` interface of a trait with async methods, are gone. Switch to the expected - style, where an async call returns `uniffi::Future`. -- Generated C: every type and function name starts with the crate's namespace, so a crate - whose items did not already start with it gets renamed C symbols. -- Generated C: type names are CamelCase, as in GLib: `app_my_object *` is now `AppMyObject *`, - `app_task` is `AppTask`, enum tags are `Tag`, variant structs ``, and - async callback types `Callback` (`app_my_object_do_thing_callback` is now - `AppMyObjectDoThingCallback`). Functions and enum constants keep their names. -- Generated C: every async callback takes `bool cancelled` after `user_data`, and freeing a task - whose callback has not started runs that callback once with `cancelled` set, on the dispatcher, - instead of never. Release `user_data` in the callback rather than after `_task_free`, - which no longer waits for a callback running on another thread.