Repository navigation
Tags
Tags
macos: Name the image part key type to satisfy Clippy (#3273) Fixes the `clippy::type_complexity` error on release/0.7 (macOS check in the Rust application workflow) before tagging v0.7.1. No behaviour change. The Windows GPUI failure (`tests::windows`, "the field reads \"\"") also fails intermittently on main (run 45542796897), so it is not caused by the 0.7.1 cherry-picks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) 🤖 [Noop](https://huacnlee.github.io/noop) (release-manager) · AI agent acting for @huacnlee Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
release: Prepare version 0.7.0 (#3155) Bumps every NSH crate from 0.6.0 to 0.7.0 (root workspace and `crates/gpui`), refreshes the three lockfiles that pin them (`Cargo.lock`, `crates/gpui/Cargo.lock`, `examples/embed-gpui/Cargo.lock`) with `cargo update -w --offline`, and extends the "no release recorded yet" note in `docs/dev/compatibility.md` to 0.7.0, the same as the 0.6.0 preparation in #2311. `examples/embed-gpui/Cargo.lock` also picks up `jiff-tzdb`, which main's lockfile was missing. The tag and GitHub Release follow once this is merged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) 🤖 [Noop](https://huacnlee.github.io/noop) (lead) · AI agent acting for @huacnlee Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
cli: Let an app link an nshm for some targets only (#3162) Closes #3161 ## Description An app's `nsh.json` `"dependencies"` applied to every target. An nshm needed on some targets only (`nsh-extra`'s `Speech` on the desktops and phones of an app that dictates through the browser on the web) made `nsh package --target web` compile its Rust to wasm. That needs the wasm-bindgen CLI and skips the prebuilt web runtime. The workaround was to rewrite `nsh.json` for the run, which a concurrent `nsh run` reads and a killed script never restores (details in #3161). An app's entry now takes `"targets"`, the `platform.os` names its Rust is linked for: ```json { "dependencies": { "nsh-extra": { "version": "^0.7", "features": ["speech"], "targets": ["macos", "windows", "ios", "android"] } }, "resolve": { "alias": { "nsh-extra": "./src/speech-web.ts" } } } ``` - **Linking, not resolution.** Resolution and `nsh.lock` are the same on every target. `main.rs` passes the command's target to `rust_app::of` → `nshm::crates`, and `linked_for` keeps the entries for it plus what they depend on (the lock's dependency names). - **The target of a command.** `nsh run`, `nsh dev` and `nsh package` use the target they build (Mac Catalyst is `ios`; GPUI and the terminal host are this machine's OS). `nsh test` uses `--target`, or this machine's OS when headless. `nsh check`, `nsh build`, `nsh publish` and `nsh dev --server-only` serve every target and link everything. A command that leaves an nshm out does not rewrite `.nsh/types`, so the declarations stay complete. - **Imports where it is left out.** The bundler reads the lock's `module`s. If the build's UI sets lack one and no `resolve.alias` names it, a static import is refused with an error that says what to do. An `import()` stays external, as optional native modules already do. The plugin resolves native modules before rolldown applies aliases, so where the nshm is linked its module wins over the stand-in. This needs no new key. - **Refused.** `"targets"` in an nshm's own `nsh.json` (the app chooses), on a TSX-only nshm (its TSX is in every target's bundle), an empty list, and unknown names. - `nsh add` keeps an entry's `"targets"` when it adds the nshm again. The open questions (an exclusion form, external platforms, an `nsh add --targets` flag, stand-ins shipped by the nshm) are listed in #3161. ## Public API `nsh.json` (an app's): - `"dependencies"."<package>"."targets": string[]`: the targets (`"macos" | "windows" | "linux" | "ios" | "android" | "web"`, as `platform.os` names them) whose hosts and runtimes link the nshm's Rust. Left out: every target, as before. `nsh-bundler`: - `pub fn nshm::modules(app: &Path) -> Result<Vec<(String, String)>, String>`: the Rust modules of the nshm `nsh.lock` holds (package, `#[native_module]` specifier), which the bundler uses to recognize a module its target leaves out. Bundler behavior: a static import of an nshm's module that the build's UI sets lack and no alias replaces is now a build error. Before, it stayed an unresolved external that failed at load time with `could not load module`. This only happens for apps whose lock has such a module, which is new with `"targets"`. ## How to Test - `cargo test -p nsh-bundler`: 105 passed. New: `a_left_out_nshm_module_takes_its_stand_in_or_fails_the_build` (native module wins where linked; refused without an alias; stand-in with one; `import()` builds), plus `nshm::modules` in `exports_are_read_from_the_lock`. - `cargo test -p nsh-cli --bin nsh`: 453 passed, 3 ignored. New: `targets_are_read_and_written_back`, `targets_choose_what_is_linked`, `left_out_reads_the_lock`, `targets_run_on_the_os_platform_os_names`, and cases in `a_tsx_nshm_is_read` and `a_tsx_nshm_from_git_is_added_locked_and_removed`. - `cargo test -p nsh-cli --test cli`: 5 passed, 1 failed. `runtime::gpui_uses_its_workspaces_cargo_output_instead_of_a_stale_cli_sibling` fails the same way on unchanged `origin/main` (3f8ecd8) on this machine (Cargo is huacnlee/cargo), so it is not this change. - `cargo clippy -p nsh-cli -p nsh-bundler --all-targets`: no warnings. - End to end with `./target/debug/nsh test App.tsx` (headless, macOS), on a TSX app listing `{ "path": "<checkout>/crates/nsh-extra", "features": ["speech"], "targets": ["ios", "android"] }`, which imports `Speech` from `nsh-extra`: - with `"resolve": { "alias": { "nsh-extra": "./stand-in.ts" } }`: the test passes on the stand-in (`texts: ["stand-in"]`). No Rust is built, no `.nsh/rust` or `.nsh/types` is written, and `nsh.lock` pins `nsh-extra`; - without the alias: `App.tsx: \`nsh-extra\` is not linked for this target: nsh.json's "dependencies" lists nsh-extra for other "targets". Import it with \`import()\` where it is linked, or give this target a stand-in with "resolve" "alias"`. Not run here: - `nsh package --target web` and `nsh run --target web` (they build the web runtime in a checkout). These take the same `rust_app::of` path as the headless test above, with `Os::Web`. - The linked side end to end (`nsh run` with `nsh-extra` listed for `macos`), which builds the host with `nsh-extra`. The unit tests cover what is linked, and the code path for linked nshm is unchanged. - Formatting used stable `rustfmt` (`cargo fmt -p nsh-cli -p nsh-bundler`), because no nightly toolchain is installed here. It only touched the changed lines. - No `tests/compat` case: the change is a toolchain key with no runtime API. Docs: `website/docs/nshm.md`, `project-structure.md` and `cli.md`, their zh-CN copies, and `docs/dev/tooling.md`. ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
release: Prepare version 0.6.1 (#2617) This patch backports selected changes onto the v0.6.0 release line. It includes the requested Windows backdrop API (#2471). The SVG fix follows #2615: `svg` stays an optional feature, and a build that uses SVG files through `asset!`/`assets!` without it now fails with an error telling you to enable `svg` on `nsh-platform-*` (0.6.0 compiled silently and dropped the images). This supersedes #2609. After merging, tag `v0.6.1` on `release/0.6` to run the release and crates.io workflows. ## Fixes included - android: Keep scroll calls from reaching native code after the view is destroyed (#2449) - android: Skip scroll callbacks after the view is destroyed (#2442) - android: Unbox the dialog command before moving its fields out (#2498) - list: Read a keyed row at its new index whichever memo runs first (#2370) - core: Keep a text block's only raw text run without a node (#2366) - core: Refuse a Windows path as a URL to open (#2388) - macos: Avoid retaining CoreGraphics frame cache across screenshots (#2577) - macos: Keep a hidden window hidden when it is asked for full screen (#2487) - windows: Keep a hidden window hidden when its mode or bounds are set (#2419) - windows: Keep the app's size while its main window is minimized (#2428) - ios: Keep the keyboard up when UIKit reports no next focused view (#2486) - ios: Preserve the latest content height when narrowing a scroll view (#2491) - video: Act on `paused` only when it changes on Apple and Android (#2495) - web: Act on a video's `paused` only when it changes (#2515) - windows: Leave an ended video ended when another prop changes (#2427) - carousel: Clear the indicator target when its carousel is disposed (#2527) - ios: Keep a stack's safe area when a transformed container lays it out (#2601) - android: Keep header and tab bar items clear of a side navigation bar (#2608) - android: Keep a scroll view's edge pull when nothing around takes the drag (#2584) - android: Keep the default system bars in contrast with the app's appearance (#2602) - data_table: Keep the horizontal scroll bar between the fixed columns (#2430) - resizable: Stop a drag where the panel after the handle reaches its maxSize (#2415) - android: Keep a page's headerRight off the screen edge in RTL (#2534) - android: Keep a TabBar badge's count in its order in RTL (#2561) - core: Make svg optional again and fail the build when SVG assets need it (#2615) - core: Prevent a disposed memo from reading or overwriting another reactive node (#2402) - Linux: Preserve paused and ended video when unrelated properties change (#2443) - iOS: Link AuthenticationServices for embedded apps (#2374) - CLI: Compile packaged Rust apps for their declared minimum Apple OS (#2368) - macOS: Restore compilation of the text tests (#2412) - Windows 11: Draw a system blur behind a view in a transparent window (#2471). - Report missing native features, including updater errors and one-time rendering warnings (#2613). - Cancel pending composite animation work when its node is stopped or replaced (#2507, backported from f775ed1 while the upstream PR is open). Changes touch shared animation scheduling, with regression tests for delays, sibling independence and velocity handoff. The Android 0.6 decoder already drains missing component properties (#2560). The broader animation, navigation, focus and keyboard backports (#2505, #2475, #2392, #2579, #2605 and #2607) are deferred. 🤖 [Noop](https://huacnlee.github.io/noop) (release-manager) · AI agent acting for @huacnlee --------- Co-authored-by: daoleno <daodaoonline@gmail.com> Co-authored-by: Floyd Wang <codelife721@gmail.com> Co-authored-by: skblue <xiaozh620@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Oscar <oms1005@gmail.com> Co-authored-by: cosformula <cosformula@gmail.com>
PreviousNext