Skip to content

Commit a1b9df0

Browse files
committed
fix(compiler): remove log
1 parent f79f678 commit a1b9df0

File tree

6 files changed

+10
-76
lines changed

6 files changed

+10
-76
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"lint": "eslint .",
3232
"play": "npm -C playground run dev",
3333
"test": "vitest",
34-
"release": "bumpp -r --all -x 'pnpm run changelog'",
34+
"release": "pnpm lint && bumpp -r --all -x 'pnpm run changelog'",
3535
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
3636
"docs:dev": "pnpm run -C ./docs dev",
3737
"docs:preview": "pnpm run -C ./docs preview",

packages/compiler/src/transforms/transformChildren.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ function processDynamicChildren(context: TransformContext<Node>) {
7575
const anchor = (prevDynamics[0].anchor = context.increaseId())
7676
registerInsertion(prevDynamics, context, anchor)
7777
} else {
78-
prevDynamics[0].flags -= DynamicFlag.NON_TEMPLATE
7978
registerInsertion(prevDynamics, context, -1 /* prepend */)
8079
}
8180
prevDynamics = []
@@ -95,7 +94,6 @@ function registerInsertion(
9594
anchor?: number,
9695
) {
9796
for (const child of dynamics) {
98-
console.log(child)
9997
if (child.template != null) {
10098
// template node due to invalid nesting - generate actual insertion
10199
context.registerOperation({

packages/compiler/test/transforms/transformChildren.spec.ts

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -159,67 +159,4 @@ describe('compiler: children transform', () => {
159159
expect(code).contains(`const n0 = _nthChild(n1, 2)`)
160160
expect(code).toMatchSnapshot()
161161
})
162-
163-
test('nested elements error', () => {
164-
const { code, ir } = compileWithElementTransform(
165-
`
166-
<div>
167-
<div />
168-
<Comp />
169-
<button disabled={foo} />
170-
</div>
171-
`,
172-
{ inline: false },
173-
)
174-
expect(code).toMatchInlineSnapshot(`
175-
"import { child as _child, next as _next, setInsertionState as _setInsertionState, createComponent as _createComponent, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
176-
const t0 = _template("<div><div></div><!><button></button></div>", true)
177-
178-
export function render(_ctx) {
179-
const n3 = t0()
180-
const n2 = _next(_child(n3))
181-
_setInsertionState(n3, n2)
182-
const n0 = _createComponent(_ctx.Comp)
183-
const n1 = _next(n2)
184-
_renderEffect(() => _setProp(n1, "disabled", _ctx.foo))
185-
return n3
186-
}"
187-
`)
188-
// expect(ir.block.dynamic).toMatchObject({
189-
// children: [
190-
// {
191-
// children: [
192-
// {
193-
// children: [],
194-
// flags: 3,
195-
// },
196-
// {
197-
// children: [],
198-
// flags: 1,
199-
// },
200-
// {
201-
// children: [],
202-
// flags: 3,
203-
// },
204-
// {
205-
// children: [],
206-
// flags: 1,
207-
// id: 0,
208-
// },
209-
// {
210-
// children: [],
211-
// flags: 3,
212-
// },
213-
// ],
214-
// flags: 1,
215-
// hasDynamicChild: true,
216-
// id: 1,
217-
// template: 0,
218-
// },
219-
// ],
220-
// flags: 1,
221-
// hasDynamicChild: true,
222-
// })
223-
console.log(ir.block.dynamic)
224-
})
225162
})

packages/compiler/test/transforms/vHtml.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BindingTypes, DOMErrorCodes, NodeTypes } from '@vue/compiler-dom'
1+
import { DOMErrorCodes, NodeTypes } from '@vue/compiler-dom'
22
import { describe, expect, test, vi } from 'vitest'
33
import {
44
IRNodeTypes,

packages/compiler/test/transforms/vText.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BindingTypes, DOMErrorCodes, NodeTypes } from '@vue/compiler-dom'
1+
import { DOMErrorCodes, NodeTypes } from '@vue/compiler-dom'
22
import { describe, expect, test, vi } from 'vitest'
33
import {
44
IRNodeTypes,

playground/src/model.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import { ref } from 'vue'
2+
23
const Comp = () => {
34
const model = defineModel<string>()
4-
return <div>comp</div>
5+
return <input v-model={model.value} />
56
}
67

78
export default () => {
89
const model = ref('model')
910

1011
return (
11-
<div>
12-
123
13-
<Comp />1
14-
<div>
15-
<button disabled={!!model.value}>123</button>
16-
</div>
17-
</div>
12+
<>
13+
<input v-model={model.value}></input>
14+
<Comp v-model={model.value} />
15+
{model.value}
16+
</>
1817
)
1918
}

0 commit comments

Comments
 (0)