@tanstack/redact 0.0.13 → 0.0.15

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.
Files changed (93) hide show
  1. package/dist/core/internal.d.ts +23 -39
  2. package/dist/core/internal.js +7 -23
  3. package/dist/core/internal.js.map +3 -3
  4. package/dist/dom/dispatcher.d.ts +3 -1
  5. package/dist/dom/dispatcher.js +104 -97
  6. package/dist/dom/dispatcher.js.map +2 -2
  7. package/dist/dom/dom.js +1 -1
  8. package/dist/dom/dom.js.map +2 -2
  9. package/dist/dom/event-replay.js +7 -29
  10. package/dist/dom/event-replay.js.map +2 -2
  11. package/dist/dom/features/class/full.js +16 -16
  12. package/dist/dom/features/class/full.js.map +2 -2
  13. package/dist/dom/features/class/stub.js +7 -7
  14. package/dist/dom/features/class/stub.js.map +2 -2
  15. package/dist/dom/features/context/full.js +7 -7
  16. package/dist/dom/features/context/full.js.map +2 -2
  17. package/dist/dom/features/context/stub.js +3 -3
  18. package/dist/dom/features/context/stub.js.map +2 -2
  19. package/dist/dom/features/forward-ref/full.js +11 -11
  20. package/dist/dom/features/forward-ref/full.js.map +2 -2
  21. package/dist/dom/features/hydration/full.d.ts +26 -14
  22. package/dist/dom/features/hydration/full.js +412 -92
  23. package/dist/dom/features/hydration/full.js.map +2 -2
  24. package/dist/dom/features/hydration/stub.d.ts +13 -12
  25. package/dist/dom/features/hydration/stub.js +23 -8
  26. package/dist/dom/features/hydration/stub.js.map +2 -2
  27. package/dist/dom/features/lazy/full.js +3 -43
  28. package/dist/dom/features/lazy/full.js.map +2 -2
  29. package/dist/dom/features/lazy/stub.js +1 -1
  30. package/dist/dom/features/lazy/stub.js.map +2 -2
  31. package/dist/dom/features/memo/full.js +3 -3
  32. package/dist/dom/features/memo/full.js.map +2 -2
  33. package/dist/dom/features/memo/stub.js +1 -1
  34. package/dist/dom/features/memo/stub.js.map +2 -2
  35. package/dist/dom/features/portal/full.js +2 -2
  36. package/dist/dom/features/portal/full.js.map +2 -2
  37. package/dist/dom/features/suspense/full.js +151 -109
  38. package/dist/dom/features/suspense/full.js.map +2 -2
  39. package/dist/dom/reconcile.d.ts +3 -1
  40. package/dist/dom/reconcile.js +141 -129
  41. package/dist/dom/reconcile.js.map +2 -2
  42. package/dist/dom/root-internal.d.ts +9 -0
  43. package/dist/dom/root-internal.js +31 -0
  44. package/dist/dom/root-internal.js.map +7 -0
  45. package/dist/dom/root.d.ts +1 -1
  46. package/dist/dom/root.js +4 -136
  47. package/dist/dom/root.js.map +2 -2
  48. package/dist/dom/test-utils.js +1 -1
  49. package/dist/dom/test-utils.js.map +2 -2
  50. package/dist/react/children.js +4 -1
  51. package/dist/react/children.js.map +2 -2
  52. package/dist/react/class.js +8 -2
  53. package/dist/react/class.js.map +2 -2
  54. package/dist/react/context.js +4 -1
  55. package/dist/react/context.js.map +2 -2
  56. package/dist/react/index.js +1 -1
  57. package/dist/react/index.js.map +2 -2
  58. package/dist/react/shared-internals.d.ts +4 -7
  59. package/dist/react/shared-internals.js +4 -7
  60. package/dist/react/shared-internals.js.map +2 -2
  61. package/dist/server/stream.d.ts +5 -1
  62. package/dist/server/stream.js.map +2 -2
  63. package/dist/vite/index.js +19 -3
  64. package/dist/vite/index.js.map +2 -2
  65. package/package.json +1 -1
  66. package/src/core/internal.ts +30 -50
  67. package/src/dom/dispatcher.ts +114 -105
  68. package/src/dom/dom.ts +1 -1
  69. package/src/dom/event-replay.ts +14 -30
  70. package/src/dom/features/class/full.ts +16 -16
  71. package/src/dom/features/class/stub.ts +7 -7
  72. package/src/dom/features/context/full.ts +7 -7
  73. package/src/dom/features/context/stub.ts +3 -3
  74. package/src/dom/features/forward-ref/full.ts +11 -11
  75. package/src/dom/features/hydration/full.ts +516 -104
  76. package/src/dom/features/hydration/stub.ts +28 -14
  77. package/src/dom/features/lazy/full.ts +3 -56
  78. package/src/dom/features/lazy/stub.ts +1 -1
  79. package/src/dom/features/memo/full.ts +3 -3
  80. package/src/dom/features/memo/stub.ts +1 -1
  81. package/src/dom/features/portal/full.ts +2 -2
  82. package/src/dom/features/suspense/full.ts +176 -129
  83. package/src/dom/reconcile.ts +164 -170
  84. package/src/dom/root-internal.ts +40 -0
  85. package/src/dom/root.ts +5 -165
  86. package/src/dom/test-utils.ts +1 -1
  87. package/src/react/children.ts +4 -1
  88. package/src/react/class.ts +8 -2
  89. package/src/react/context.ts +4 -1
  90. package/src/react/index.ts +1 -1
  91. package/src/react/shared-internals.ts +8 -14
  92. package/src/server/stream.ts +9 -4
  93. package/src/vite/index.ts +34 -3
