Skip to content

Commit 7ca7290

Browse files
feat: ENG-9021 Remove Circular References for componentToBuilder generator (#1776)
* feat: add `removeCircularReferences` option for `componentToBuilder` generator * chore: add changeset * fix: review comment * fix: review comment * fix: review comment * fix: pr comment * feat: review comment * fix: review comments * Update packages/core/src/generators/builder/generator.ts Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com> --------- Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
1 parent 22ba7c0 commit 7ca7290

File tree

4 files changed

+481
-3
lines changed

4 files changed

+481
-3
lines changed

.changeset/funny-donuts-mate.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@builder.io/mitosis': patch
3+
'@builder.io/mitosis-cli': patch
4+
---
5+
6+
remove Circular References for `componentToBuilder` generator

packages/core/src/__tests__/builder/__snapshots__/builder.test.ts.snap

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3913,6 +3913,282 @@ alert('hi');",
39133913
}
39143914
`;
39153915
3916+
exports[`Builder > handles recursive component structure 1`] = `
3917+
{
3918+
"data": {
3919+
"blocks": [
3920+
{
3921+
"@type": "@builder.io/sdk:Element",
3922+
"actions": {},
3923+
"bindings": {},
3924+
"children": [],
3925+
"code": {
3926+
"actions": {},
3927+
"bindings": {},
3928+
},
3929+
"component": {
3930+
"name": "LocationTree",
3931+
"options": {
3932+
"symbol": {
3933+
"content": {
3934+
"data": {
3935+
"blocks": [
3936+
{
3937+
"@type": "@builder.io/sdk:Element",
3938+
"actions": {},
3939+
"bindings": {},
3940+
"children": [
3941+
{
3942+
"@type": "@builder.io/sdk:Element",
3943+
"bindings": {
3944+
"show": "location.child",
3945+
},
3946+
"children": [
3947+
{
3948+
"@type": "@builder.io/sdk:Element",
3949+
"actions": {},
3950+
"bindings": {
3951+
"component.options.location": "location.child",
3952+
},
3953+
"children": [],
3954+
"code": {
3955+
"actions": {},
3956+
"bindings": {
3957+
"component.options.location": "location.child",
3958+
},
3959+
},
3960+
"component": {
3961+
"name": "LocationTree",
3962+
"options": {
3963+
"symbol": {
3964+
"content": {
3965+
"data": {
3966+
"blocks": [
3967+
{
3968+
"@type": "@builder.io/sdk:Element",
3969+
"actions": {},
3970+
"bindings": {},
3971+
"children": [
3972+
{
3973+
"@type": "@builder.io/sdk:Element",
3974+
"bindings": {
3975+
"show": "location.child",
3976+
},
3977+
"children": [
3978+
{
3979+
"@type": "@builder.io/sdk:Element",
3980+
"actions": {},
3981+
"bindings": {
3982+
"component.options.location": "location.child",
3983+
},
3984+
"children": [],
3985+
"code": {
3986+
"actions": {},
3987+
"bindings": {
3988+
"component.options.location": "location.child",
3989+
},
3990+
},
3991+
"component": {
3992+
"name": "LocationTree",
3993+
"options": {
3994+
"symbol": {
3995+
"content": {
3996+
"data": {
3997+
"blocks": [
3998+
{
3999+
"@type": "@builder.io/sdk:Element",
4000+
"actions": {},
4001+
"bindings": {},
4002+
"children": [
4003+
{
4004+
"@type": "@builder.io/sdk:Element",
4005+
"bindings": {
4006+
"show": "location.child",
4007+
},
4008+
"children": [
4009+
{
4010+
"@type": "@builder.io/sdk:Element",
4011+
"actions": {},
4012+
"bindings": {
4013+
"component.options.location": "location.child",
4014+
},
4015+
"children": [],
4016+
"code": {
4017+
"actions": {},
4018+
"bindings": {
4019+
"component.options.location": "location.child",
4020+
},
4021+
},
4022+
"component": {
4023+
"name": "LocationTree",
4024+
"options": {
4025+
"symbol": {
4026+
"content": {
4027+
"data": {
4028+
"blocks": [
4029+
{
4030+
"@type": "@builder.io/sdk:Element",
4031+
"actions": {},
4032+
"bindings": {},
4033+
"children": [
4034+
{
4035+
"@type": "@builder.io/sdk:Element",
4036+
"bindings": {
4037+
"show": "location.child",
4038+
},
4039+
"children": [
4040+
{
4041+
"@type": "@builder.io/sdk:Element",
4042+
"actions": {},
4043+
"bindings": {
4044+
"component.options.location": "location.child",
4045+
},
4046+
"children": [],
4047+
"code": {
4048+
"actions": {},
4049+
"bindings": {
4050+
"component.options.location": "location.child",
4051+
},
4052+
},
4053+
"component": {
4054+
"name": "LocationTree",
4055+
"options": {
4056+
"symbol": {
4057+
"content": {
4058+
"data": {
4059+
"blocks": [
4060+
{
4061+
"@type": "@builder.io/sdk:Element",
4062+
"actions": {},
4063+
"bindings": {},
4064+
"children": [
4065+
{
4066+
"@type": "@builder.io/sdk:Element",
4067+
"bindings": {
4068+
"show": "location.child",
4069+
},
4070+
"children": [],
4071+
"component": {
4072+
"name": "Core:Fragment",
4073+
},
4074+
},
4075+
],
4076+
"code": {
4077+
"actions": {},
4078+
"bindings": {},
4079+
},
4080+
"component": {
4081+
"name": "Core:Fragment",
4082+
},
4083+
},
4084+
],
4085+
"jsCode": "",
4086+
"tsCode": "",
4087+
},
4088+
},
4089+
},
4090+
},
4091+
},
4092+
},
4093+
],
4094+
"component": {
4095+
"name": "Core:Fragment",
4096+
},
4097+
},
4098+
],
4099+
"code": {
4100+
"actions": {},
4101+
"bindings": {},
4102+
},
4103+
"component": {
4104+
"name": "Core:Fragment",
4105+
},
4106+
},
4107+
],
4108+
"jsCode": "",
4109+
"tsCode": "",
4110+
},
4111+
},
4112+
},
4113+
},
4114+
},
4115+
},
4116+
],
4117+
"component": {
4118+
"name": "Core:Fragment",
4119+
},
4120+
},
4121+
],
4122+
"code": {
4123+
"actions": {},
4124+
"bindings": {},
4125+
},
4126+
"component": {
4127+
"name": "Core:Fragment",
4128+
},
4129+
},
4130+
],
4131+
"jsCode": "",
4132+
"tsCode": "",
4133+
},
4134+
},
4135+
},
4136+
},
4137+
},
4138+
},
4139+
],
4140+
"component": {
4141+
"name": "Core:Fragment",
4142+
},
4143+
},
4144+
],
4145+
"code": {
4146+
"actions": {},
4147+
"bindings": {},
4148+
},
4149+
"component": {
4150+
"name": "Core:Fragment",
4151+
},
4152+
},
4153+
],
4154+
"jsCode": "",
4155+
"tsCode": "",
4156+
},
4157+
},
4158+
},
4159+
},
4160+
},
4161+
},
4162+
],
4163+
"component": {
4164+
"name": "Core:Fragment",
4165+
},
4166+
},
4167+
],
4168+
"code": {
4169+
"actions": {},
4170+
"bindings": {},
4171+
},
4172+
"component": {
4173+
"name": "Core:Fragment",
4174+
},
4175+
},
4176+
],
4177+
"jsCode": "",
4178+
"tsCode": "",
4179+
},
4180+
},
4181+
},
4182+
},
4183+
},
4184+
},
4185+
],
4186+
"jsCode": "",
4187+
"tsCode": "",
4188+
},
4189+
}
4190+
`;
4191+
39164192
exports[`Builder > localization 1`] = `
39174193
{
39184194
"@type": "@builder.io/mitosis/component",

0 commit comments

Comments
 (0)