Skip to content

@rasheed/svelte-native 0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 10 Nov 01:34
· 494 commits to main since this release
8470350

The early preview: an app starts from npx sv create, adds the library with pnpm add and runs svelte-native init (the guide is docs/). Checked on the release branch: the package, harness and showcase tests, the engine's host checks, the consumer check in its three modes (tarball, git and the guide's starter path, each through a Gradle build), the starter on the OVH emulator to its second screen, and the showcase on the Samsung A16 (the generic camera and image views, the scroll clip under a plain header, the status bar) and the iPhone SE 3 (ExpoView checked by hand; the release build launches). The device suites of native-qa were not run again for this release: PLAN.md has their last full round, on 0.3.0.

Added

  • svelte-native init turns a SvelteKit project (npx sv create: minimal template, TypeScript, pnpm) into a Svelte Native app, after pnpm add of the library: the custom-renderer Svelte, the peers at the versions the library was exercised on, SvelteKit pinned to the version it patches, main, the Reanimated flag, the scripts native, android, ios and check-setup (dev, build and check stay SvelteKit's), pnpm's allowBuilds, overrides and patchedDependencies merged into the project's pnpm-workspace.yaml, the patch files, metro.config.cjs, app.json, the Vite config (svelteNative() around SvelteKit's plugin, when the file has the shape sv writes; otherwise the change is printed), the first native routes when there are none, and the .gitignore entries; then pnpm install and the doctor. --dry-run prints the plan, a second run changes nothing, a file it cannot change safely is left alone, and --name, --android-package, --ios-bundle-id, --force and --no-install are the options. It loads neither Svelte's compiler nor Metro, so it runs before the project is set up. svelte-native --help lists the commands.
  • The guide, docs/: creating a project from npx sv create, the project structure, native routes, development builds and expo prebuild, native libraries, adding the library to an existing Expo app, and troubleshooting.
  • scripts/consumer-check.sh starter: the path of the guide, sv create, pnpm add of the local package, svelte-native init (and again, which must change nothing), pnpm check, the web build, and the native stages after them.

Changed

  • SvelteKit 3.1.1 is the supported version, instead of 3.0.0-next.27. It is what sv create installs. The patch is regenerated for it (patches/@sveltejs__kit@3.1.1.patch) and the peer is 3.1.1; the version of the prerelease is no longer supported (the doctor and its tests know one patch per package). Reviewed against the prerelease: the error and warning messages of SvelteKit's client runtime moved to message modules (Metro resolves them, and esm-env still gives BROWSER), prerender's FinalizationRegistry is no longer guarded (the library's stand-in is injected where the runtime is compiled), query.live asks for text/event-stream, and for(key) form instances are held from inside the effect (ported to remote/form.svelte.ts). The QA app's bundle is 91,291 bytes (1.6 %) larger from SvelteKit's runtime.
  • examples/minimal's doctor script is check-setup (pnpm doctor is pnpm's own command), as in the showcase.
  • The doctor's fix for a Svelte that is not the custom-renderer build, and for a missing dependency on the library, point at svelte-native init and the README section that holds the instructions ("Install in an app"); they named "Set up an app".

Fixed

  • An app is held to the Node a fresh install accepts, not to the repository's. A new sv create app on Node 25, the Node the doctor asked for, stopped at its first pnpm add with ERR_PNPM_UNSUPPORTED_ENGINE: React Native asks for @react-native/metro-config by a range, so the install took 0.88 beside React Native 0.86.3, and its tools (and Metro 0.87) exclude Node 25. svelte-native doctor now asks an app for ^22.17.0 || ^24.3.0 || >=26.0.0 (Node 24 LTS first) and the repository's own apps for >=25.0.0, with a fix text for each; svelte-native init pins @react-native/metro-config to React Native's version in overrides (examples/minimal does too); the guide and troubleshooting name the Node to use and show the Node 25 error; the consumer build runs on Node 24.
  • A SvelteKit app's svelte-check is clean without setup. watchRoutes no longer calls .unref on ReturnType<typeof setTimeout>, which a SvelteKit app's tsconfig (no Node types) types as a number, and withWebRunes takes a dynamicCompileOptions callback of any vite-plugin-svelte release (7.3 adds Vite's environment to its data), so an app needs neither @types/node nor the 7.2.0 pin.
  • Android: a <Screen> that sets no statusBar gets the default status bar appearance, and the statusBar and navigationBar options take effect at all. The engine looked for the activity through the decor view's context, which on Android 16 is the platform's DecorContext around the application context, so SystemBars returned before it wrote anything; and its first write was skipped when no option was set (applied began as the spec of "no option"). The window kept the activity theme's light icons: a white clock on the light header of a fresh app. The icons now follow the system appearance, dark by day and light at night, as the engine's header does. Checked on an emulator in light mode; the rules are a host check (SystemBarsRulesCheck).