@@ -23,24 +23,24 @@ import {
23
23
  // still work, and save ~400 B min / ~200 B gz.
24
24
  function renderClassStub(fiber: Fiber, domParent: Node, anchor: Node | null): void {
25
25
  const Ctor = fiber.type as any
26
- let instance = fiber.stateNode
27
- const props = fiber.pendingProps ?? {}
26
+ let instance = fiber.sn
27
+ const props = fiber.pp ?? {}
28
28
 
29
29
  if (!instance) {
30
30
  instance = new Ctor(props, undefined)
31
31
  instance.props = props
32
32
  instance._fiber = fiber
33
33
  instance._enqueueUpdate = (updater: any, cb?: () => void) => {
34
- const next = typeof updater === 'function' ? updater(instance.state, instance.props) : updater
34
+ const next = typeof updater == 'function' ? updater(instance.state, instance.props) : updater
35
35
  if (next != null) instance.state = { ...instance.state, ...next }
36
36
  if (cb) {
37
- fiber.cleanups ||= []
38
- fiber.cleanups.push(cb)
37
+ fiber.cu ||= []
38
+ fiber.cu.push(cb)
39
39
  }
40
40
  scheduleUpdate(fiber)
41
41
  }
42
42
  instance._forceUpdate = instance._enqueueUpdate
43
- fiber.stateNode = instance
43
+ fiber.sn = instance
44
44
  } else {
45
45
  instance.props = props
46
46
  }
@@ -59,7 +59,7 @@ function renderClassStub(fiber: Fiber, domParent: Node, anchor: Node | null): vo
59
59
  }
60
60
 
61
61
  reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor)
62
- fiber.memoizedProps = props
62
+ fiber.mp = props
63
63
  }
64
64
 
65
65
  registerRenderer(FiberTag.Class, renderClassStub)
