mirror of
https://github.com/readest/readest.git
synced 2026-12-02 18:04:49 +00:00
5 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5d030abf32
|
fix(build): repair the Docker and Nix builds after #6368 (#6379)
* fix(build): repair the Docker and Nix builds after #6368
Two main-branch builds broke on
|
||
|
|
8750c31043
|
perf(android): cut the arm64 apk from 90MB to 57MB (#6368)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* perf(android): cut the arm64 apk from 90MB to 57MB The Rust library is 95% of the APK, and most of what it carried was not code. Measured on an aarch64 release build: 89.7MB -> 57.5MB. - Build `release` with fat LTO and one codegen unit. Cross-crate inlining cuts .text by 5.2MB and the unwind/exception tables by 2.1MB, at the cost of a longer final link. - Strip the packaged library. AGP's own strip step only drops the .debug_* sections, so 22MB of symbol tables (10MB after LTO) reached every download. The strip runs on AGP's output, so `target/` keeps the unstripped copy, which the release and nightly workflows now upload to Sentry as debug files; Rust frames stay symbolicated. Android builds also link with a build id, which is how Sentry matches them, and the `debug-images` feature attaches the loaded modules to each event. - Stop shipping jieba's WASM twice (2.7MB). The wasm-bindgen glue defaults to the file the bundler already emits; pointing `init()` at a public/vendor copy embedded both. - Keep the browser-only turso WASM out of native builds (3.3MB). The alias that excluded it still named `@tursodatabase/database-wasm`, which the web database service stopped importing in #4086. simplecc is still embedded twice (0.4MB): its glue is imported through the `@simplecc/*` path alias out of public/vendor, so deduping it means moving that directory. Verified: the built APK's library carries no symbol tables and a build id; `target/` keeps its; the bundle requests exactly the one embedded jieba asset key and no /vendor/jieba path; the turso WASM is absent from `out/`. The APK installs and runs on a Xiaomi 2211133C, library and a Chinese book render, and RSVP runs on it. Whether jieba's WASM is actually fetched at runtime is NOT verified: release webviews are not inspectable and the fallback to Intl.Segmenter is silent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * perf(android): drop fat LTO, codegen-units=1 is the whole win The previous commit credited the code-size saving to fat LTO. That was wrong. Measured on aarch64-linux-android with the flags rustc actually received (`cargo build -v`): codegen-units=16, lto=false .text 29.66MB .eh_frame 3.69 .except 2.51 codegen-units=1, lto=off .text 24.43MB .eh_frame 2.28 .except 1.84 codegen-units=1, lto=thin .text 24.43MB .eh_frame 2.28 .except 1.84 codegen-units=1, lto=fat .text 24.44MB .eh_frame 2.28 .except 1.84 One codegen unit accounts for all of it; LTO changes nothing once it is set, so fat LTO was buying only link time and peak memory on every release target. The rebuilt APK confirms it: 57.49MB without LTO against 57.50MB with it. What `codegen-units = 1` costs, from a clean aarch64 build on an M-series: 5m54s against 4m15s, and 3.3GB peak RSS against 2.9GB. That answers the review's question about the 75-minute Android and 45-minute desktop step limits in nightly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * perf: stop shipping vendored modules the bundler already embeds Tauri embeds every file under `out/`, and `public/` is copied there whole. So a module imported through a path alias that points into `public/` ships twice: once bundled into a chunk, once as a published file nobody fetches. jieba cost 2.7MB that way; `@pdfjs/*` and `@simplecc/*` had the same shape. Split the vendored assets by how they are loaded. What the reader fetches by URL at runtime stays in `public/vendor/pdfjs` — the worker, the WASM decoders, cmaps, standard fonts, the layer CSS, all built as runtime URLs in foliate-js/pdf.js, which is why the bundler never emitted copies of them. What the bundler imports moves to `vendor/` (outside `public/`): `pdf.min.mjs` + its types, and the simplecc glue and WASM. Measured on the embedded frontend, brotli as tauri compresses it: 23.7MB -> 16.96MB across this and the earlier jieba/turso fixes. That comes out of every Tauri target, not just the APK. The new test states the invariant that was broken rather than the three symptoms: no tsconfig path alias may resolve into `public/`. It failed on `@pdfjs/*` and `@simplecc/*` before this change. Desktop stripping was measured and deliberately NOT done. On macOS it saves 4.76MB in the binary but only 1.44MB of DMG (36.59 -> 35.15MB), because a DMG compresses symbol strings while an APK stores the .so uncompressed (verified: `Stored`, 0%) — which is why Android got the full 22MB. Buying 1.4MB would mean either a profile-level `strip`, which deletes the unstripped artifact Sentry symbolicates Rust panics from, or pulling the release job apart from tauri-action, which builds, bundles, signs and notarizes in one step. deb, rpm and AppImage are compressed too, and MSVC keeps symbols in the PDB. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: init simplecc from the emitted WASM, not a URL that no longer exists Moving the simplecc glue out of `public/` left `initSimpleCC` still asking for `/vendor/simplecc/simplecc_wasm_bg.wasm`, a URL nothing publishes any more, so Chinese variant conversion would fail to initialize at runtime. Caught in review of #6368. `init()` with no path uses the glue's default `new URL('simplecc_wasm_bg.wasm', import.meta.url)` — the copy the bundler emits and Tauri embeds — the same shape as the jieba fix. The existing WASM-init test covered jieba only, which is why this slipped through; it now covers both. Verified against a fresh build: the chunk references `static/media/simplecc_wasm_bg.<hash>.wasm` and no runtime `/vendor/simplecc` reference remains (the two textual hits left are the bundled package.json script strings and a source-map path, and maps are stripped before packaging). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
1a2e43e659
|
chore(worktree): copy src-tauri/gen/apple per-worktree so iOS builds the worktree (#4251)
Worktrees set up by `pnpm worktree:new` symlinked `src-tauri/gen/apple` back
to the bare repo. The Xcode "Run Script" build phase
(`pnpm tauri ios xcode-script`) walks up from `Readest.xcodeproj` to find
`Cargo.toml`, but the symlink target resolves to the bare repo's
`src-tauri` — so `pnpm tauri ios dev` from a worktree silently built the
bare repo's Rust source, not the worktree's.
Switch to a filtered copy. `project.yml` references `../../src` and the
xcode-script walks up to `../../Cargo.toml`; with the project copied into
the worktree, both paths resolve to the worktree's source. Mirrors what the
script already does for Android (`tauri android init` per worktree).
Skipped on the copy:
- `build/` (~300 MB of Xcode derived output)
- `Externals/<arch>/{debug,release}/` (Rust static libs — rebuilt from the
worktree's `src-tauri` on first build; the `target/` symlink the script
already sets up keeps the Rust object cache shared)
- per-user Xcode state (`xcuserdata`, `*.xcuserstate`)
- `Pods/` (defensive; Readest's iOS uses SPM, not Cocoapods)
Result: ~2.7 MB copy, ~30 ms locally, no `pod install`, no
`tauri ios init`. Signing config, scheme, asset catalogs and Tauri's
generated Swift glue all preserved verbatim from the bare repo.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
b0cc5461af
|
refactor(toc): cache navigable structure per book (#3869)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* refactor(toc): cache TOC + section fragments per book
Moves the TOC regrouping and section-fragment computation out of
foliate-js/epub.js #updateSubItems into the readest client as
computeBookNav / hydrateBookNav in utils/toc.ts. The result is
persisted to Books/{hash}/nav.json — capturing the book's full
navigable structure (TOC hierarchy + sections with hierarchical
fragments). Compute once, persist locally, hydrate on subsequent
opens. Designed to serve current human-facing navigation (TOC
sidebar, progress math) and future agentic navigation (LLM-driven
seeking by structural location).
Versioned by BOOK_NAV_VERSION for forward invalidation. Existing
books regenerate transparently on next open.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: update worktree scripts
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
a07bf23e18
|
chore(docs): add worktree management for isolated PR review and feature work (#3810)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |