chrona-react 0.2.0 → 0.2.1
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 +8 -2
- package/README.md +17 -1
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -14,8 +14,14 @@ https://github.com/devlinduldulao/chrona#readme
|
|
|
14
14
|
3. **Server Components.** These components hold state: mark their module
|
|
15
15
|
`"use client"`. The polyfill import is a side effect, so it must reach the
|
|
16
16
|
client bundle — put it at the top of a `"use client"` module that always
|
|
17
|
-
loads (a providers file), not in a Server Component.
|
|
18
|
-
4. **
|
|
17
|
+
loads (a providers file), not in a Server Component. That covers hydration.
|
|
18
|
+
4. **SSR module init.** The providers import does not order Node module
|
|
19
|
+
evaluation. If another `"use client"` file reads `Temporal` at module scope
|
|
20
|
+
(`const reference = Temporal.PlainDate.from(...)` at the top of `page.tsx`),
|
|
21
|
+
Next.js may evaluate that file during SSR before `providers.tsx` has run and
|
|
22
|
+
throw `ReferenceError: Temporal is not defined`. Import the polyfill at the
|
|
23
|
+
top of *that* file too, or move the call inside the component body.
|
|
24
|
+
5. **Values are Temporal objects.** Strings and `Date` are rejected with a
|
|
19
25
|
`ChronaError`; there is no parsing layer.
|
|
20
26
|
|
|
21
27
|
## Anatomy
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ values, no free-form date parsing, and no CSS — you own every pixel.
|
|
|
6
6
|
Part of [Chrona](https://github.com/devlinduldulao/chrona). Built on
|
|
7
7
|
[`chrona-core`](https://www.npmjs.com/package/chrona-core).
|
|
8
8
|
|
|
9
|
-
> **Status: experimental 0.2.
|
|
9
|
+
> **Status: experimental 0.2.1.** Public APIs and styling attributes are not
|
|
10
10
|
> frozen for v1; 0.2.0 changes the Calendar cell anatomy. See the
|
|
11
11
|
> [changelog](./CHANGELOG.md). Automated axe checks pass, but no screen-reader
|
|
12
12
|
> compatibility certification is claimed.
|
|
@@ -172,6 +172,22 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
172
172
|
}
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
That covers the client bundle before hydration. It does not order Node module
|
|
176
|
+
evaluation. If another `"use client"` file reads `Temporal` at module scope
|
|
177
|
+
(`const reference = Temporal.PlainDate.from(...)` at the top of `page.tsx`),
|
|
178
|
+
Next.js may evaluate that file during SSR before `providers.tsx` has run and
|
|
179
|
+
throw `ReferenceError: Temporal is not defined`. Import the polyfill at the top
|
|
180
|
+
of that file too, or move the call inside the component body:
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
"use client";
|
|
184
|
+
|
|
185
|
+
import "temporal-polyfill/global";
|
|
186
|
+
import { Calendar } from "chrona-react";
|
|
187
|
+
|
|
188
|
+
const REFERENCE = Temporal.PlainDate.from({ year: 2026, month: 9, day: 16 });
|
|
189
|
+
```
|
|
190
|
+
|
|
175
191
|
Pass the same reference date, value, locale, and time zone on server and client.
|
|
176
192
|
`timeZone` matters because today is resolved at render time, and a server in
|
|
177
193
|
another zone marks a different cell.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrona-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Headless Temporal-native React date and time primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"chrona-core": "^0.2.
|
|
64
|
+
"chrona-core": "^0.2.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": ">=18.0.0",
|