@contember/react-binding 2.0.0-alpha.25 → 2.0.0-alpha.27

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": "@contember/react-binding",
3
3
  "license": "Apache-2.0",
4
- "version": "2.0.0-alpha.25",
4
+ "version": "2.0.0-alpha.27",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/production/index.js",
@@ -28,12 +28,12 @@
28
28
  "ae:test": "api-extractor run"
29
29
  },
30
30
  "dependencies": {
31
- "@contember/binding": "2.0.0-alpha.25",
32
- "@contember/client": "2.0.0-alpha.25",
33
- "@contember/graphql-client": "2.0.0-alpha.25",
34
- "@contember/react-client": "2.0.0-alpha.25",
35
- "@contember/react-utils": "2.0.0-alpha.25",
36
- "@contember/utilities": "2.0.0-alpha.25"
31
+ "@contember/binding": "2.0.0-alpha.27",
32
+ "@contember/client": "2.0.0-alpha.27",
33
+ "@contember/graphql-client": "2.0.0-alpha.27",
34
+ "@contember/react-client": "2.0.0-alpha.27",
35
+ "@contember/react-utils": "2.0.0-alpha.27",
36
+ "@contember/utilities": "2.0.0-alpha.27"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": "^18 || ^19",
@@ -4,7 +4,7 @@ import { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } fro
4
4
  import { EnvironmentMiddleware } from '../accessorPropagation'
5
5
 
6
6
  export const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {
7
- return <EnvironmentMiddleware args={[field]} create={createEnvWithExtension} >{children}</EnvironmentMiddleware>
7
+ return <EnvironmentMiddleware args={[field]} create={createEnvWithExtension}>{children}</EnvironmentMiddleware>
8
8
  })
9
9
 
10
10
  const createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {
@@ -18,9 +18,6 @@ const createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: Rec
18
18
  }
19
19
  return env.withExtension(recursionTerminatorEnvironmentExtension, {
20
20
  shouldTerminate: args => {
21
- if (args.environment.getParent().getSubTreeNode() !== env.getSubTreeNode()) {
22
- return undefined
23
- }
24
21
  const currentNode = args.node
25
22
  if (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {
26
23
  return undefined
@@ -51,9 +51,13 @@ export class MarkerStaticAnalyzer {
51
51
  return this.processNode(node.props.children, env, componentPath)
52
52
  }
53
53
 
54
+ const nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'
55
+
54
56
  componentPath = [...componentPath, node]
57
+ if (componentPath.length > 1000) {
58
+ wrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)
59
+ }
55
60
 
56
- const nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'
57
61
 
58
62
  try {
59
63
  if ('generateEnvironment' in node.type) {