why-hydration 0.1.5 → 0.3.0
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/CHANGELOG.md +116 -0
- package/README.md +155 -35
- package/dist/chunk-CER5NQRR.js +1333 -0
- package/dist/chunk-CER5NQRR.js.map +1 -0
- package/dist/{chunk-AS5DZZHI.js → chunk-KP4S6CRL.js} +560 -230
- package/dist/chunk-KP4S6CRL.js.map +1 -0
- package/dist/{chunk-AT6A77X3.cjs → chunk-QFHUKJ5K.cjs} +568 -229
- package/dist/chunk-QFHUKJ5K.cjs.map +1 -0
- package/dist/chunk-RWMRFTQ4.cjs +1356 -0
- package/dist/chunk-RWMRFTQ4.cjs.map +1 -0
- package/dist/index.cjs +25 -17
- package/dist/index.d.cts +37 -6
- package/dist/index.d.ts +37 -6
- package/dist/index.js +1 -1
- package/dist/next/index.cjs +4 -4
- package/dist/next/index.d.cts +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +2 -2
- package/dist/react.cjs +4 -4
- package/dist/react.d.cts +24 -3
- package/dist/react.d.ts +24 -3
- package/dist/react.js +2 -2
- package/dist/{types-6wTih14e.d.cts → types-C14vcpBO.d.cts} +9 -0
- package/dist/{types-6wTih14e.d.ts → types-C14vcpBO.d.ts} +9 -0
- package/package.json +22 -4
- package/dist/chunk-3I6F4K4L.js +0 -642
- package/dist/chunk-3I6F4K4L.js.map +0 -1
- package/dist/chunk-AS5DZZHI.js.map +0 -1
- package/dist/chunk-AT6A77X3.cjs.map +0 -1
- package/dist/chunk-OFVFNPE6.cjs +0 -665
- package/dist/chunk-OFVFNPE6.cjs.map +0 -1
package/dist/next/index.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var chunkRWMRFTQ4_cjs = require('../chunk-RWMRFTQ4.cjs');
|
|
5
|
+
require('../chunk-QFHUKJ5K.cjs');
|
|
6
6
|
require('../chunk-DXPTZB3Z.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "HydrationInspector", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkRWMRFTQ4_cjs.HydrationInspector; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "createHydrationInspector", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkRWMRFTQ4_cjs.createHydrationInspector; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=index.cjs.map
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
package/dist/next/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { HydrationInspector, HydrationInspectorHandle, HydrationInspectorProps, InspectorOptions, OverlayOptions, createHydrationInspector } from '../react.cjs';
|
|
2
|
-
export { d as HydrationCauseCategory, H as HydrationReport } from '../types-
|
|
2
|
+
export { d as HydrationCauseCategory, H as HydrationReport } from '../types-C14vcpBO.cjs';
|
|
3
3
|
import 'react';
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { HydrationInspector, HydrationInspectorHandle, HydrationInspectorProps, InspectorOptions, OverlayOptions, createHydrationInspector } from '../react.js';
|
|
2
|
-
export { d as HydrationCauseCategory, H as HydrationReport } from '../types-
|
|
2
|
+
export { d as HydrationCauseCategory, H as HydrationReport } from '../types-C14vcpBO.js';
|
|
3
3
|
import 'react';
|
package/dist/next/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { HydrationInspector, createHydrationInspector } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
export { HydrationInspector, createHydrationInspector } from '../chunk-CER5NQRR.js';
|
|
3
|
+
import '../chunk-KP4S6CRL.js';
|
|
4
4
|
import '../chunk-XIM33ZGB.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/react.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunkRWMRFTQ4_cjs = require('./chunk-RWMRFTQ4.cjs');
|
|
5
|
+
require('./chunk-QFHUKJ5K.cjs');
|
|
6
6
|
require('./chunk-DXPTZB3Z.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "HydrationInspector", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkRWMRFTQ4_cjs.HydrationInspector; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "createHydrationInspector", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkRWMRFTQ4_cjs.createHydrationInspector; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=react.cjs.map
|
|
19
19
|
//# sourceMappingURL=react.cjs.map
|
package/dist/react.d.cts
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { H as HydrationReport, C as Classifier } from './types-
|
|
3
|
-
export { a as Cause, b as DetectionContext, D as Divergence, d as HydrationCauseCategory } from './types-
|
|
2
|
+
import { H as HydrationReport, C as Classifier } from './types-C14vcpBO.cjs';
|
|
3
|
+
export { a as Cause, b as DetectionContext, D as Divergence, d as HydrationCauseCategory } from './types-C14vcpBO.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Overlay languages.
|
|
7
|
+
*
|
|
8
|
+
* The overlay speaks the page's language where it can: an Arabic page gets an
|
|
9
|
+
* Arabic, right-to-left panel, and everything else gets English. The engine's
|
|
10
|
+
* own output (`cause.explanation`, the console, `onReport`) is always English;
|
|
11
|
+
* only this view is translated, by looking causes up by `messageId`.
|
|
12
|
+
*
|
|
13
|
+
* Only the overlay imports this module, so it is tree-shaken out of production
|
|
14
|
+
* builds together with the rest of the dev implementation.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
type OverlayLocale = 'en' | 'ar' | 'he' | 'fa';
|
|
4
18
|
|
|
5
19
|
interface OverlayOptions {
|
|
6
20
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
21
|
+
/**
|
|
22
|
+
* Language of the panel. `'auto'` (the default) follows the page's
|
|
23
|
+
* `<html lang>`: Arabic, Hebrew and Persian pages get the panel in that
|
|
24
|
+
* language, laid out right-to-left, and every other page gets English.
|
|
25
|
+
* Pass `'en'`, `'ar'`, `'he'` or `'fa'` to pin it.
|
|
26
|
+
*/
|
|
27
|
+
locale?: 'auto' | OverlayLocale;
|
|
7
28
|
}
|
|
8
29
|
|
|
9
30
|
interface InspectorOptions {
|
|
@@ -35,4 +56,4 @@ interface HydrationInspectorHandle {
|
|
|
35
56
|
}
|
|
36
57
|
declare function createHydrationInspector(options?: InspectorOptions): HydrationInspectorHandle;
|
|
37
58
|
|
|
38
|
-
export { Classifier, HydrationInspector, type HydrationInspectorHandle, type HydrationInspectorProps, HydrationReport, type InspectorOptions, type OverlayOptions, createHydrationInspector };
|
|
59
|
+
export { Classifier, HydrationInspector, type HydrationInspectorHandle, type HydrationInspectorProps, HydrationReport, type InspectorOptions, type OverlayLocale, type OverlayOptions, createHydrationInspector };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { H as HydrationReport, C as Classifier } from './types-
|
|
3
|
-
export { a as Cause, b as DetectionContext, D as Divergence, d as HydrationCauseCategory } from './types-
|
|
2
|
+
import { H as HydrationReport, C as Classifier } from './types-C14vcpBO.js';
|
|
3
|
+
export { a as Cause, b as DetectionContext, D as Divergence, d as HydrationCauseCategory } from './types-C14vcpBO.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Overlay languages.
|
|
7
|
+
*
|
|
8
|
+
* The overlay speaks the page's language where it can: an Arabic page gets an
|
|
9
|
+
* Arabic, right-to-left panel, and everything else gets English. The engine's
|
|
10
|
+
* own output (`cause.explanation`, the console, `onReport`) is always English;
|
|
11
|
+
* only this view is translated, by looking causes up by `messageId`.
|
|
12
|
+
*
|
|
13
|
+
* Only the overlay imports this module, so it is tree-shaken out of production
|
|
14
|
+
* builds together with the rest of the dev implementation.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
type OverlayLocale = 'en' | 'ar' | 'he' | 'fa';
|
|
4
18
|
|
|
5
19
|
interface OverlayOptions {
|
|
6
20
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
21
|
+
/**
|
|
22
|
+
* Language of the panel. `'auto'` (the default) follows the page's
|
|
23
|
+
* `<html lang>`: Arabic, Hebrew and Persian pages get the panel in that
|
|
24
|
+
* language, laid out right-to-left, and every other page gets English.
|
|
25
|
+
* Pass `'en'`, `'ar'`, `'he'` or `'fa'` to pin it.
|
|
26
|
+
*/
|
|
27
|
+
locale?: 'auto' | OverlayLocale;
|
|
7
28
|
}
|
|
8
29
|
|
|
9
30
|
interface InspectorOptions {
|
|
@@ -35,4 +56,4 @@ interface HydrationInspectorHandle {
|
|
|
35
56
|
}
|
|
36
57
|
declare function createHydrationInspector(options?: InspectorOptions): HydrationInspectorHandle;
|
|
37
58
|
|
|
38
|
-
export { Classifier, HydrationInspector, type HydrationInspectorHandle, type HydrationInspectorProps, HydrationReport, type InspectorOptions, type OverlayOptions, createHydrationInspector };
|
|
59
|
+
export { Classifier, HydrationInspector, type HydrationInspectorHandle, type HydrationInspectorProps, HydrationReport, type InspectorOptions, type OverlayLocale, type OverlayOptions, createHydrationInspector };
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { HydrationInspector, createHydrationInspector } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { HydrationInspector, createHydrationInspector } from './chunk-CER5NQRR.js';
|
|
3
|
+
import './chunk-KP4S6CRL.js';
|
|
4
4
|
import './chunk-XIM33ZGB.js';
|
|
5
5
|
//# sourceMappingURL=react.js.map
|
|
6
6
|
//# sourceMappingURL=react.js.map
|
|
@@ -14,9 +14,18 @@ interface Divergence {
|
|
|
14
14
|
interface Cause {
|
|
15
15
|
category: HydrationCauseCategory;
|
|
16
16
|
confidence: number;
|
|
17
|
+
/** Always English — this is what the console prints and `onReport` gets. */
|
|
17
18
|
explanation: string;
|
|
18
19
|
suggestion: string;
|
|
19
20
|
docsUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Which message produced `explanation`/`suggestion`, so a renderer can show
|
|
23
|
+
* the same cause in another language. Set by every built-in rule; custom
|
|
24
|
+
* classifiers may leave it out, and renderers then fall back to the English.
|
|
25
|
+
*/
|
|
26
|
+
messageId?: string;
|
|
27
|
+
/** The values interpolated into that message (attribute names, tokens…). */
|
|
28
|
+
params?: Readonly<Record<string, string | readonly string[]>>;
|
|
20
29
|
}
|
|
21
30
|
type Classifier = (divergence: Divergence) => Cause | null;
|
|
22
31
|
interface SourceLocation {
|
|
@@ -14,9 +14,18 @@ interface Divergence {
|
|
|
14
14
|
interface Cause {
|
|
15
15
|
category: HydrationCauseCategory;
|
|
16
16
|
confidence: number;
|
|
17
|
+
/** Always English — this is what the console prints and `onReport` gets. */
|
|
17
18
|
explanation: string;
|
|
18
19
|
suggestion: string;
|
|
19
20
|
docsUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Which message produced `explanation`/`suggestion`, so a renderer can show
|
|
23
|
+
* the same cause in another language. Set by every built-in rule; custom
|
|
24
|
+
* classifiers may leave it out, and renderers then fall back to the English.
|
|
25
|
+
*/
|
|
26
|
+
messageId?: string;
|
|
27
|
+
/** The values interpolated into that message (attribute names, tokens…). */
|
|
28
|
+
params?: Readonly<Record<string, string | readonly string[]>>;
|
|
20
29
|
}
|
|
21
30
|
type Classifier = (divergence: Divergence) => Cause | null;
|
|
22
31
|
interface SourceLocation {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "why-hydration",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Find which React component broke hydration, what differed, and how to fix it — for Next.js, Remix and Vite, React 18 and 19. Dev-only, zero production cost.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Razan Aboushi (https://www.linkedin.com/in/razan-aboushi/)",
|
|
7
7
|
"homepage": "https://github.com/razan-aboushi/why-hydration#readme",
|
|
@@ -14,15 +14,33 @@
|
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react",
|
|
17
|
+
"react-dom",
|
|
17
18
|
"hydration",
|
|
18
19
|
"hydration error",
|
|
20
|
+
"hydration mismatch",
|
|
21
|
+
"hydration-mismatch",
|
|
22
|
+
"hydration failed",
|
|
23
|
+
"react hydration",
|
|
24
|
+
"hydrateRoot",
|
|
25
|
+
"text content does not match",
|
|
26
|
+
"suppressHydrationWarning",
|
|
19
27
|
"ssr",
|
|
28
|
+
"server-side rendering",
|
|
20
29
|
"next",
|
|
30
|
+
"nextjs",
|
|
31
|
+
"next.js",
|
|
32
|
+
"app router",
|
|
21
33
|
"remix",
|
|
22
34
|
"vite",
|
|
23
|
-
"
|
|
35
|
+
"react 18",
|
|
36
|
+
"react 19",
|
|
24
37
|
"devtools",
|
|
25
|
-
"
|
|
38
|
+
"debugging",
|
|
39
|
+
"diagnostics",
|
|
40
|
+
"developer tools",
|
|
41
|
+
"rtl",
|
|
42
|
+
"arabic",
|
|
43
|
+
"i18n"
|
|
26
44
|
],
|
|
27
45
|
"type": "module",
|
|
28
46
|
"sideEffects": false,
|