Files
zeekay 9c3123f160 react: a part that hydrates late draws what the server drew, then the reader's words; 0.6.1
A section in a chunk of its own hydrates after the provider may have
loaded the reader's catalog. useI18n handed it the Arabic words over
English HTML, and React threw the tree away and drew it again on the
client (hanzo.ai's landing in Arabic: "Hydration failed because the
server rendered text didn't match", #418).

useI18n answers the provider's starting locale with no catalog (Served)
while its component hydrates, through useSyncExternalStore's server
snapshot, and the reader's words a render later; a component mounted on
the client gets them at once. test:browser hydrates a page held up by a
section whose chunk arrives after the catalog, and reports the mismatch
without this change.
2026-10-30 07:23:40 -07:00

77 lines
1.9 KiB
JSON

{
"name": "@hanzo/i18n",
"version": "0.6.1",
"description": "Hanzo localization: one locale registry, negotiation, React provider and picker, RTL, and lazily loaded catalogs.",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "git+https://github.com/hanzoai/i18n.git",
"directory": "pkgs/core"
},
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"sideEffects": [
"*.css"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./react": {
"types": "./dist/react.d.ts",
"default": "./dist/react.js"
},
"./server": {
"types": "./dist/server.d.ts",
"default": "./dist/server.js"
},
"./native": {
"types": "./dist/native.d.ts",
"default": "./dist/native.js"
},
"./boot": {
"types": "./dist/boot.d.ts",
"default": "./dist/boot.js"
},
"./bundled": {
"types": "./dist/bundled.d.ts",
"default": "./dist/bundled.js"
},
"./rtl.css": "./rtl.css",
"./catalogs/*": "./catalogs/*",
"./package.json": "./package.json"
},
"files": [
"dist",
"catalogs",
"rtl.css"
],
"scripts": {
"build": "rm -rf dist && tsc",
"prepack": "npm run build",
"test": "node --test --experimental-strip-types test/*.ts",
"test:browser": "node --experimental-strip-types test/browser/run.ts",
"typecheck": "../../node_modules/tsgo/bin/tsc --noEmit --incremental false",
"validate": "node --experimental-strip-types ../../tools/validate/src/cli.ts --catalogs catalogs --terms terms.json"
},
"peerDependencies": {
"react": ">=18"
},
"peerDependenciesMeta": {
"react": {
"optional": true
}
},
"devDependencies": {
"@types/node": "^20.0.0",
"@types/react": "^19.0.0",
"esbuild": "^0.28.2",
"playwright-core": "~1.63.0",
"react": "19.2.8",
"react-dom": "19.2.8",
"typescript": "6.0.3"
}
}