Repository navigation
build: register every encoded native text once and generate its copies - #686
Conversation
Encoded strings (update wording, service addresses) were hex literals scattered over 40 call sites in four languages, the same text encoded up to four times (noUpdate, crashRescue, index.bundlejs.patch, .ppk.patch...), with the JS client's service presets a separate plain copy. scripts/contract.ts now registers each text once (nativeTexts, with per-platform values where a platform names the same thing differently, like the package patch suffix) plus the service presets, and the generator emits cpp/patch_core/native_texts.h (shared by the C++ cores and iOS), the Texts.java and Texts.ts constants and the client's SERVER_PRESETS. Every call site reads those; RCTPushyRevealText is gone. nativeTextEncoding.test.ts takes its plain texts from the registry and now fails on any encoded literal outside a generated region, so the registry stays complete. librnpushy.so is rebuilt for the JNI side's new reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Follow-up to #683: the encoded native texts get the same single-source treatment as the constants.
What changes
scripts/contract.tsregisters each encoded text once innativeTexts. A platform that names the same thing differently gets its own value, e.g. the package patch suffix.ipa.patch/.apk.patch/.app.patch. The JS service presets are registered there too, asservicePresets.cpp/patch_core/native_texts.h, shared by the C++ cores and iOSTexts.javaandTexts.tsconstantsSERVER_PRESETSRCTPushyRevealTextis removed. Harmony'sAPP_DELTA_SUFFIXis renamed toPACKAGE_DELTA_SUFFIX.nativeTextEncoding.test.tstakes its plain texts from the registry. It now fails on any encoded literal outside a generated region, so the registry cannot fall out of date.librnpushy.sois rebuilt because the JNI side reads the texts differently now.Verification
bun lintpasses: 40 generated regions are up to date.bun testpasses: 461 tests.native_texts.h.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit