@kbach/react-native 1.0.0-beta.50 → 1.0.0-beta.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +58 -0
- package/README.md +7 -0
- package/android/src/main/jniLibs/arm64-v8a/libkbach_core_engine.so +0 -0
- package/android/src/main/jniLibs/x86_64/libkbach_core_engine.so +0 -0
- package/dist/{chunk-XOH25F3E.mjs → chunk-23JJORPW.mjs} +1 -1
- package/dist/{chunk-SC3L5I7H.mjs → chunk-HVGMZKV7.mjs} +1 -1
- package/dist/{chunk-3KLOVONL.mjs → chunk-Z5Q3FGXR.mjs} +4 -2
- package/dist/index.js +2 -0
- package/dist/index.web.js +1 -1
- package/dist/index.web.mjs +2 -2
- package/dist/jsx-dev-runtime.js +2 -0
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +2 -0
- package/dist/jsx-runtime.web.js +1 -1
- package/dist/jsx-runtime.web.mjs +2 -2
- package/dist/theme.d.ts +25 -0
- package/dist/theme.js +3 -1
- package/package.json +1 -1
package/dist/jsx-runtime.web.mjs
CHANGED
package/dist/theme.d.ts
CHANGED
|
@@ -46,6 +46,31 @@ interface ThemeConfig {
|
|
|
46
46
|
container?: ContainerConfig;
|
|
47
47
|
}
|
|
48
48
|
declare const defaultTheme: ThemeConfig;
|
|
49
|
+
/**
|
|
50
|
+
* Idempotent by CONTENT, not just a plain assignment — deliberately, not a
|
|
51
|
+
* micro-optimization. The babel plugin (`babel-plugin.js`) injects
|
|
52
|
+
* `applyKbachConfig(require('kbach.config.js'))` at the top of EVERY user
|
|
53
|
+
* file, not just one entry point, so it re-runs on every single file
|
|
54
|
+
* Metro (re-)executes. Editing `kbach.config.js` itself under Expo Fast
|
|
55
|
+
* Refresh forces Metro to invalidate and re-execute every file that
|
|
56
|
+
* requires it — which, because of that injection, is the entire app, not
|
|
57
|
+
* just the file you're looking at. A plain unconditional reassignment here
|
|
58
|
+
* would hand every one of those re-executions a BRAND NEW theme object
|
|
59
|
+
* (`resolveKbachConfig` always builds one fresh) even when the config's
|
|
60
|
+
* actual content hasn't changed, which in turn invalidates every
|
|
61
|
+
* `useColors()` call's `useMemo` (keyed on this object's identity) and
|
|
62
|
+
* re-evaluates `usesModeAwareColor()` for every reactive element
|
|
63
|
+
* (jsxRuntimeCore.ts) across the whole tree, all at once, right as Fast
|
|
64
|
+
* Refresh is already mid-teardown/rebuild for that same app-wide
|
|
65
|
+
* invalidation — reported live as "Unable to find node on an unmounted
|
|
66
|
+
* component," a known-flaky class of React Native Fast Refresh race that
|
|
67
|
+
* this amount of simultaneous churn measurably worsens. Comparing against
|
|
68
|
+
* the JSON serialization this function already computes (previously only
|
|
69
|
+
* for the JNI boundary, see `getThemeJson`) costs nothing new — it's the
|
|
70
|
+
* same computation the old code did unconditionally — it just skips the
|
|
71
|
+
* assignment (and therefore the reference change every downstream
|
|
72
|
+
* consumer sees) when the content is unchanged.
|
|
73
|
+
*/
|
|
49
74
|
declare function setTheme(theme: ThemeConfig): void;
|
|
50
75
|
declare function getTheme(): ThemeConfig;
|
|
51
76
|
/** Memoized JSON serialization of the active theme — passed across the JNI boundary. */
|
package/dist/theme.js
CHANGED
|
@@ -378,8 +378,10 @@ var defaultTheme = {
|
|
|
378
378
|
var activeTheme = defaultTheme;
|
|
379
379
|
var activeThemeJson = JSON.stringify(defaultTheme);
|
|
380
380
|
function setTheme(theme) {
|
|
381
|
+
const json = JSON.stringify(theme);
|
|
382
|
+
if (json === activeThemeJson) return;
|
|
381
383
|
activeTheme = theme;
|
|
382
|
-
activeThemeJson =
|
|
384
|
+
activeThemeJson = json;
|
|
383
385
|
}
|
|
384
386
|
function getTheme() {
|
|
385
387
|
return activeTheme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kbach/react-native",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.52",
|
|
4
4
|
"description": "Kbach's utility-class styling engine for React Native — the same class names as @kbach/react, resolved to a StyleSheet-ready style object via a Kotlin/JNI TurboModule (native), the same WASM engine @kbach/react uses (Expo Web / react-native-web), or a pure-JS fallback engine (Expo Go). Ships its own native Android module — one npm install, no separate native package. Beta. Native is Android-only (no iOS bridge yet); works with the React Native CLI, an Expo dev client, AND Expo Go (a reduced-coverage pure-JS fallback, since Expo Go can't load any custom native module).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|