From 35cd28aad4484919547c1a4c48041ea9ecd9893b Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Sun, 9 Aug 2026 13:00:18 +0530 Subject: [PATCH] revert(compiler): preserve inline structured component props --- packages/compiler/src/codegen.ts | 7 ------- packages/compiler/test/compiler.test.ts | 13 ------------- 2 files changed, 20 deletions(-) diff --git a/packages/compiler/src/codegen.ts b/packages/compiler/src/codegen.ts index 08c23a3c..e19d57dd 100644 --- a/packages/compiler/src/codegen.ts +++ b/packages/compiler/src/codegen.ts @@ -742,13 +742,6 @@ function renderNestedComponentInvocation( return ` ${attr.name}`; } - if (/^\s*\{\{[\s\S]*\}\}\s*$/.test(attr.value)) { - throw new Error( - `WRN-PROP-INLINE-OBJECT: '${attr.name}' uses an inline object or array prop. ` + - `Hoist it to state and pass ${attr.name}={yourState} instead.`, - ); - } - const wholeExpression = wholeAttributeExpression(attr.value); const compiledValue = wholeExpression diff --git a/packages/compiler/test/compiler.test.ts b/packages/compiler/test/compiler.test.ts index 737e18b5..45fcb76e 100644 --- a/packages/compiler/test/compiler.test.ts +++ b/packages/compiler/test/compiler.test.ts @@ -1083,19 +1083,6 @@ page Home { expect(output).toContain("__wrnexusPropAttr(["); }); -test("rejects inline object props with a hoisting diagnostic", () => { - expect(() => - generate( - parse(`component Example { view { } }`), - ), - ).toThrow("WRN-PROP-INLINE-OBJECT"); - - expect(() => - generate( - parse(`component Example { state items = [{ a: 1 }] view { } }`), - ), - ).not.toThrow(); -}); test("component functions are available during server rendering", () => { const output = generate( parse(`