rari 0.5.20 → 0.5.21

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rari",
3
3
  "type": "module",
4
- "version": "0.5.20",
4
+ "version": "0.5.21",
5
5
  "description": "Runtime Accelerated Rendering Infrastructure (Rari)",
6
6
  "author": "Ryan Skinner",
7
7
  "license": "MIT",
@@ -89,11 +89,11 @@
89
89
  "picocolors": "^1.1.1"
90
90
  },
91
91
  "optionalDependencies": {
92
- "rari-darwin-arm64": "0.5.14",
93
- "rari-darwin-x64": "0.5.14",
94
- "rari-linux-arm64": "0.5.14",
95
- "rari-linux-x64": "0.5.14",
96
- "rari-win32-x64": "0.5.14"
92
+ "rari-darwin-arm64": "0.5.15",
93
+ "rari-darwin-x64": "0.5.15",
94
+ "rari-linux-arm64": "0.5.15",
95
+ "rari-linux-x64": "0.5.15",
96
+ "rari-win32-x64": "0.5.15"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@types/node": "^25.0.1",
@@ -38,8 +38,8 @@ export function registerClientComponent(componentFunction, id, exportName) {
38
38
  globalThis.__clientComponentNames[componentName] = componentId
39
39
 
40
40
  if (componentFunction) {
41
- componentFunction.__isClientComponent = true
42
- componentFunction.__clientComponentId = componentId
41
+ componentFunction['~isClientComponent'] = true
42
+ componentFunction['~clientComponentId'] = componentId
43
43
  }
44
44
 
45
45
  if (typeof window !== 'undefined') {
@@ -297,9 +297,10 @@ class RscClient {
297
297
  const [, type, key, props] = element
298
298
 
299
299
  if (type === 'react.suspense' || type === 'suspense') {
300
+ const boundaryId = props?.['~boundaryId']
300
301
  const suspenseWrapper = createElement('div', {
301
- 'data-boundary-id': props?.boundaryId,
302
- 'boundaryId': props?.boundaryId,
302
+ 'data-~boundary-id': boundaryId,
303
+ '~boundaryId': boundaryId,
303
304
  'data-suspense-boundary': true,
304
305
  }, convertRscToReact(props?.fallback || props?.children))
305
306
 
@@ -343,8 +344,8 @@ class RscClient {
343
344
  }
344
345
  }
345
346
  else {
346
- if (processedProps && Object.prototype.hasOwnProperty.call(processedProps, 'boundaryId')) {
347
- const { boundaryId, ...rest } = processedProps
347
+ if (processedProps && Object.prototype.hasOwnProperty.call(processedProps, '~boundaryId')) {
348
+ const { '~boundaryId': tildeBoundaryId, ...rest } = processedProps
348
349
  processedProps = rest
349
350
  }
350
351
  const reactElement = createElement(type, key ? { ...processedProps, key } : processedProps)
@@ -439,8 +440,9 @@ class RscClient {
439
440
  const parsed = JSON.parse(content)
440
441
  if (Array.isArray(parsed) && parsed.length >= 4) {
441
442
  const [marker, selector, props] = parsed
442
- if (marker === '$' && (selector === 'react.suspense' || selector === 'suspense') && props && props.boundaryId) {
443
- boundaryRowMap.set(`$L${rowId}`, props.boundaryId)
443
+ const boundaryId = props?.['~boundaryId']
444
+ if (marker === '$' && (selector === 'react.suspense' || selector === 'suspense') && props && boundaryId) {
445
+ boundaryRowMap.set(`$L${rowId}`, boundaryId)
444
446
  }
445
447
  if (marker === '$' && props && Object.prototype.hasOwnProperty.call(props, 'children')) {
446
448
  if (typeof selector === 'string' && selector.startsWith('$L')) {
@@ -461,7 +463,8 @@ class RscClient {
461
463
  if (Array.isArray(parsed) && parsed.length >= 4 && parsed[0] === '$') {
462
464
  const sel = parsed[1]
463
465
  const p = parsed[3]
464
- if (typeof sel === 'string' && (sel === 'react.suspense' || sel === 'suspense') && p && p.boundaryId) {
466
+ const boundaryId = p?.['~boundaryId']
467
+ if (typeof sel === 'string' && (sel === 'react.suspense' || sel === 'suspense') && p && boundaryId) {
465
468
  canUseAsRoot = false
466
469
  }
467
470
  }
@@ -509,8 +512,8 @@ class RscClient {
509
512
  return null
510
513
 
511
514
  if (isValidElement(element)) {
512
- if (element.props && element.props.boundaryId) {
513
- const boundaryId = element.props.boundaryId
515
+ const boundaryId = element.props?.['~boundaryId']
516
+ if (element.props && boundaryId) {
514
517
  const resolvedContent = boundaryUpdates.get(boundaryId)
515
518
  if (resolvedContent) {
516
519
  return resolvedContent
@@ -673,7 +676,8 @@ class RscClient {
673
676
  const element = elements.get(key)
674
677
  if (Array.isArray(element) && element.length >= 2 && element[0] === '$') {
675
678
  const [, type, , props] = element
676
- if (type === 'react.suspense' && props && props.boundaryId) {
679
+ const boundaryId = props?.['~boundaryId']
680
+ if (type === 'react.suspense' && props && boundaryId) {
677
681
  continue
678
682
  }
679
683
  rootElement = element