@@ -12,7 +12,7 @@ function realReadContext(fiber: Fiber, ctx: any): any {
12
12
  let p: Fiber | null = fiber.parent
13
13
  while (p) {
14
14
  if (p.tag === FiberTag.Provider && (p.type as any)._context === ctx) {
15
- return (p.pendingProps ?? p.memoizedProps)?.value
15
+ return (p.pp ?? p.mp)?.value
16
16
  }
17
17
  p = p.parent
18
18
  }
@@ -21,7 +21,7 @@ function realReadContext(fiber: Fiber, ctx: any): any {
21
21
 
22
22
  function renderProvider(fiber: Fiber, domParent: Node, anchor: Node | null): void {
23
23
  const ctx = (fiber.type as any)._context
24
- const props = fiber.pendingProps ?? {}
24
+ const props = fiber.pp ?? {}
25
25
  const prevValue = ctx._currentValue
26
26
  ctx._currentValue = props.value
27
27
  try {
@@ -31,18 +31,18 @@ function renderProvider(fiber: Fiber, domParent: Node, anchor: Node | null): voi
31
31
  }
32
32
  // Also store the value on the fiber so descendants rendering later (via updates)
33
33
  // can read through by walking up.
34
- fiber.memoizedState = props.value
35
- fiber.memoizedProps = props
34
+ fiber.ms = props.value
35
+ fiber.mp = props
36
36
  }
37
37
 
38
38
  function renderConsumer(fiber: Fiber, domParent: Node, anchor: Node | null): void {
39
39
  const ctx = (fiber.type as any)._context
40
- const props = fiber.pendingProps ?? {}
40
+ const props = fiber.pp ?? {}
41
41
  const children = props.children
42
42
  const value = realReadContext(fiber, ctx)
43
- const rendered = typeof children === 'function' ? children(value) : null
43
+ const rendered = typeof children == 'function' ? children(value) : null
44
44
  reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor)
45
- fiber.memoizedProps = props
45
+ fiber.mp = props
46
46
  }
47
47
 
48
48
  registerTypeMatcher((_type, marker) =>
@@ -15,11 +15,11 @@ import {
15
15
  // walking, which matches the no-Provider-fibers-in-tree reality.
16
16
  function renderConsumerStub(fiber: Fiber, domParent: Node, anchor: Node | null): void {
17
17
  const ctx = (fiber.type as any)._context
18
- const props = fiber.pendingProps ?? {}
18
+ const props = fiber.pp ?? {}
19
19
  const value = ctx._currentValue
20
- const rendered = typeof props.children === 'function' ? props.children(value) : null
20
+ const rendered = typeof props.children == 'function' ? props.children(value) : null
21
21
  reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor)
22
- fiber.memoizedProps = props
22
+ fiber.mp = props
23
23
  }
24
24
 
25
25
  registerTypeMatcher((_type, marker) =>
@@ -12,18 +12,18 @@ import {
12
12
  import { makeDispatcher } from '../../dispatcher'
13
13
 
14
14
  function renderForwardRef(fiber: Fiber, domParent: Node, anchor: Node | null): void {
15
- const props = fiber.pendingProps ?? {}
15
+ const props = fiber.pp ?? {}
16
16
  const render = (fiber.type as any).render
17
17
  const ref = fiber.ref ?? (props.ref ?? null)
18
18
 
19
19
  const prevDispatcher = ReactSharedInternals.H
20
- const prevFiber = ReactSharedInternals.currentFiber
21
- const prevHook = ReactSharedInternals.currentHook
22
- const prevIndex = ReactSharedInternals.hookIndex
20
+ const prevFiber = ReactSharedInternals.F
21
+ const prevHook = ReactSharedInternals.K
22
+ const prevIndex = ReactSharedInternals.I
23
23
  ReactSharedInternals.H = makeDispatcher()
24
- ReactSharedInternals.currentFiber = fiber
25
- ReactSharedInternals.currentHook = null
26
- ReactSharedInternals.hookIndex = 0
24
+ ReactSharedInternals.F = fiber
25
+ ReactSharedInternals.K = null
26
+ ReactSharedInternals.I = 0
27
27
 
28
28
  let rendered: ReactNode
29
29
  try {
@@ -39,13 +39,13 @@ function renderForwardRef(fiber: Fiber, domParent: Node, anchor: Node | null): v
39
39
  }
40
40
  } finally {
41
41
  ReactSharedInternals.H = prevDispatcher
42
- ReactSharedInternals.currentFiber = prevFiber
43
- ReactSharedInternals.currentHook = prevHook
44
- ReactSharedInternals.hookIndex = prevIndex
42
+ ReactSharedInternals.F = prevFiber
43
+ ReactSharedInternals.K = prevHook
44
+ ReactSharedInternals.I = prevIndex
45
45
  }
46
46
 
47
47
  reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor)
48
- fiber.memoizedProps = props
48
+ fiber.mp = props
49
49
  }
50
50
 
51
51
  registerTypeMatcher((_type, marker) =>