Review cleanup: one value limit, dark mode, per-frame work, submitBehavior, packaging - #11
Merged
Merged
Conversation
The engine clamped the scaled magnitude at 10^15 for a jump and 10^17 for a roll, so `jumpTo` and `animateTo` showed different digits above that; both now share one limit, the stagger's longest delay is stored once per roll, and the unused `revealFraction` is gone. Both views follow a light/dark switch when no `color` is set: iOS rasterizes the glyphs with the trait-resolved label color and rebuilds them on a trait or display-scale change (the scale now comes from the view's traits, not `UIScreen.main`), Android rebuilds its paints on a configuration change. Per frame, iOS reuses its wheel and element buffers, keys the glyph caches by a value type and compares layers in place; Android pools its layout elements, splits the affixes once per format and slides one cached shimmer gradient. Both format the accessibility text only when a screen reader asks for it, and Android reads the animator scale once behind a settings observer. The wrapper keeps one `ref` handle per mount and tests the right-to-left resolution; `lib/` ships ES module, CommonJS and declaration builds; the Android Gradle plugin is pinned only for a standalone build, Java 17. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ltiline Android never marked five worklet-id props dirty, so a changed handler kept calling a dead id; they flush like the other three now. The view also re-feeds after `secureTextEntry` or `morph` toggles, applies `maxLength` only in text mode, sets tabular figures in every mode, honours `showSoftInputOnFocus`, resolves its theme colours once and again on a configuration change, and caches the animator scale. iOS re-rasterizes glyphs and re-resolves frame, label and caret colours on a trait or scale change (no more `UIScreen.main`), the Fabric focus/blur commands find multiline fields, `maxIntegerDigits` allows 30 as on Android, a `morph` toggled back on re-feeds, and a frame no longer allocates per glyph. `submitBehavior` gains `'newline'`, resolved as `TextInput` resolves it, and both platforms honour `submit` / `blurAndSubmit` on a multiline field. The wrapper no longer re-renders on every keystroke of an uncontrolled field, memoises `maskNotations` and the colours, exports the missing types, drops affixes on multiline with a warning, and gains 43 tests; the README props table is complete and guarded by a test. The native `affixAlign` prop is gone (the wrapper folds it), dead engine, mask and worklet-bridge methods are removed, the outline geometry writes into a reused buffer, and packaging mirrors the rolling number's dual build with `react-native-worklets` as an optional peer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ented The docs workflow rebuilds both engines to WebAssembly before deploying, since a change under cpp/ used to trigger a deploy with a stale build (the committed builds are refreshed here too, and the rolling engine's script links with em++). The package workflow builds `lib/`. The README's test command was `bun test`, which runs Bun's own runner against the Jest files; it is `bun run test`. It also documents the Android view-props patch for Nitro 0.37 that consumers need until the upstream fix ships. The demo gains a multiline field with a `submitBehavior` toggle, the row the device check of that feature used. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Everything a code review of both packages turned up, fixed and verified: real bugs first, then per-frame work, then support and tooling.
Rolling number
jumpToandanimateTo. A jump clamped the scaled magnitude at 10^15 and a roll at 10^17, so the two showed different digits above that (with 9 fraction digits,jumpTocollapsed anything above 10^6 to "1,000,000"). Both share one limit now; the stagger's longest delay is stored once per roll; the unusedrevealFractionis gone. Two engine tests cover it.coloris set: iOS rasterizes with the trait-resolved label colour and rebuilds on a trait or display-scale change (the scale comes from the view's traits, not the deprecatedUIScreen.main, which visionOS lacks); Android rebuilds its paints on a configuration change.refhandle per mount, right-to-left tests, a guard test keeping the shared helpers identical to the input's copy.Input
onChangeValue,onFocus/onBlur,onSelectionChange,onSubmitEditing,onEndEditingnever marked config dirty).submitBehaviorgains'newline', resolved asTextInputresolves it, and both platforms honoursubmit/blurAndSubmiton a multiline field natively.maxIntegerDigitsallows 30 as on Android;morphtoggled back on re-feeds; no per-glyph allocation per frame; the caret is positioned once per step.secureTextEntry/morphtoggles,maxLengthonly in text mode, tabular figures in every mode,showSoftInputOnFocushonoured, theme colours resolved once and on configuration changes, the outline geometry written into a reused buffer.maskNotationsand colours memoised, missing type exports, orphaned doc comments reattached, README props table completed and guarded by a test, 43 new tests.affixAlignprop is gone (the wrapper already folded it intoprefixAlign/suffixAlign); dead engine, mask and worklet-bridge methods removed.Repo
import/requireconditions (the oldlib/was ES modules only); type dev dependencies declared;react-native-workletsan optional peer.packages.ymlbuildslib/; the docs workflow rebuilds both WebAssembly engines before deploying (the committed builds were stale againstMorphEngine.cpp).bun test(Bun's own runner, which fails on the Jest files); the Nitro 0.37 Android view-props patch is documented for consumers until fix(views): fill Props::rawProps on Android when overriding cloneProps margelo/nitro#1655 ships.submitBehaviortoggle, used for the device check below.Verified
-Wshadow -Wconversionbun run build, docs typecheckOn an iPhone 17 simulator and a Pixel 9 emulator: right-to-left layout (iOS after a native relaunch), a light/dark round trip on both platforms, the market showcase with thirty numbers rolling,
jumpTothenanimateTo, the loading glint, all threesubmitBehaviormodes on a multiline field on both platforms, and the benchmark at 24 copies (debug builds, so not comparable to BENCHMARKS.md).Judgment calls to review
🤖 Generated with Claude Code