mirror of https://github.com/vuejs/core.git
chore: Merge branch 'vapor' into jsx-vapor
This commit is contained in:
commit
9e2eea9103
|
@ -984,7 +984,7 @@ export function compileScript(
|
||||||
ctx.s.prependLeft(
|
ctx.s.prependLeft(
|
||||||
startOffset,
|
startOffset,
|
||||||
`\n${genDefaultAs} /*@__PURE__*/${ctx.helper(
|
`\n${genDefaultAs} /*@__PURE__*/${ctx.helper(
|
||||||
vapor ? `defineVaporComponent` : `defineComponent`,
|
vapor && !ssr ? `defineVaporComponent` : `defineComponent`,
|
||||||
)}({${def}${runtimeOptions}\n ${
|
)}({${def}${runtimeOptions}\n ${
|
||||||
hasAwait ? `async ` : ``
|
hasAwait ? `async ` : ``
|
||||||
}setup(${args}) {\n${exposeCall}`,
|
}setup(${args}) {\n${exposeCall}`,
|
||||||
|
|
|
@ -149,7 +149,7 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`compile > directives > v-pre > should not affect siblings after it 1`] = `
|
exports[`compile > directives > v-pre > should not affect siblings after it 1`] = `
|
||||||
"import { resolveComponent as _resolveComponent, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, child as _child, toDisplayString as _toDisplayString, setText as _setText, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
"import { resolveComponent as _resolveComponent, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, child as _child, setProp as _setProp, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
const t0 = _template("<div :id=\\"foo\\"><Comp></Comp>{{ bar }}</div>")
|
const t0 = _template("<div :id=\\"foo\\"><Comp></Comp>{{ bar }}</div>")
|
||||||
const t1 = _template("<div> </div>")
|
const t1 = _template("<div> </div>")
|
||||||
|
|
||||||
|
@ -161,8 +161,8 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
|
||||||
_setInsertionState(n3, 0)
|
_setInsertionState(n3, 0)
|
||||||
const n1 = _createComponentWithFallback(_component_Comp)
|
const n1 = _createComponentWithFallback(_component_Comp)
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
_setText(n2, _toDisplayString(_ctx.bar))
|
|
||||||
_setProp(n3, "id", _ctx.foo)
|
_setProp(n3, "id", _ctx.foo)
|
||||||
|
_setText(n2, _toDisplayString(_ctx.bar))
|
||||||
})
|
})
|
||||||
return [n0, n3]
|
return [n0, n3]
|
||||||
}"
|
}"
|
||||||
|
@ -180,7 +180,7 @@ export function render(_ctx) {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`compile > dynamic root nodes and interpolation 1`] = `
|
exports[`compile > dynamic root nodes and interpolation 1`] = `
|
||||||
"import { child as _child, toDisplayString as _toDisplayString, setText as _setText, setProp as _setProp, renderEffect as _renderEffect, delegateEvents as _delegateEvents, template as _template } from 'vue';
|
"import { child as _child, setProp as _setProp, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, delegateEvents as _delegateEvents, template as _template } from 'vue';
|
||||||
const t0 = _template("<button> </button>", true)
|
const t0 = _template("<button> </button>", true)
|
||||||
_delegateEvents("click")
|
_delegateEvents("click")
|
||||||
|
|
||||||
|
@ -190,13 +190,47 @@ export function render(_ctx) {
|
||||||
n0.$evtclick = e => _ctx.handleClick(e)
|
n0.$evtclick = e => _ctx.handleClick(e)
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _count = _ctx.count
|
const _count = _ctx.count
|
||||||
_setText(x0, _toDisplayString(_count) + "foo" + _toDisplayString(_count) + "foo" + _toDisplayString(_count))
|
|
||||||
_setProp(n0, "id", _count)
|
_setProp(n0, "id", _count)
|
||||||
|
_setText(x0, _toDisplayString(_count) + "foo" + _toDisplayString(_count) + "foo" + _toDisplayString(_count))
|
||||||
})
|
})
|
||||||
return n0
|
return n0
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`compile > execution order > basic 1`] = `
|
||||||
|
"import { child as _child, setProp as _setProp, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
|
const t0 = _template("<div> </div>", true)
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const n0 = t0()
|
||||||
|
const x0 = _child(n0)
|
||||||
|
_renderEffect(() => {
|
||||||
|
_setProp(n0, "id", _ctx.foo)
|
||||||
|
_setText(x0, _toDisplayString(_ctx.bar))
|
||||||
|
})
|
||||||
|
return n0
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`compile > execution order > with v-once 1`] = `
|
||||||
|
"import { child as _child, next as _next, nthChild as _nthChild, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
|
const t0 = _template("<div><span> </span> <br> </div>", true)
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const n3 = t0()
|
||||||
|
const n0 = _child(n3)
|
||||||
|
const n1 = _next(n0)
|
||||||
|
const n2 = _nthChild(n3, 3)
|
||||||
|
const x0 = _child(n0)
|
||||||
|
_setText(x0, _toDisplayString(_ctx.foo))
|
||||||
|
_renderEffect(() => {
|
||||||
|
_setText(n1, " " + _toDisplayString(_ctx.bar))
|
||||||
|
_setText(n2, " " + _toDisplayString(_ctx.baz))
|
||||||
|
})
|
||||||
|
return n3
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`compile > expression parsing > interpolation 1`] = `
|
exports[`compile > expression parsing > interpolation 1`] = `
|
||||||
"
|
"
|
||||||
const n0 = t0()
|
const n0 = t0()
|
||||||
|
|
|
@ -237,4 +237,29 @@ describe('compile', () => {
|
||||||
expect(code).toMatchSnapshot()
|
expect(code).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('execution order', () => {
|
||||||
|
test('basic', () => {
|
||||||
|
const code = compile(`<div :id="foo">{{ bar }}</div>`)
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
expect(code).contains(
|
||||||
|
`_setProp(n0, "id", _ctx.foo)
|
||||||
|
_setText(x0, _toDisplayString(_ctx.bar))`,
|
||||||
|
)
|
||||||
|
})
|
||||||
|
test('with v-once', () => {
|
||||||
|
const code = compile(
|
||||||
|
`<div>
|
||||||
|
<span v-once>{{ foo }}</span>
|
||||||
|
{{ bar }}<br>
|
||||||
|
{{ baz }}
|
||||||
|
</div>`,
|
||||||
|
)
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
expect(code).contains(
|
||||||
|
`_setText(n1, " " + _toDisplayString(_ctx.bar))
|
||||||
|
_setText(n2, " " + _toDisplayString(_ctx.baz))`,
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -34,7 +34,7 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`compiler: expression > update expression 1`] = `
|
exports[`compiler: expression > update expression 1`] = `
|
||||||
"import { child as _child, toDisplayString as _toDisplayString, setText as _setText, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
"import { child as _child, setProp as _setProp, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
const t0 = _template("<div> </div>", true)
|
const t0 = _template("<div> </div>", true)
|
||||||
|
|
||||||
export function render(_ctx) {
|
export function render(_ctx) {
|
||||||
|
@ -44,12 +44,11 @@ export function render(_ctx) {
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _String = String
|
const _String = String
|
||||||
const _foo = _ctx.foo
|
const _foo = _ctx.foo
|
||||||
|
|
||||||
_setText(n0, _toDisplayString(_String(_foo.id++)) + " " + _toDisplayString(_foo) + " " + _toDisplayString(_ctx.bar))
|
|
||||||
_setText(x1, _toDisplayString(_String(_foo.id++)) + " " + _toDisplayString(_foo) + " " + _toDisplayString(_ctx.bar))
|
|
||||||
_setProp(n1, "id", _String(_foo.id++))
|
_setProp(n1, "id", _String(_foo.id++))
|
||||||
_setProp(n1, "foo", _foo)
|
_setProp(n1, "foo", _foo)
|
||||||
_setProp(n1, "bar", _ctx.bar++)
|
_setProp(n1, "bar", _ctx.bar++)
|
||||||
|
_setText(n0, _toDisplayString(_String(_foo.id++)) + " " + _toDisplayString(_foo) + " " + _toDisplayString(_ctx.bar))
|
||||||
|
_setText(x1, _toDisplayString(_String(_foo.id++)) + " " + _toDisplayString(_foo) + " " + _toDisplayString(_ctx.bar))
|
||||||
})
|
})
|
||||||
return n1
|
return n1
|
||||||
}"
|
}"
|
||||||
|
|
|
@ -67,7 +67,6 @@ export function render(_ctx) {
|
||||||
const x2 = _child(n2)
|
const x2 = _child(n2)
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _msg = _ctx.msg
|
const _msg = _ctx.msg
|
||||||
|
|
||||||
_setText(x0, _toDisplayString(_msg))
|
_setText(x0, _toDisplayString(_msg))
|
||||||
_setText(x1, _toDisplayString(_msg))
|
_setText(x1, _toDisplayString(_msg))
|
||||||
_setText(x2, _toDisplayString(_msg))
|
_setText(x2, _toDisplayString(_msg))
|
||||||
|
|
|
@ -188,6 +188,18 @@ export function render(_ctx) {
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`compiler: element transform > component > v-for on component should not mark as single root 1`] = `
|
||||||
|
"import { createComponent as _createComponent, createFor as _createFor } from 'vue';
|
||||||
|
|
||||||
|
export function render(_ctx, $props, $emit, $attrs, $slots) {
|
||||||
|
const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
|
||||||
|
const n2 = _createComponent(_ctx.Comp)
|
||||||
|
return n2
|
||||||
|
}, (item) => (item), 2)
|
||||||
|
return n0
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`compiler: element transform > component > v-on expression is a function call 1`] = `
|
exports[`compiler: element transform > component > v-on expression is a function call 1`] = `
|
||||||
"import { resolveComponent as _resolveComponent, createComponentWithFallback as _createComponentWithFallback } from 'vue';
|
"import { resolveComponent as _resolveComponent, createComponentWithFallback as _createComponentWithFallback } from 'vue';
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,14 @@ export function render(_ctx) {
|
||||||
const _setTemplateRef = _createTemplateRefSetter()
|
const _setTemplateRef = _createTemplateRefSetter()
|
||||||
const n0 = t0()
|
const n0 = t0()
|
||||||
let r0
|
let r0
|
||||||
_renderEffect(() => r0 = _setTemplateRef(n0, bar => _ctx.foo = bar, r0))
|
_renderEffect(() => {
|
||||||
|
const _foo = _ctx.foo
|
||||||
|
r0 = _setTemplateRef(n0, bar => {
|
||||||
|
_foo.value = bar
|
||||||
|
;({ baz: _ctx.baz } = bar)
|
||||||
|
console.log(_foo.value, _ctx.baz)
|
||||||
|
}, r0)
|
||||||
|
})
|
||||||
return n0
|
return n0
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
@ -56,6 +63,15 @@ export function render(_ctx) {
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`compiler: template ref transform > static ref (inline mode) 1`] = `
|
||||||
|
"
|
||||||
|
const _setTemplateRef = _createTemplateRefSetter()
|
||||||
|
const n0 = t0()
|
||||||
|
_setTemplateRef(n0, foo)
|
||||||
|
return n0
|
||||||
|
"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`compiler: template ref transform > static ref 1`] = `
|
exports[`compiler: template ref transform > static ref 1`] = `
|
||||||
"import { createTemplateRefSetter as _createTemplateRefSetter, template as _template } from 'vue';
|
"import { createTemplateRefSetter as _createTemplateRefSetter, template as _template } from 'vue';
|
||||||
const t0 = _template("<div></div>", true)
|
const t0 = _template("<div></div>", true)
|
||||||
|
|
|
@ -55,7 +55,6 @@ export function render(_ctx) {
|
||||||
const _foo = _ctx.foo
|
const _foo = _ctx.foo
|
||||||
const _bar = _ctx.bar
|
const _bar = _ctx.bar
|
||||||
const _foo_bar_baz = _foo[_bar(_ctx.baz)]
|
const _foo_bar_baz = _foo[_bar(_ctx.baz)]
|
||||||
|
|
||||||
_setProp(n0, "id", _foo_bar_baz)
|
_setProp(n0, "id", _foo_bar_baz)
|
||||||
_setProp(n1, "id", _foo_bar_baz)
|
_setProp(n1, "id", _foo_bar_baz)
|
||||||
_setProp(n2, "id", _bar() + _foo)
|
_setProp(n2, "id", _bar() + _foo)
|
||||||
|
@ -107,7 +106,6 @@ export function render(_ctx) {
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _obj = _ctx.obj
|
const _obj = _ctx.obj
|
||||||
const _obj_foo_baz_obj_bar = _obj['foo']['baz'] + _obj.bar
|
const _obj_foo_baz_obj_bar = _obj['foo']['baz'] + _obj.bar
|
||||||
|
|
||||||
_setProp(n0, "id", _obj_foo_baz_obj_bar)
|
_setProp(n0, "id", _obj_foo_baz_obj_bar)
|
||||||
_setProp(n1, "id", _obj_foo_baz_obj_bar)
|
_setProp(n1, "id", _obj_foo_baz_obj_bar)
|
||||||
})
|
})
|
||||||
|
@ -115,6 +113,35 @@ export function render(_ctx) {
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`cache multiple access > object property name substring cases 1`] = `
|
||||||
|
"import { setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
|
const t0 = _template("<div></div>", true)
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const n0 = t0()
|
||||||
|
_renderEffect(() => {
|
||||||
|
const _p = _ctx.p
|
||||||
|
const _p_title = _p.title
|
||||||
|
_setProp(n0, "id", _p_title + _p.titles + _p_title)
|
||||||
|
})
|
||||||
|
return n0
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`cache multiple access > optional chaining 1`] = `
|
||||||
|
"import { setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
|
const t0 = _template("<div></div>", true)
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const n0 = t0()
|
||||||
|
_renderEffect(() => {
|
||||||
|
const _obj = _ctx.obj
|
||||||
|
_setProp(n0, "id", _obj?.foo + _obj?.bar)
|
||||||
|
})
|
||||||
|
return n0
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`cache multiple access > repeated expression in expressions 1`] = `
|
exports[`cache multiple access > repeated expression in expressions 1`] = `
|
||||||
"import { setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
"import { setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
const t0 = _template("<div></div>")
|
const t0 = _template("<div></div>")
|
||||||
|
@ -126,7 +153,6 @@ export function render(_ctx) {
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _foo = _ctx.foo
|
const _foo = _ctx.foo
|
||||||
const _foo_bar = _foo + _ctx.bar
|
const _foo_bar = _foo + _ctx.bar
|
||||||
|
|
||||||
_setProp(n0, "id", _foo_bar)
|
_setProp(n0, "id", _foo_bar)
|
||||||
_setProp(n1, "id", _foo_bar)
|
_setProp(n1, "id", _foo_bar)
|
||||||
_setProp(n2, "id", _foo + _foo_bar)
|
_setProp(n2, "id", _foo + _foo_bar)
|
||||||
|
@ -144,7 +170,6 @@ export function render(_ctx) {
|
||||||
const n1 = t0()
|
const n1 = t0()
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _foo_bar = _ctx.foo + _ctx.bar
|
const _foo_bar = _ctx.foo + _ctx.bar
|
||||||
|
|
||||||
_setProp(n0, "id", _foo_bar)
|
_setProp(n0, "id", _foo_bar)
|
||||||
_setProp(n1, "id", _foo_bar)
|
_setProp(n1, "id", _foo_bar)
|
||||||
})
|
})
|
||||||
|
@ -177,7 +202,6 @@ export function render(_ctx) {
|
||||||
const n1 = t0()
|
const n1 = t0()
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
const _foo = _ctx.foo
|
const _foo = _ctx.foo
|
||||||
|
|
||||||
_setClass(n0, _foo)
|
_setClass(n0, _foo)
|
||||||
_setClass(n1, _foo)
|
_setClass(n1, _foo)
|
||||||
})
|
})
|
||||||
|
@ -185,6 +209,20 @@ export function render(_ctx) {
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`cache multiple access > variable name substring edge cases 1`] = `
|
||||||
|
"import { setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
|
const t0 = _template("<div></div>", true)
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const n0 = t0()
|
||||||
|
_renderEffect(() => {
|
||||||
|
const _title = _ctx.title
|
||||||
|
_setProp(n0, "id", _title + _ctx.titles + _title)
|
||||||
|
})
|
||||||
|
return n0
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`compiler v-bind > .attr modifier 1`] = `
|
exports[`compiler v-bind > .attr modifier 1`] = `
|
||||||
"import { setAttr as _setAttr, renderEffect as _renderEffect, template as _template } from 'vue';
|
"import { setAttr as _setAttr, renderEffect as _renderEffect, template as _template } from 'vue';
|
||||||
const t0 = _template("<div></div>", true)
|
const t0 = _template("<div></div>", true)
|
||||||
|
@ -498,15 +536,13 @@ export function render(_ctx) {
|
||||||
_setAttr(n0, "form", _ctx.form)
|
_setAttr(n0, "form", _ctx.form)
|
||||||
_setAttr(n1, "list", _ctx.list)
|
_setAttr(n1, "list", _ctx.list)
|
||||||
_setAttr(n2, "type", _ctx.type)
|
_setAttr(n2, "type", _ctx.type)
|
||||||
|
|
||||||
_setAttr(n3, "width", _width)
|
_setAttr(n3, "width", _width)
|
||||||
_setAttr(n4, "width", _width)
|
|
||||||
_setAttr(n5, "width", _width)
|
|
||||||
_setAttr(n6, "width", _width)
|
|
||||||
|
|
||||||
_setAttr(n3, "height", _height)
|
_setAttr(n3, "height", _height)
|
||||||
|
_setAttr(n4, "width", _width)
|
||||||
_setAttr(n4, "height", _height)
|
_setAttr(n4, "height", _height)
|
||||||
|
_setAttr(n5, "width", _width)
|
||||||
_setAttr(n5, "height", _height)
|
_setAttr(n5, "height", _height)
|
||||||
|
_setAttr(n6, "width", _width)
|
||||||
_setAttr(n6, "height", _height)
|
_setAttr(n6, "height", _height)
|
||||||
})
|
})
|
||||||
return [n0, n1, n2, n3, n4, n5, n6]
|
return [n0, n1, n2, n3, n4, n5, n6]
|
||||||
|
|
|
@ -123,6 +123,18 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`v-on > expression with type 1`] = `
|
||||||
|
"import { delegateEvents as _delegateEvents, template as _template } from 'vue';
|
||||||
|
const t0 = _template("<div></div>", true)
|
||||||
|
_delegateEvents("click")
|
||||||
|
|
||||||
|
export function render(_ctx, $props, $emit, $attrs, $slots) {
|
||||||
|
const n0 = t0()
|
||||||
|
n0.$evtclick = e => _ctx.handleClick(e)
|
||||||
|
return n0
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`v-on > function expression w/ prefixIdentifiers: true 1`] = `
|
exports[`v-on > function expression w/ prefixIdentifiers: true 1`] = `
|
||||||
"import { delegateEvents as _delegateEvents, template as _template } from 'vue';
|
"import { delegateEvents as _delegateEvents, template as _template } from 'vue';
|
||||||
const t0 = _template("<div></div>", true)
|
const t0 = _template("<div></div>", true)
|
||||||
|
|
|
@ -274,3 +274,68 @@ export function render(_ctx) {
|
||||||
return n6
|
return n6
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`compiler: transform slot > with whitespace: 'preserve' > implicit default slot 1`] = `
|
||||||
|
"import { resolveComponent as _resolveComponent, createComponentWithFallback as _createComponentWithFallback, template as _template } from 'vue';
|
||||||
|
const t0 = _template(" Header ")
|
||||||
|
const t1 = _template(" ")
|
||||||
|
const t2 = _template("<p></p>")
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const _component_Comp = _resolveComponent("Comp")
|
||||||
|
const n4 = _createComponentWithFallback(_component_Comp, null, {
|
||||||
|
"header": () => {
|
||||||
|
const n0 = t0()
|
||||||
|
return n0
|
||||||
|
},
|
||||||
|
"default": () => {
|
||||||
|
const n2 = t1()
|
||||||
|
const n3 = t2()
|
||||||
|
return [n2, n3]
|
||||||
|
}
|
||||||
|
}, true)
|
||||||
|
return n4
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`compiler: transform slot > with whitespace: 'preserve' > named default slot + implicit whitespace content 1`] = `
|
||||||
|
"import { resolveComponent as _resolveComponent, createComponentWithFallback as _createComponentWithFallback, template as _template } from 'vue';
|
||||||
|
const t0 = _template(" Header ")
|
||||||
|
const t1 = _template(" Default ")
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const _component_Comp = _resolveComponent("Comp")
|
||||||
|
const n5 = _createComponentWithFallback(_component_Comp, null, {
|
||||||
|
"header": () => {
|
||||||
|
const n0 = t0()
|
||||||
|
return n0
|
||||||
|
},
|
||||||
|
"default": () => {
|
||||||
|
const n3 = t1()
|
||||||
|
return n3
|
||||||
|
}
|
||||||
|
}, true)
|
||||||
|
return n5
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`compiler: transform slot > with whitespace: 'preserve' > should not generate whitespace only default slot 1`] = `
|
||||||
|
"import { resolveComponent as _resolveComponent, createComponentWithFallback as _createComponentWithFallback, template as _template } from 'vue';
|
||||||
|
const t0 = _template(" Header ")
|
||||||
|
const t1 = _template(" Footer ")
|
||||||
|
|
||||||
|
export function render(_ctx) {
|
||||||
|
const _component_Comp = _resolveComponent("Comp")
|
||||||
|
const n5 = _createComponentWithFallback(_component_Comp, null, {
|
||||||
|
"header": () => {
|
||||||
|
const n0 = t0()
|
||||||
|
return n0
|
||||||
|
},
|
||||||
|
"footer": () => {
|
||||||
|
const n3 = t1()
|
||||||
|
return n3
|
||||||
|
}
|
||||||
|
}, true)
|
||||||
|
return n5
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
transformElement,
|
transformElement,
|
||||||
transformText,
|
transformText,
|
||||||
transformVBind,
|
transformVBind,
|
||||||
|
transformVFor,
|
||||||
transformVOn,
|
transformVOn,
|
||||||
} from '../../src'
|
} from '../../src'
|
||||||
import {
|
import {
|
||||||
|
@ -15,7 +16,12 @@ import {
|
||||||
} from '@vue/compiler-dom'
|
} from '@vue/compiler-dom'
|
||||||
|
|
||||||
const compileWithElementTransform = makeCompile({
|
const compileWithElementTransform = makeCompile({
|
||||||
nodeTransforms: [transformElement, transformChildren, transformText],
|
nodeTransforms: [
|
||||||
|
transformVFor,
|
||||||
|
transformElement,
|
||||||
|
transformChildren,
|
||||||
|
transformText,
|
||||||
|
],
|
||||||
directiveTransforms: {
|
directiveTransforms: {
|
||||||
bind: transformVBind,
|
bind: transformVBind,
|
||||||
on: transformVOn,
|
on: transformVOn,
|
||||||
|
@ -170,6 +176,17 @@ describe('compiler: element transform', () => {
|
||||||
expect(code).contains('_createComponent(_ctx.Comp)')
|
expect(code).contains('_createComponent(_ctx.Comp)')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('v-for on component should not mark as single root', () => {
|
||||||
|
const { code } = compileWithElementTransform(
|
||||||
|
`<Comp v-for="item in items" :key="item"/>`,
|
||||||
|
{
|
||||||
|
bindingMetadata: { Comp: BindingTypes.SETUP_CONST },
|
||||||
|
},
|
||||||
|
)
|
||||||
|
expect(code).toMatchSnapshot()
|
||||||
|
expect(code).contains('_createComponent(_ctx.Comp)')
|
||||||
|
})
|
||||||
|
|
||||||
test('static props', () => {
|
test('static props', () => {
|
||||||
const { code, ir } = compileWithElementTransform(
|
const { code, ir } = compileWithElementTransform(
|
||||||
`<Foo id="foo" class="bar" />`,
|
`<Foo id="foo" class="bar" />`,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { BindingTypes } from '@vue/compiler-dom'
|
||||||
import {
|
import {
|
||||||
DynamicFlag,
|
DynamicFlag,
|
||||||
type ForIRNode,
|
type ForIRNode,
|
||||||
|
@ -48,6 +49,16 @@ describe('compiler: template ref transform', () => {
|
||||||
expect(code).contains('_setTemplateRef(n0, "foo")')
|
expect(code).contains('_setTemplateRef(n0, "foo")')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('static ref (inline mode)', () => {
|
||||||
|
const { code } = compileWithTransformRef(`<div ref="foo" />`, {
|
||||||
|
inline: true,
|
||||||
|
bindingMetadata: { foo: BindingTypes.SETUP_REF },
|
||||||
|
})
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
// pass the actual ref
|
||||||
|
expect(code).contains('_setTemplateRef(n0, foo)')
|
||||||
|
})
|
||||||
|
|
||||||
test('dynamic ref', () => {
|
test('dynamic ref', () => {
|
||||||
const { ir, code } = compileWithTransformRef(`<div :ref="foo" />`)
|
const { ir, code } = compileWithTransformRef(`<div :ref="foo" />`)
|
||||||
|
|
||||||
|
@ -83,7 +94,11 @@ describe('compiler: template ref transform', () => {
|
||||||
|
|
||||||
test('function ref', () => {
|
test('function ref', () => {
|
||||||
const { ir, code } = compileWithTransformRef(
|
const { ir, code } = compileWithTransformRef(
|
||||||
`<div :ref="bar => foo = bar" />`,
|
`<div :ref="bar => {
|
||||||
|
foo.value = bar
|
||||||
|
;({ baz } = bar)
|
||||||
|
console.log(foo.value, baz)
|
||||||
|
}" />`,
|
||||||
)
|
)
|
||||||
expect(ir.block.dynamic.children[0]).toMatchObject({
|
expect(ir.block.dynamic.children[0]).toMatchObject({
|
||||||
id: 0,
|
id: 0,
|
||||||
|
@ -103,7 +118,6 @@ describe('compiler: template ref transform', () => {
|
||||||
type: IRNodeTypes.SET_TEMPLATE_REF,
|
type: IRNodeTypes.SET_TEMPLATE_REF,
|
||||||
element: 0,
|
element: 0,
|
||||||
value: {
|
value: {
|
||||||
content: 'bar => foo = bar',
|
|
||||||
isStatic: false,
|
isStatic: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -112,7 +126,11 @@ describe('compiler: template ref transform', () => {
|
||||||
])
|
])
|
||||||
expect(code).toMatchSnapshot()
|
expect(code).toMatchSnapshot()
|
||||||
expect(code).contains('const _setTemplateRef = _createTemplateRefSetter()')
|
expect(code).contains('const _setTemplateRef = _createTemplateRefSetter()')
|
||||||
expect(code).contains('_setTemplateRef(n0, bar => _ctx.foo = bar, r0)')
|
expect(code).contains(`_setTemplateRef(n0, bar => {
|
||||||
|
_foo.value = bar
|
||||||
|
;({ baz: _ctx.baz } = bar)
|
||||||
|
console.log(_foo.value, _ctx.baz)
|
||||||
|
}, r0)`)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('ref + v-if', () => {
|
test('ref + v-if', () => {
|
||||||
|
|
|
@ -785,6 +785,25 @@ describe('cache multiple access', () => {
|
||||||
expect(code).contains('_setProp(n0, "id", _obj[1][_ctx.baz] + _obj.bar)')
|
expect(code).contains('_setProp(n0, "id", _obj[1][_ctx.baz] + _obj.bar)')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('variable name substring edge cases', () => {
|
||||||
|
const { code } = compileWithVBind(
|
||||||
|
`<div :id="title + titles + title"></div>`,
|
||||||
|
)
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
expect(code).contains('const _title = _ctx.title')
|
||||||
|
expect(code).contains('_setProp(n0, "id", _title + _ctx.titles + _title)')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('object property name substring cases', () => {
|
||||||
|
const { code } = compileWithVBind(
|
||||||
|
`<div :id="p.title + p.titles + p.title"></div>`,
|
||||||
|
)
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
expect(code).contains('const _p = _ctx.p')
|
||||||
|
expect(code).contains('const _p_title = _p.title')
|
||||||
|
expect(code).contains('_setProp(n0, "id", _p_title + _p.titles + _p_title)')
|
||||||
|
})
|
||||||
|
|
||||||
test('cache variable used in both property shorthand and normal binding', () => {
|
test('cache variable used in both property shorthand and normal binding', () => {
|
||||||
const { code } = compileWithVBind(`
|
const { code } = compileWithVBind(`
|
||||||
<div :style="{color}" :id="color"/>
|
<div :style="{color}" :id="color"/>
|
||||||
|
@ -794,6 +813,13 @@ describe('cache multiple access', () => {
|
||||||
expect(code).contains('_setStyle(n0, {color: _color})')
|
expect(code).contains('_setStyle(n0, {color: _color})')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('optional chaining', () => {
|
||||||
|
const { code } = compileWithVBind(`<div :id="obj?.foo + obj?.bar"></div>`)
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
expect(code).contains('const _obj = _ctx.obj')
|
||||||
|
expect(code).contains('_setProp(n0, "id", _obj?.foo + _obj?.bar)')
|
||||||
|
})
|
||||||
|
|
||||||
test('not cache variable only used in property shorthand', () => {
|
test('not cache variable only used in property shorthand', () => {
|
||||||
const { code } = compileWithVBind(`
|
const { code } = compileWithVBind(`
|
||||||
<div :style="{color}" />
|
<div :style="{color}" />
|
||||||
|
|
|
@ -682,4 +682,17 @@ describe('v-on', () => {
|
||||||
'_delegate(n0, "click", _withModifiers(e => _ctx.test(e), ["stop"]))',
|
'_delegate(n0, "click", _withModifiers(e => _ctx.test(e), ["stop"]))',
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('expression with type', () => {
|
||||||
|
const { code } = compileWithVOn(
|
||||||
|
`<div @click="(<number>handleClick as any)"></div>`,
|
||||||
|
{
|
||||||
|
bindingMetadata: {
|
||||||
|
handleClick: BindingTypes.SETUP_CONST,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
expect(code).matchSnapshot()
|
||||||
|
expect(code).include('n0.$evtclick = e => _ctx.handleClick(e)')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -509,4 +509,60 @@ describe('compiler: transform slot', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe(`with whitespace: 'preserve'`, () => {
|
||||||
|
test('named default slot + implicit whitespace content', () => {
|
||||||
|
const source = `
|
||||||
|
<Comp>
|
||||||
|
<template #header> Header </template>
|
||||||
|
<template #default> Default </template>
|
||||||
|
</Comp>
|
||||||
|
`
|
||||||
|
const { code } = compileWithSlots(source, {
|
||||||
|
whitespace: 'preserve',
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(
|
||||||
|
`Extraneous children found when component already has explicitly named default slot.`,
|
||||||
|
).not.toHaveBeenWarned()
|
||||||
|
expect(code).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('implicit default slot', () => {
|
||||||
|
const source = `
|
||||||
|
<Comp>
|
||||||
|
<template #header> Header </template>
|
||||||
|
<p/>
|
||||||
|
</Comp>
|
||||||
|
`
|
||||||
|
const { code } = compileWithSlots(source, {
|
||||||
|
whitespace: 'preserve',
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(
|
||||||
|
`Extraneous children found when component already has explicitly named default slot.`,
|
||||||
|
).not.toHaveBeenWarned()
|
||||||
|
expect(code).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('should not generate whitespace only default slot', () => {
|
||||||
|
const source = `
|
||||||
|
<Comp>
|
||||||
|
<template #header> Header </template>
|
||||||
|
<template #footer> Footer </template>
|
||||||
|
</Comp>
|
||||||
|
`
|
||||||
|
const { code, ir } = compileWithSlots(source, {
|
||||||
|
whitespace: 'preserve',
|
||||||
|
})
|
||||||
|
|
||||||
|
const slots = (ir.block.dynamic.children[0].operation as any).slots[0]
|
||||||
|
.slots
|
||||||
|
// should be: header, footer (no default)
|
||||||
|
expect(Object.keys(slots).length).toBe(2)
|
||||||
|
expect(!!slots['default']).toBe(false)
|
||||||
|
|
||||||
|
expect(code).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -81,8 +81,8 @@ export function getBaseTransformPreset(): TransformPreset {
|
||||||
transformVFor,
|
transformVFor,
|
||||||
transformSlotOutlet,
|
transformSlotOutlet,
|
||||||
transformTemplateRef,
|
transformTemplateRef,
|
||||||
transformText,
|
|
||||||
transformElement,
|
transformElement,
|
||||||
|
transformText,
|
||||||
transformVSlot,
|
transformVSlot,
|
||||||
transformComment,
|
transformComment,
|
||||||
transformChildren,
|
transformChildren,
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {
|
||||||
NewlineType,
|
NewlineType,
|
||||||
type SimpleExpressionNode,
|
type SimpleExpressionNode,
|
||||||
type SourceLocation,
|
type SourceLocation,
|
||||||
|
TS_NODE_TYPES,
|
||||||
advancePositionWithClone,
|
advancePositionWithClone,
|
||||||
createSimpleExpression,
|
createSimpleExpression,
|
||||||
isInDestructureAssignment,
|
isInDestructureAssignment,
|
||||||
|
@ -63,6 +64,7 @@ export function genExpression(
|
||||||
let hasMemberExpression = false
|
let hasMemberExpression = false
|
||||||
if (ids.length) {
|
if (ids.length) {
|
||||||
const [frag, push] = buildCodeFragment()
|
const [frag, push] = buildCodeFragment()
|
||||||
|
const isTSNode = ast && TS_NODE_TYPES.includes(ast.type)
|
||||||
ids
|
ids
|
||||||
.sort((a, b) => a.start! - b.start!)
|
.sort((a, b) => a.start! - b.start!)
|
||||||
.forEach((id, i) => {
|
.forEach((id, i) => {
|
||||||
|
@ -71,8 +73,10 @@ export function genExpression(
|
||||||
const end = id.end! - 1
|
const end = id.end! - 1
|
||||||
const last = ids[i - 1]
|
const last = ids[i - 1]
|
||||||
|
|
||||||
|
if (!(isTSNode && i === 0)) {
|
||||||
const leadingText = content.slice(last ? last.end! - 1 : 0, start)
|
const leadingText = content.slice(last ? last.end! - 1 : 0, start)
|
||||||
if (leadingText.length) push([leadingText, NewlineType.Unknown])
|
if (leadingText.length) push([leadingText, NewlineType.Unknown])
|
||||||
|
}
|
||||||
|
|
||||||
const source = content.slice(start, end)
|
const source = content.slice(start, end)
|
||||||
const parentStack = parentStackMap.get(id)!
|
const parentStack = parentStackMap.get(id)!
|
||||||
|
@ -99,7 +103,7 @@ export function genExpression(
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
if (i === ids.length - 1 && end < content.length) {
|
if (i === ids.length - 1 && end < content.length && !isTSNode) {
|
||||||
push([content.slice(end), NewlineType.Unknown])
|
push([content.slice(end), NewlineType.Unknown])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -279,7 +283,13 @@ export function processExpressions(
|
||||||
function analyzeExpressions(expressions: SimpleExpressionNode[]) {
|
function analyzeExpressions(expressions: SimpleExpressionNode[]) {
|
||||||
const seenVariable: Record<string, number> = Object.create(null)
|
const seenVariable: Record<string, number> = Object.create(null)
|
||||||
const variableToExpMap = new Map<string, Set<SimpleExpressionNode>>()
|
const variableToExpMap = new Map<string, Set<SimpleExpressionNode>>()
|
||||||
const expToVariableMap = new Map<SimpleExpressionNode, string[]>()
|
const expToVariableMap = new Map<
|
||||||
|
SimpleExpressionNode,
|
||||||
|
Array<{
|
||||||
|
name: string
|
||||||
|
loc?: { start: number; end: number }
|
||||||
|
}>
|
||||||
|
>()
|
||||||
const seenIdentifier = new Set<string>()
|
const seenIdentifier = new Set<string>()
|
||||||
const updatedVariable = new Set<string>()
|
const updatedVariable = new Set<string>()
|
||||||
|
|
||||||
|
@ -287,6 +297,7 @@ function analyzeExpressions(expressions: SimpleExpressionNode[]) {
|
||||||
name: string,
|
name: string,
|
||||||
exp: SimpleExpressionNode,
|
exp: SimpleExpressionNode,
|
||||||
isIdentifier: boolean,
|
isIdentifier: boolean,
|
||||||
|
loc?: { start: number; end: number },
|
||||||
parentStack: Node[] = [],
|
parentStack: Node[] = [],
|
||||||
) => {
|
) => {
|
||||||
if (isIdentifier) seenIdentifier.add(name)
|
if (isIdentifier) seenIdentifier.add(name)
|
||||||
|
@ -295,7 +306,11 @@ function analyzeExpressions(expressions: SimpleExpressionNode[]) {
|
||||||
name,
|
name,
|
||||||
(variableToExpMap.get(name) || new Set()).add(exp),
|
(variableToExpMap.get(name) || new Set()).add(exp),
|
||||||
)
|
)
|
||||||
expToVariableMap.set(exp, (expToVariableMap.get(exp) || []).concat(name))
|
|
||||||
|
const variables = expToVariableMap.get(exp) || []
|
||||||
|
variables.push({ name, loc })
|
||||||
|
expToVariableMap.set(exp, variables)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
parentStack.some(
|
parentStack.some(
|
||||||
p => p.type === 'UpdateExpression' || p.type === 'AssignmentExpression',
|
p => p.type === 'UpdateExpression' || p.type === 'AssignmentExpression',
|
||||||
|
@ -313,12 +328,27 @@ function analyzeExpressions(expressions: SimpleExpressionNode[]) {
|
||||||
|
|
||||||
walkIdentifiers(exp.ast, (currentNode, parent, parentStack) => {
|
walkIdentifiers(exp.ast, (currentNode, parent, parentStack) => {
|
||||||
if (parent && isMemberExpression(parent)) {
|
if (parent && isMemberExpression(parent)) {
|
||||||
const memberExp = extractMemberExpression(parent, name => {
|
const memberExp = extractMemberExpression(parent, id => {
|
||||||
registerVariable(name, exp, true)
|
registerVariable(id.name, exp, true, {
|
||||||
|
start: id.start!,
|
||||||
|
end: id.end!,
|
||||||
})
|
})
|
||||||
registerVariable(memberExp, exp, false, parentStack)
|
})
|
||||||
|
registerVariable(
|
||||||
|
memberExp,
|
||||||
|
exp,
|
||||||
|
false,
|
||||||
|
{ start: parent.start!, end: parent.end! },
|
||||||
|
parentStack,
|
||||||
|
)
|
||||||
} else if (!parentStack.some(isMemberExpression)) {
|
} else if (!parentStack.some(isMemberExpression)) {
|
||||||
registerVariable(currentNode.name, exp, true, parentStack)
|
registerVariable(
|
||||||
|
currentNode.name,
|
||||||
|
exp,
|
||||||
|
true,
|
||||||
|
{ start: currentNode.start!, end: currentNode.end! },
|
||||||
|
parentStack,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -336,11 +366,22 @@ function processRepeatedVariables(
|
||||||
context: CodegenContext,
|
context: CodegenContext,
|
||||||
seenVariable: Record<string, number>,
|
seenVariable: Record<string, number>,
|
||||||
variableToExpMap: Map<string, Set<SimpleExpressionNode>>,
|
variableToExpMap: Map<string, Set<SimpleExpressionNode>>,
|
||||||
expToVariableMap: Map<SimpleExpressionNode, string[]>,
|
expToVariableMap: Map<
|
||||||
|
SimpleExpressionNode,
|
||||||
|
Array<{ name: string; loc?: { start: number; end: number } }>
|
||||||
|
>,
|
||||||
seenIdentifier: Set<string>,
|
seenIdentifier: Set<string>,
|
||||||
updatedVariable: Set<string>,
|
updatedVariable: Set<string>,
|
||||||
): DeclarationValue[] {
|
): DeclarationValue[] {
|
||||||
const declarations: DeclarationValue[] = []
|
const declarations: DeclarationValue[] = []
|
||||||
|
const expToReplacementMap = new Map<
|
||||||
|
SimpleExpressionNode,
|
||||||
|
Array<{
|
||||||
|
name: string
|
||||||
|
locs: { start: number; end: number }[]
|
||||||
|
}>
|
||||||
|
>()
|
||||||
|
|
||||||
for (const [name, exps] of variableToExpMap) {
|
for (const [name, exps] of variableToExpMap) {
|
||||||
if (updatedVariable.has(name)) continue
|
if (updatedVariable.has(name)) continue
|
||||||
if (seenVariable[name] > 1 && exps.size > 0) {
|
if (seenVariable[name] > 1 && exps.size > 0) {
|
||||||
|
@ -352,12 +393,20 @@ function processRepeatedVariables(
|
||||||
// e.g., foo[baz] -> foo_baz.
|
// e.g., foo[baz] -> foo_baz.
|
||||||
// for identifiers, we don't need to replace the content - they will be
|
// for identifiers, we don't need to replace the content - they will be
|
||||||
// replaced during context.withId(..., ids)
|
// replaced during context.withId(..., ids)
|
||||||
const replaceRE = new RegExp(escapeRegExp(name), 'g')
|
|
||||||
exps.forEach(node => {
|
exps.forEach(node => {
|
||||||
if (node.ast) {
|
if (node.ast && varName !== name) {
|
||||||
node.content = node.content.replace(replaceRE, varName)
|
const replacements = expToReplacementMap.get(node) || []
|
||||||
// re-parse the expression
|
replacements.push({
|
||||||
node.ast = parseExp(context, node.content)
|
name: varName,
|
||||||
|
locs: expToVariableMap.get(node)!.reduce(
|
||||||
|
(locs, v) => {
|
||||||
|
if (v.name === name && v.loc) locs.push(v.loc)
|
||||||
|
return locs
|
||||||
|
},
|
||||||
|
[] as { start: number; end: number }[],
|
||||||
|
),
|
||||||
|
})
|
||||||
|
expToReplacementMap.set(node, replacements)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -380,15 +429,35 @@ function processRepeatedVariables(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const [exp, replacements] of expToReplacementMap) {
|
||||||
|
replacements
|
||||||
|
.flatMap(({ name, locs }) =>
|
||||||
|
locs.map(({ start, end }) => ({ start, end, name })),
|
||||||
|
)
|
||||||
|
.sort((a, b) => b.end - a.end)
|
||||||
|
.forEach(({ start, end, name }) => {
|
||||||
|
exp.content =
|
||||||
|
exp.content.slice(0, start - 1) + name + exp.content.slice(end - 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
// re-parse the expression
|
||||||
|
exp.ast = parseExp(context, exp.content)
|
||||||
|
}
|
||||||
|
|
||||||
return declarations
|
return declarations
|
||||||
}
|
}
|
||||||
|
|
||||||
function shouldDeclareVariable(
|
function shouldDeclareVariable(
|
||||||
name: string,
|
name: string,
|
||||||
expToVariableMap: Map<SimpleExpressionNode, string[]>,
|
expToVariableMap: Map<
|
||||||
|
SimpleExpressionNode,
|
||||||
|
Array<{ name: string; loc?: { start: number; end: number } }>
|
||||||
|
>,
|
||||||
exps: Set<SimpleExpressionNode>,
|
exps: Set<SimpleExpressionNode>,
|
||||||
): boolean {
|
): boolean {
|
||||||
const vars = Array.from(exps, exp => expToVariableMap.get(exp)!)
|
const vars = Array.from(exps, exp =>
|
||||||
|
expToVariableMap.get(exp)!.map(v => v.name),
|
||||||
|
)
|
||||||
// assume name equals to `foo`
|
// assume name equals to `foo`
|
||||||
// if each expression only references `foo`, declaration is needed
|
// if each expression only references `foo`, declaration is needed
|
||||||
// to avoid reactivity tracking
|
// to avoid reactivity tracking
|
||||||
|
@ -435,12 +504,15 @@ function processRepeatedExpressions(
|
||||||
expressions: SimpleExpressionNode[],
|
expressions: SimpleExpressionNode[],
|
||||||
varDeclarations: DeclarationValue[],
|
varDeclarations: DeclarationValue[],
|
||||||
updatedVariable: Set<string>,
|
updatedVariable: Set<string>,
|
||||||
expToVariableMap: Map<SimpleExpressionNode, string[]>,
|
expToVariableMap: Map<
|
||||||
|
SimpleExpressionNode,
|
||||||
|
Array<{ name: string; loc?: { start: number; end: number } }>
|
||||||
|
>,
|
||||||
): DeclarationValue[] {
|
): DeclarationValue[] {
|
||||||
const declarations: DeclarationValue[] = []
|
const declarations: DeclarationValue[] = []
|
||||||
const seenExp = expressions.reduce(
|
const seenExp = expressions.reduce(
|
||||||
(acc, exp) => {
|
(acc, exp) => {
|
||||||
const variables = expToVariableMap.get(exp)
|
const variables = expToVariableMap.get(exp)!.map(v => v.name)
|
||||||
// only handle expressions that are not identifiers
|
// only handle expressions that are not identifiers
|
||||||
if (
|
if (
|
||||||
exp.ast &&
|
exp.ast &&
|
||||||
|
@ -568,12 +640,12 @@ function genVarName(exp: string): string {
|
||||||
|
|
||||||
function extractMemberExpression(
|
function extractMemberExpression(
|
||||||
exp: Node,
|
exp: Node,
|
||||||
onIdentifier: (name: string) => void,
|
onIdentifier: (id: Identifier) => void,
|
||||||
): string {
|
): string {
|
||||||
if (!exp) return ''
|
if (!exp) return ''
|
||||||
switch (exp.type) {
|
switch (exp.type) {
|
||||||
case 'Identifier': // foo[bar]
|
case 'Identifier': // foo[bar]
|
||||||
onIdentifier(exp.name)
|
onIdentifier(exp)
|
||||||
return exp.name
|
return exp.name
|
||||||
case 'StringLiteral': // foo['bar']
|
case 'StringLiteral': // foo['bar']
|
||||||
return exp.extra ? (exp.extra.raw as string) : exp.value
|
return exp.extra ? (exp.extra.raw as string) : exp.value
|
||||||
|
@ -584,6 +656,7 @@ function extractMemberExpression(
|
||||||
case 'CallExpression': // foo[bar(baz)]
|
case 'CallExpression': // foo[bar(baz)]
|
||||||
return `${extractMemberExpression(exp.callee, onIdentifier)}(${exp.arguments.map(arg => extractMemberExpression(arg, onIdentifier)).join(', ')})`
|
return `${extractMemberExpression(exp.callee, onIdentifier)}(${exp.arguments.map(arg => extractMemberExpression(arg, onIdentifier)).join(', ')})`
|
||||||
case 'MemberExpression': // foo[bar.baz]
|
case 'MemberExpression': // foo[bar.baz]
|
||||||
|
case 'OptionalMemberExpression': // foo?.bar
|
||||||
const object = extractMemberExpression(exp.object, onIdentifier)
|
const object = extractMemberExpression(exp.object, onIdentifier)
|
||||||
const prop = exp.computed
|
const prop = exp.computed
|
||||||
? `[${extractMemberExpression(exp.property, onIdentifier)}]`
|
? `[${extractMemberExpression(exp.property, onIdentifier)}]`
|
||||||
|
|
|
@ -104,10 +104,8 @@ export function genEffects(
|
||||||
effects: IREffect[],
|
effects: IREffect[],
|
||||||
context: CodegenContext,
|
context: CodegenContext,
|
||||||
): CodeFragment[] {
|
): CodeFragment[] {
|
||||||
const {
|
const { helper } = context
|
||||||
helper,
|
const expressions = effects.flatMap(effect => effect.expressions)
|
||||||
block: { expressions },
|
|
||||||
} = context
|
|
||||||
const [frag, push, unshift] = buildCodeFragment()
|
const [frag, push, unshift] = buildCodeFragment()
|
||||||
let operationsCount = 0
|
let operationsCount = 0
|
||||||
const { ids, frag: declarationFrags } = processExpressions(
|
const { ids, frag: declarationFrags } = processExpressions(
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { genExpression } from './expression'
|
||||||
import type { CodegenContext } from '../generate'
|
import type { CodegenContext } from '../generate'
|
||||||
import type { DeclareOldRefIRNode, SetTemplateRefIRNode } from '../ir'
|
import type { DeclareOldRefIRNode, SetTemplateRefIRNode } from '../ir'
|
||||||
import { type CodeFragment, NEWLINE, genCall } from './utils'
|
import { type CodeFragment, NEWLINE, genCall } from './utils'
|
||||||
|
import { BindingTypes, type SimpleExpressionNode } from '@vue/compiler-dom'
|
||||||
|
|
||||||
export const setTemplateRefIdent = `_setTemplateRef`
|
export const setTemplateRefIdent = `_setTemplateRef`
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ export function genSetTemplateRef(
|
||||||
...genCall(
|
...genCall(
|
||||||
setTemplateRefIdent, // will be generated in root scope
|
setTemplateRefIdent, // will be generated in root scope
|
||||||
`n${oper.element}`,
|
`n${oper.element}`,
|
||||||
genExpression(oper.value, context),
|
genRefValue(oper.value, context),
|
||||||
oper.effect ? `r${oper.element}` : oper.refFor ? 'void 0' : undefined,
|
oper.effect ? `r${oper.element}` : oper.refFor ? 'void 0' : undefined,
|
||||||
oper.refFor && 'true',
|
oper.refFor && 'true',
|
||||||
),
|
),
|
||||||
|
@ -25,3 +26,20 @@ export function genSetTemplateRef(
|
||||||
export function genDeclareOldRef(oper: DeclareOldRefIRNode): CodeFragment[] {
|
export function genDeclareOldRef(oper: DeclareOldRefIRNode): CodeFragment[] {
|
||||||
return [NEWLINE, `let r${oper.id}`]
|
return [NEWLINE, `let r${oper.id}`]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function genRefValue(value: SimpleExpressionNode, context: CodegenContext) {
|
||||||
|
// in inline mode there is no setupState object, so we can't use string
|
||||||
|
// keys to set the ref. Instead, we need to transform it to pass the
|
||||||
|
// actual ref instead.
|
||||||
|
if (!__BROWSER__ && value && context.options.inline) {
|
||||||
|
const binding = context.options.bindingMetadata[value.content]
|
||||||
|
if (
|
||||||
|
binding === BindingTypes.SETUP_LET ||
|
||||||
|
binding === BindingTypes.SETUP_REF ||
|
||||||
|
binding === BindingTypes.SETUP_MAYBE_REF
|
||||||
|
) {
|
||||||
|
return [value.content]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return genExpression(value, context)
|
||||||
|
}
|
||||||
|
|
|
@ -52,7 +52,6 @@ export interface BlockIRNode extends BaseIRNode {
|
||||||
tempId: number
|
tempId: number
|
||||||
effect: IREffect[]
|
effect: IREffect[]
|
||||||
operation: OperationNode[]
|
operation: OperationNode[]
|
||||||
expressions: SimpleExpressionNode[]
|
|
||||||
returns: number[]
|
returns: number[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,8 +141,10 @@ export class TransformContext<T extends AllNode = AllNode> {
|
||||||
|
|
||||||
registerEffect(
|
registerEffect(
|
||||||
expressions: SimpleExpressionNode[],
|
expressions: SimpleExpressionNode[],
|
||||||
...operations: OperationNode[]
|
operation: OperationNode | OperationNode[],
|
||||||
|
getIndex = (): number => this.block.effect.length,
|
||||||
): void {
|
): void {
|
||||||
|
const operations = [operation].flat()
|
||||||
expressions = expressions.filter(exp => !isConstantExpression(exp))
|
expressions = expressions.filter(exp => !isConstantExpression(exp))
|
||||||
if (
|
if (
|
||||||
this.inVOnce ||
|
this.inVOnce ||
|
||||||
|
@ -154,28 +156,12 @@ export class TransformContext<T extends AllNode = AllNode> {
|
||||||
return this.registerOperation(...operations)
|
return this.registerOperation(...operations)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.block.expressions.push(...expressions)
|
this.block.effect.splice(getIndex(), 0, {
|
||||||
const existing = this.block.effect.find(e =>
|
|
||||||
isSameExpression(e.expressions, expressions),
|
|
||||||
)
|
|
||||||
if (existing) {
|
|
||||||
existing.operations.push(...operations)
|
|
||||||
} else {
|
|
||||||
this.block.effect.push({
|
|
||||||
expressions,
|
expressions,
|
||||||
operations,
|
operations,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSameExpression(
|
|
||||||
a: SimpleExpressionNode[],
|
|
||||||
b: SimpleExpressionNode[],
|
|
||||||
) {
|
|
||||||
if (a.length !== b.length) return false
|
|
||||||
return a.every((exp, i) => exp.content === b[i].content)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
registerOperation(...node: OperationNode[]): void {
|
registerOperation(...node: OperationNode[]): void {
|
||||||
this.block.operation.push(...node)
|
this.block.operation.push(...node)
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,8 @@ export const isReservedProp: (key: string) => boolean = /*#__PURE__*/ makeMap(
|
||||||
)
|
)
|
||||||
|
|
||||||
export const transformElement: NodeTransform = (node, context) => {
|
export const transformElement: NodeTransform = (node, context) => {
|
||||||
|
let effectIndex = context.block.effect.length
|
||||||
|
const getEffectIndex = () => effectIndex++
|
||||||
return function postTransformElement() {
|
return function postTransformElement() {
|
||||||
;({ node } = context)
|
;({ node } = context)
|
||||||
if (
|
if (
|
||||||
|
@ -62,6 +64,7 @@ export const transformElement: NodeTransform = (node, context) => {
|
||||||
context as TransformContext<ElementNode>,
|
context as TransformContext<ElementNode>,
|
||||||
isComponent,
|
isComponent,
|
||||||
isDynamicComponent,
|
isDynamicComponent,
|
||||||
|
getEffectIndex,
|
||||||
)
|
)
|
||||||
|
|
||||||
let { parent } = context
|
let { parent } = context
|
||||||
|
@ -78,13 +81,23 @@ export const transformElement: NodeTransform = (node, context) => {
|
||||||
parent.node.children.filter(child => child.type !== NodeTypes.COMMENT)
|
parent.node.children.filter(child => child.type !== NodeTypes.COMMENT)
|
||||||
.length === 1
|
.length === 1
|
||||||
|
|
||||||
;(isComponent ? transformComponentElement : transformNativeElement)(
|
if (isComponent) {
|
||||||
node as any,
|
transformComponentElement(
|
||||||
|
node as ComponentNode,
|
||||||
propsResult,
|
propsResult,
|
||||||
singleRoot,
|
singleRoot,
|
||||||
context as TransformContext<ElementNode>,
|
context,
|
||||||
isDynamicComponent,
|
isDynamicComponent,
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
transformNativeElement(
|
||||||
|
node as PlainElementNode,
|
||||||
|
propsResult,
|
||||||
|
singleRoot,
|
||||||
|
context,
|
||||||
|
getEffectIndex,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +150,7 @@ function transformComponentElement(
|
||||||
tag,
|
tag,
|
||||||
props: propsResult[0] ? propsResult[1] : [propsResult[1]],
|
props: propsResult[0] ? propsResult[1] : [propsResult[1]],
|
||||||
asset,
|
asset,
|
||||||
root: singleRoot,
|
root: singleRoot && !context.inVFor,
|
||||||
slots: [...context.slots],
|
slots: [...context.slots],
|
||||||
once: context.inVOnce,
|
once: context.inVOnce,
|
||||||
dynamic: dynamicComponent,
|
dynamic: dynamicComponent,
|
||||||
|
@ -183,7 +196,8 @@ function transformNativeElement(
|
||||||
node: PlainElementNode,
|
node: PlainElementNode,
|
||||||
propsResult: PropsResult,
|
propsResult: PropsResult,
|
||||||
singleRoot: boolean,
|
singleRoot: boolean,
|
||||||
context: TransformContext<ElementNode>,
|
context: TransformContext,
|
||||||
|
getEffectIndex: () => number,
|
||||||
) {
|
) {
|
||||||
const { tag } = node
|
const { tag } = node
|
||||||
const { scopeId } = context.options
|
const { scopeId } = context.options
|
||||||
|
@ -196,12 +210,16 @@ function transformNativeElement(
|
||||||
const dynamicProps: string[] = []
|
const dynamicProps: string[] = []
|
||||||
if (propsResult[0] /* dynamic props */) {
|
if (propsResult[0] /* dynamic props */) {
|
||||||
const [, dynamicArgs, expressions] = propsResult
|
const [, dynamicArgs, expressions] = propsResult
|
||||||
context.registerEffect(expressions, {
|
context.registerEffect(
|
||||||
|
expressions,
|
||||||
|
{
|
||||||
type: IRNodeTypes.SET_DYNAMIC_PROPS,
|
type: IRNodeTypes.SET_DYNAMIC_PROPS,
|
||||||
element: context.reference(),
|
element: context.reference(),
|
||||||
props: dynamicArgs,
|
props: dynamicArgs,
|
||||||
root: singleRoot,
|
root: singleRoot,
|
||||||
})
|
},
|
||||||
|
getEffectIndex,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
for (const prop of propsResult[1]) {
|
for (const prop of propsResult[1]) {
|
||||||
const { key, values } = prop
|
const { key, values } = prop
|
||||||
|
@ -210,13 +228,17 @@ function transformNativeElement(
|
||||||
if (values[0].content) template += `="${values[0].content}"`
|
if (values[0].content) template += `="${values[0].content}"`
|
||||||
} else {
|
} else {
|
||||||
dynamicProps.push(key.content)
|
dynamicProps.push(key.content)
|
||||||
context.registerEffect(values, {
|
context.registerEffect(
|
||||||
|
values,
|
||||||
|
{
|
||||||
type: IRNodeTypes.SET_PROP,
|
type: IRNodeTypes.SET_PROP,
|
||||||
element: context.reference(),
|
element: context.reference(),
|
||||||
prop,
|
prop,
|
||||||
root: singleRoot,
|
root: singleRoot,
|
||||||
tag,
|
tag,
|
||||||
})
|
},
|
||||||
|
getEffectIndex,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,6 +275,7 @@ export function buildProps(
|
||||||
context: TransformContext<ElementNode>,
|
context: TransformContext<ElementNode>,
|
||||||
isComponent: boolean,
|
isComponent: boolean,
|
||||||
isDynamicComponent?: boolean,
|
isDynamicComponent?: boolean,
|
||||||
|
getEffectIndex?: () => number,
|
||||||
): PropsResult {
|
): PropsResult {
|
||||||
const props = node.props as (VaporDirectiveNode | AttributeNode)[]
|
const props = node.props as (VaporDirectiveNode | AttributeNode)[]
|
||||||
if (props.length === 0) return [false, []]
|
if (props.length === 0) return [false, []]
|
||||||
|
@ -299,12 +322,12 @@ export function buildProps(
|
||||||
} else {
|
} else {
|
||||||
context.registerEffect(
|
context.registerEffect(
|
||||||
[prop.exp],
|
[prop.exp],
|
||||||
|
|
||||||
{
|
{
|
||||||
type: IRNodeTypes.SET_DYNAMIC_EVENTS,
|
type: IRNodeTypes.SET_DYNAMIC_EVENTS,
|
||||||
element: context.reference(),
|
element: context.reference(),
|
||||||
event: prop.exp,
|
event: prop.exp,
|
||||||
},
|
},
|
||||||
|
getEffectIndex,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -23,6 +23,13 @@ const seen = new WeakMap<
|
||||||
WeakSet<TemplateChildNode | RootNode>
|
WeakSet<TemplateChildNode | RootNode>
|
||||||
>()
|
>()
|
||||||
|
|
||||||
|
export function markNonTemplate(
|
||||||
|
node: TemplateChildNode,
|
||||||
|
context: TransformContext,
|
||||||
|
): void {
|
||||||
|
seen.get(context.root)!.add(node)
|
||||||
|
}
|
||||||
|
|
||||||
export const transformText: NodeTransform = (node, context) => {
|
export const transformText: NodeTransform = (node, context) => {
|
||||||
if (!seen.has(context.root)) seen.set(context.root, new WeakSet())
|
if (!seen.has(context.root)) seen.set(context.root, new WeakSet())
|
||||||
if (seen.get(context.root)!.has(node)) {
|
if (seen.get(context.root)!.has(node)) {
|
||||||
|
@ -68,7 +75,7 @@ export const transformText: NodeTransform = (node, context) => {
|
||||||
prev.type === NodeTypes.TEXT
|
prev.type === NodeTypes.TEXT
|
||||||
) {
|
) {
|
||||||
// mark leading text node for skipping
|
// mark leading text node for skipping
|
||||||
seen.get(context.root)!.add(prev)
|
markNonTemplate(prev, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +150,7 @@ function processTextContainer(
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTextLikeExpression(node: TextLike, context: TransformContext) {
|
function createTextLikeExpression(node: TextLike, context: TransformContext) {
|
||||||
seen.get(context.root)!.add(node)
|
markNonTemplate(node, context)
|
||||||
if (node.type === NodeTypes.TEXT) {
|
if (node.type === NodeTypes.TEXT) {
|
||||||
return createSimpleExpression(node.content, true, node.loc)
|
return createSimpleExpression(node.content, true, node.loc)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -29,7 +29,6 @@ export const newBlock = (node: BlockIRNode['node']): BlockIRNode => ({
|
||||||
effect: [],
|
effect: [],
|
||||||
operation: [],
|
operation: [],
|
||||||
returns: [],
|
returns: [],
|
||||||
expressions: [],
|
|
||||||
tempId: 0,
|
tempId: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import {
|
||||||
type VaporDirectiveNode,
|
type VaporDirectiveNode,
|
||||||
} from '../ir'
|
} from '../ir'
|
||||||
import { findDir, resolveExpression } from '../utils'
|
import { findDir, resolveExpression } from '../utils'
|
||||||
|
import { markNonTemplate } from './transformText'
|
||||||
|
|
||||||
export const transformVSlot: NodeTransform = (node, context) => {
|
export const transformVSlot: NodeTransform = (node, context) => {
|
||||||
if (node.type !== NodeTypes.ELEMENT) return
|
if (node.type !== NodeTypes.ELEMENT) return
|
||||||
|
@ -66,11 +67,21 @@ function transformComponentSlot(
|
||||||
) {
|
) {
|
||||||
const { children } = node
|
const { children } = node
|
||||||
const arg = dir && dir.arg
|
const arg = dir && dir.arg
|
||||||
const nonSlotTemplateChildren = children.filter(
|
|
||||||
n =>
|
// whitespace: 'preserve'
|
||||||
isNonWhitespaceContent(node) &&
|
const emptyTextNodes: TemplateChildNode[] = []
|
||||||
!(n.type === NodeTypes.ELEMENT && n.props.some(isVSlot)),
|
const nonSlotTemplateChildren = children.filter(n => {
|
||||||
)
|
if (isNonWhitespaceContent(n)) {
|
||||||
|
return !(n.type === NodeTypes.ELEMENT && n.props.some(isVSlot))
|
||||||
|
} else {
|
||||||
|
emptyTextNodes.push(n)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!nonSlotTemplateChildren.length) {
|
||||||
|
emptyTextNodes.forEach(n => {
|
||||||
|
markNonTemplate(n, context)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const [block, onExit] = createSlotBlock(node, dir, context)
|
const [block, onExit] = createSlotBlock(node, dir, context)
|
||||||
|
|
||||||
|
|
|
@ -557,3 +557,7 @@ export { startMeasure, endMeasure } from './profiling'
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export { initFeatureFlags } from './featureFlags'
|
export { initFeatureFlags } from './featureFlags'
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
export { createInternalObject } from './internalObject'
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
import { shallowRef } from '@vue/reactivity'
|
import { ref, shallowRef } from '@vue/reactivity'
|
||||||
import { nextTick } from '@vue/runtime-dom'
|
import { nextTick, resolveDynamicComponent } from '@vue/runtime-dom'
|
||||||
import { createDynamicComponent } from '../src'
|
import {
|
||||||
|
createComponentWithFallback,
|
||||||
|
createDynamicComponent,
|
||||||
|
defineVaporComponent,
|
||||||
|
renderEffect,
|
||||||
|
setHtml,
|
||||||
|
setInsertionState,
|
||||||
|
template,
|
||||||
|
} from '../src'
|
||||||
import { makeRender } from './_utils'
|
import { makeRender } from './_utils'
|
||||||
|
|
||||||
const define = makeRender()
|
const define = makeRender()
|
||||||
|
@ -54,4 +62,52 @@ describe('api: createDynamicComponent', () => {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
expect(html()).toBe('<baz></baz><!--dynamic-component-->')
|
expect(html()).toBe('<baz></baz><!--dynamic-component-->')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('render fallback with insertionState', async () => {
|
||||||
|
const { html, mount } = define({
|
||||||
|
setup() {
|
||||||
|
const html = ref('hi')
|
||||||
|
const n1 = template('<div></div>', true)() as any
|
||||||
|
setInsertionState(n1)
|
||||||
|
const n0 = createComponentWithFallback(
|
||||||
|
resolveDynamicComponent('button') as any,
|
||||||
|
) as any
|
||||||
|
renderEffect(() => setHtml(n0, html.value))
|
||||||
|
return n1
|
||||||
|
},
|
||||||
|
}).create()
|
||||||
|
|
||||||
|
mount()
|
||||||
|
expect(html()).toBe('<div><button>hi</button></div>')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('switch dynamic component children', async () => {
|
||||||
|
const CompA = defineVaporComponent({
|
||||||
|
setup() {
|
||||||
|
return template('<div>A</div>')()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const CompB = defineVaporComponent({
|
||||||
|
setup() {
|
||||||
|
return template('<div>B</div>')()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const current = shallowRef(CompA)
|
||||||
|
const { html } = define({
|
||||||
|
setup() {
|
||||||
|
const t1 = template('<div></div>')
|
||||||
|
const n2 = t1() as any
|
||||||
|
setInsertionState(n2)
|
||||||
|
createDynamicComponent(() => current.value)
|
||||||
|
return n2
|
||||||
|
},
|
||||||
|
}).render()
|
||||||
|
|
||||||
|
expect(html()).toBe('<div><div>A</div><!--dynamic-component--></div>')
|
||||||
|
|
||||||
|
current.value = CompB
|
||||||
|
await nextTick()
|
||||||
|
expect(html()).toBe('<div><div>B</div><!--dynamic-component--></div>')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
import { type Ref, nextTick, ref } from '@vue/runtime-dom'
|
import {
|
||||||
|
type Ref,
|
||||||
|
createApp,
|
||||||
|
defineComponent,
|
||||||
|
h,
|
||||||
|
nextTick,
|
||||||
|
ref,
|
||||||
|
} from '@vue/runtime-dom'
|
||||||
import {
|
import {
|
||||||
createComponent,
|
createComponent,
|
||||||
|
createDynamicComponent,
|
||||||
|
createSlot,
|
||||||
defineVaporComponent,
|
defineVaporComponent,
|
||||||
renderEffect,
|
renderEffect,
|
||||||
setClass,
|
setClass,
|
||||||
|
@ -8,6 +17,7 @@ import {
|
||||||
setProp,
|
setProp,
|
||||||
setStyle,
|
setStyle,
|
||||||
template,
|
template,
|
||||||
|
vaporInteropPlugin,
|
||||||
} from '../src'
|
} from '../src'
|
||||||
import { makeRender } from './_utils'
|
import { makeRender } from './_utils'
|
||||||
import { stringifyStyle } from '@vue/shared'
|
import { stringifyStyle } from '@vue/shared'
|
||||||
|
@ -277,7 +287,43 @@ describe('attribute fallthrough', () => {
|
||||||
expect(getCSS()).not.toContain('font-size:bold')
|
expect(getCSS()).not.toContain('font-size:bold')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('parent value should take priority', async () => {
|
it('should fallthrough attrs to dynamic component', async () => {
|
||||||
|
const Comp = defineVaporComponent({
|
||||||
|
setup() {
|
||||||
|
const n1 = createDynamicComponent(
|
||||||
|
() => 'button',
|
||||||
|
null,
|
||||||
|
{
|
||||||
|
default: () => {
|
||||||
|
const n0 = createSlot('default', null)
|
||||||
|
return n0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
return n1
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const { html } = define({
|
||||||
|
setup() {
|
||||||
|
return createComponent(
|
||||||
|
Comp,
|
||||||
|
{
|
||||||
|
class: () => 'foo',
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
}).render()
|
||||||
|
|
||||||
|
expect(html()).toBe(
|
||||||
|
'<button class="foo"><!--slot--></button><!--dynamic-component-->',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('parent value should take priority', async () => {
|
||||||
const parentVal = ref('parent')
|
const parentVal = ref('parent')
|
||||||
const childVal = ref('child')
|
const childVal = ref('child')
|
||||||
|
|
||||||
|
@ -361,4 +407,42 @@ describe('attribute fallthrough', () => {
|
||||||
const el = host.children[0]
|
const el = host.children[0]
|
||||||
expect(el.classList.length).toBe(0)
|
expect(el.classList.length).toBe(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should not fallthrough emit handlers to vdom child', () => {
|
||||||
|
const VDomChild = defineComponent({
|
||||||
|
emits: ['click'],
|
||||||
|
setup(_, { emit }) {
|
||||||
|
return () => h('button', { onClick: () => emit('click') }, 'click me')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const fn = vi.fn()
|
||||||
|
const VaporChild = defineVaporComponent({
|
||||||
|
emits: ['click'],
|
||||||
|
setup() {
|
||||||
|
return createComponent(
|
||||||
|
VDomChild as any,
|
||||||
|
{ onClick: () => fn },
|
||||||
|
null,
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const App = {
|
||||||
|
setup() {
|
||||||
|
return () => h(VaporChild as any)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const root = document.createElement('div')
|
||||||
|
createApp(App).use(vaporInteropPlugin).mount(root)
|
||||||
|
|
||||||
|
expect(root.innerHTML).toBe('<button>click me</button>')
|
||||||
|
const button = root.querySelector('button')!
|
||||||
|
button.dispatchEvent(new Event('click'))
|
||||||
|
|
||||||
|
// fn should be called once
|
||||||
|
expect(fn).toHaveBeenCalledTimes(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -497,6 +497,36 @@ describe('component: props', () => {
|
||||||
expect(changeSpy).toHaveBeenCalledTimes(1)
|
expect(changeSpy).toHaveBeenCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('should not warn invalid watch source when directly watching props', async () => {
|
||||||
|
const changeSpy = vi.fn()
|
||||||
|
const { render, html } = define({
|
||||||
|
props: {
|
||||||
|
foo: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup(props: any) {
|
||||||
|
watch(props, changeSpy)
|
||||||
|
const t0 = template('<h1></h1>')
|
||||||
|
const n0 = t0()
|
||||||
|
renderEffect(() => {
|
||||||
|
setElementText(n0, String(props.foo))
|
||||||
|
})
|
||||||
|
return n0
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const foo = ref('foo')
|
||||||
|
render({ foo: () => foo.value })
|
||||||
|
expect(html()).toBe(`<h1>foo</h1>`)
|
||||||
|
expect('Invalid watch source').not.toHaveBeenWarned()
|
||||||
|
|
||||||
|
foo.value = 'bar'
|
||||||
|
await nextTick()
|
||||||
|
expect(html()).toBe(`<h1>bar</h1>`)
|
||||||
|
expect(changeSpy).toHaveBeenCalledTimes(1)
|
||||||
|
})
|
||||||
|
|
||||||
test('support null in required + multiple-type declarations', () => {
|
test('support null in required + multiple-type declarations', () => {
|
||||||
const { render } = define({
|
const { render } = define({
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
import { resolveDynamicComponent } from '@vue/runtime-dom'
|
import { resolveDynamicComponent } from '@vue/runtime-dom'
|
||||||
import { DynamicFragment, type VaporFragment } from './block'
|
import { DynamicFragment, type VaporFragment, insert } from './block'
|
||||||
import { createComponentWithFallback } from './component'
|
import { createComponentWithFallback } from './component'
|
||||||
import { renderEffect } from './renderEffect'
|
import { renderEffect } from './renderEffect'
|
||||||
import type { RawProps } from './componentProps'
|
import type { RawProps } from './componentProps'
|
||||||
import type { RawSlots } from './componentSlots'
|
import type { RawSlots } from './componentSlots'
|
||||||
|
import {
|
||||||
|
insertionAnchor,
|
||||||
|
insertionParent,
|
||||||
|
resetInsertionState,
|
||||||
|
} from './insertionState'
|
||||||
|
import { isHydrating, locateHydrationNode } from './dom/hydration'
|
||||||
|
|
||||||
export function createDynamicComponent(
|
export function createDynamicComponent(
|
||||||
getter: () => any,
|
getter: () => any,
|
||||||
|
@ -11,9 +17,18 @@ export function createDynamicComponent(
|
||||||
rawSlots?: RawSlots | null,
|
rawSlots?: RawSlots | null,
|
||||||
isSingleRoot?: boolean,
|
isSingleRoot?: boolean,
|
||||||
): VaporFragment {
|
): VaporFragment {
|
||||||
|
const _insertionParent = insertionParent
|
||||||
|
const _insertionAnchor = insertionAnchor
|
||||||
|
if (isHydrating) {
|
||||||
|
locateHydrationNode()
|
||||||
|
} else {
|
||||||
|
resetInsertionState()
|
||||||
|
}
|
||||||
|
|
||||||
const frag = __DEV__
|
const frag = __DEV__
|
||||||
? new DynamicFragment('dynamic-component')
|
? new DynamicFragment('dynamic-component')
|
||||||
: new DynamicFragment()
|
: new DynamicFragment()
|
||||||
|
|
||||||
renderEffect(() => {
|
renderEffect(() => {
|
||||||
const value = getter()
|
const value = getter()
|
||||||
frag.update(
|
frag.update(
|
||||||
|
@ -27,5 +42,10 @@ export function createDynamicComponent(
|
||||||
value,
|
value,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!isHydrating && _insertionParent) {
|
||||||
|
insert(frag, _insertionParent, _insertionAnchor)
|
||||||
|
}
|
||||||
|
|
||||||
return frag
|
return frag
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
startMeasure,
|
startMeasure,
|
||||||
unregisterHMR,
|
unregisterHMR,
|
||||||
} from '@vue/runtime-dom'
|
} from '@vue/runtime-dom'
|
||||||
import { type Block, insert, remove } from './block'
|
import { type Block, DynamicFragment, insert, remove } from './block'
|
||||||
import {
|
import {
|
||||||
type ShallowRef,
|
type ShallowRef,
|
||||||
markRaw,
|
markRaw,
|
||||||
|
@ -250,15 +250,17 @@ export function createComponent(
|
||||||
if (
|
if (
|
||||||
instance.hasFallthrough &&
|
instance.hasFallthrough &&
|
||||||
component.inheritAttrs !== false &&
|
component.inheritAttrs !== false &&
|
||||||
instance.block instanceof Element &&
|
|
||||||
Object.keys(instance.attrs).length
|
Object.keys(instance.attrs).length
|
||||||
) {
|
) {
|
||||||
|
const el = getRootElement(instance)
|
||||||
|
if (el) {
|
||||||
renderEffect(() => {
|
renderEffect(() => {
|
||||||
isApplyingFallthroughProps = true
|
isApplyingFallthroughProps = true
|
||||||
setDynamicProps(instance.block as Element, [instance.attrs])
|
setDynamicProps(el, [instance.attrs])
|
||||||
isApplyingFallthroughProps = false
|
isApplyingFallthroughProps = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resetTracking()
|
resetTracking()
|
||||||
simpleSetCurrentInstance(prev, instance)
|
simpleSetCurrentInstance(prev, instance)
|
||||||
|
@ -486,6 +488,14 @@ export function createComponentWithFallback(
|
||||||
return createComponent(comp, rawProps, rawSlots, isSingleRoot)
|
return createComponent(comp, rawProps, rawSlots, isSingleRoot)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const _insertionParent = insertionParent
|
||||||
|
const _insertionAnchor = insertionAnchor
|
||||||
|
if (isHydrating) {
|
||||||
|
locateHydrationNode()
|
||||||
|
} else {
|
||||||
|
resetInsertionState()
|
||||||
|
}
|
||||||
|
|
||||||
const el = document.createElement(comp)
|
const el = document.createElement(comp)
|
||||||
// mark single root
|
// mark single root
|
||||||
;(el as any).$root = isSingleRoot
|
;(el as any).$root = isSingleRoot
|
||||||
|
@ -504,6 +514,10 @@ export function createComponentWithFallback(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isHydrating && _insertionParent) {
|
||||||
|
insert(el, _insertionParent, _insertionAnchor)
|
||||||
|
}
|
||||||
|
|
||||||
return el
|
return el
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,3 +575,18 @@ export function getExposed(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRootElement({
|
||||||
|
block,
|
||||||
|
}: VaporComponentInstance): Element | undefined {
|
||||||
|
if (block instanceof Element) {
|
||||||
|
return block
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block instanceof DynamicFragment) {
|
||||||
|
const { nodes } = block
|
||||||
|
if (nodes instanceof Element && (nodes as any).$root) {
|
||||||
|
return nodes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import {
|
||||||
validateProps,
|
validateProps,
|
||||||
warn,
|
warn,
|
||||||
} from '@vue/runtime-dom'
|
} from '@vue/runtime-dom'
|
||||||
|
import { ReactiveFlags } from '@vue/reactivity'
|
||||||
import { normalizeEmitsOptions } from './componentEmits'
|
import { normalizeEmitsOptions } from './componentEmits'
|
||||||
import { renderEffect } from './renderEffect'
|
import { renderEffect } from './renderEffect'
|
||||||
|
|
||||||
|
@ -63,6 +64,9 @@ export function getPropsProxyHandlers(
|
||||||
: YES
|
: YES
|
||||||
|
|
||||||
const getProp = (instance: VaporComponentInstance, key: string | symbol) => {
|
const getProp = (instance: VaporComponentInstance, key: string | symbol) => {
|
||||||
|
// this enables direct watching of props and prevents `Invalid watch source` DEV warnings.
|
||||||
|
if (key === ReactiveFlags.IS_REACTIVE) return true
|
||||||
|
|
||||||
if (!isProp(key)) return
|
if (!isProp(key)) return
|
||||||
const rawProps = instance.rawProps
|
const rawProps = instance.rawProps
|
||||||
const dynamicSources = rawProps.$
|
const dynamicSources = rawProps.$
|
||||||
|
@ -210,7 +214,8 @@ export function hasAttrFromRawProps(rawProps: RawProps, key: string): boolean {
|
||||||
if (dynamicSources) {
|
if (dynamicSources) {
|
||||||
let i = dynamicSources.length
|
let i = dynamicSources.length
|
||||||
while (i--) {
|
while (i--) {
|
||||||
if (hasOwn(resolveSource(dynamicSources[i]), key)) {
|
const source = resolveSource(dynamicSources[i])
|
||||||
|
if (source && hasOwn(source, key)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,14 @@ import {
|
||||||
type Slots,
|
type Slots,
|
||||||
type VNode,
|
type VNode,
|
||||||
type VaporInteropInterface,
|
type VaporInteropInterface,
|
||||||
|
createInternalObject,
|
||||||
createVNode,
|
createVNode,
|
||||||
currentInstance,
|
currentInstance,
|
||||||
ensureRenderer,
|
ensureRenderer,
|
||||||
|
isEmitListener,
|
||||||
onScopeDispose,
|
onScopeDispose,
|
||||||
renderSlot,
|
renderSlot,
|
||||||
|
shallowReactive,
|
||||||
shallowRef,
|
shallowRef,
|
||||||
simpleSetCurrentInstance,
|
simpleSetCurrentInstance,
|
||||||
} from '@vue/runtime-dom'
|
} from '@vue/runtime-dom'
|
||||||
|
@ -161,8 +164,16 @@ function createVDOMComponent(
|
||||||
|
|
||||||
// overwrite how the vdom instance handles props
|
// overwrite how the vdom instance handles props
|
||||||
vnode.vi = (instance: ComponentInternalInstance) => {
|
vnode.vi = (instance: ComponentInternalInstance) => {
|
||||||
instance.props = wrapper.props
|
// ensure props are shallow reactive to align with VDOM behavior.
|
||||||
instance.attrs = wrapper.attrs
|
instance.props = shallowReactive(wrapper.props)
|
||||||
|
|
||||||
|
const attrs = (instance.attrs = createInternalObject())
|
||||||
|
for (const key in wrapper.attrs) {
|
||||||
|
if (!isEmitListener(instance.emitsOptions, key)) {
|
||||||
|
attrs[key] = wrapper.attrs[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
instance.slots =
|
instance.slots =
|
||||||
wrapper.slots === EMPTY_OBJ
|
wrapper.slots === EMPTY_OBJ
|
||||||
? EMPTY_OBJ
|
? EMPTY_OBJ
|
||||||
|
|
341
pnpm-lock.yaml
341
pnpm-lock.yaml
|
@ -40,22 +40,22 @@ importers:
|
||||||
version: 7.27.6
|
version: 7.27.6
|
||||||
'@rollup/plugin-alias':
|
'@rollup/plugin-alias':
|
||||||
specifier: ^5.1.1
|
specifier: ^5.1.1
|
||||||
version: 5.1.1(rollup@4.43.0)
|
version: 5.1.1(rollup@4.44.0)
|
||||||
'@rollup/plugin-commonjs':
|
'@rollup/plugin-commonjs':
|
||||||
specifier: ^28.0.3
|
specifier: ^28.0.3
|
||||||
version: 28.0.6(rollup@4.43.0)
|
version: 28.0.6(rollup@4.44.0)
|
||||||
'@rollup/plugin-json':
|
'@rollup/plugin-json':
|
||||||
specifier: ^6.1.0
|
specifier: ^6.1.0
|
||||||
version: 6.1.0(rollup@4.43.0)
|
version: 6.1.0(rollup@4.44.0)
|
||||||
'@rollup/plugin-node-resolve':
|
'@rollup/plugin-node-resolve':
|
||||||
specifier: ^16.0.1
|
specifier: ^16.0.1
|
||||||
version: 16.0.1(rollup@4.43.0)
|
version: 16.0.1(rollup@4.44.0)
|
||||||
'@rollup/plugin-replace':
|
'@rollup/plugin-replace':
|
||||||
specifier: 5.0.4
|
specifier: 5.0.4
|
||||||
version: 5.0.4(rollup@4.43.0)
|
version: 5.0.4(rollup@4.44.0)
|
||||||
'@swc/core':
|
'@swc/core':
|
||||||
specifier: ^1.11.24
|
specifier: ^1.11.24
|
||||||
version: 1.12.1
|
version: 1.12.4
|
||||||
'@types/hash-sum':
|
'@types/hash-sum':
|
||||||
specifier: ^1.0.2
|
specifier: ^1.0.2
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
|
@ -142,16 +142,16 @@ importers:
|
||||||
version: 6.0.1
|
version: 6.0.1
|
||||||
rollup:
|
rollup:
|
||||||
specifier: ^4.40.2
|
specifier: ^4.40.2
|
||||||
version: 4.43.0
|
version: 4.44.0
|
||||||
rollup-plugin-dts:
|
rollup-plugin-dts:
|
||||||
specifier: ^6.2.1
|
specifier: ^6.2.1
|
||||||
version: 6.2.1(rollup@4.43.0)(typescript@5.6.3)
|
version: 6.2.1(rollup@4.44.0)(typescript@5.6.3)
|
||||||
rollup-plugin-esbuild:
|
rollup-plugin-esbuild:
|
||||||
specifier: ^6.2.1
|
specifier: ^6.2.1
|
||||||
version: 6.2.1(esbuild@0.25.5)(rollup@4.43.0)
|
version: 6.2.1(esbuild@0.25.5)(rollup@4.44.0)
|
||||||
rollup-plugin-polyfill-node:
|
rollup-plugin-polyfill-node:
|
||||||
specifier: ^0.13.0
|
specifier: ^0.13.0
|
||||||
version: 0.13.0(rollup@4.43.0)
|
version: 0.13.0(rollup@4.44.0)
|
||||||
semver:
|
semver:
|
||||||
specifier: ^7.7.1
|
specifier: ^7.7.1
|
||||||
version: 7.7.2
|
version: 7.7.2
|
||||||
|
@ -246,7 +246,7 @@ importers:
|
||||||
version: 0.4.1(@types/node@22.15.32)(sass@1.89.2)(vite@6.3.5(@types/node@22.15.32)(sass@1.89.2)(yaml@2.8.0))
|
version: 0.4.1(@types/node@22.15.32)(sass@1.89.2)(vite@6.3.5(@types/node@22.15.32)(sass@1.89.2)(yaml@2.8.0))
|
||||||
vite-plugin-inspect:
|
vite-plugin-inspect:
|
||||||
specifier: ^0.8.7
|
specifier: ^0.8.7
|
||||||
version: 0.8.9(rollup@4.43.0)(vite@6.3.5(@types/node@22.15.32)(sass@1.89.2)(yaml@2.8.0))
|
version: 0.8.9(rollup@4.44.0)(vite@6.3.5(@types/node@22.15.32)(sass@1.89.2)(yaml@2.8.0))
|
||||||
|
|
||||||
packages-private/sfc-playground:
|
packages-private/sfc-playground:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -1188,168 +1188,168 @@ packages:
|
||||||
rollup:
|
rollup:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-android-arm-eabi@4.43.0':
|
'@rollup/rollup-android-arm-eabi@4.44.0':
|
||||||
resolution: {integrity: sha512-Krjy9awJl6rKbruhQDgivNbD1WuLb8xAclM4IR4cN5pHGAs2oIMMQJEiC3IC/9TZJ+QZkmZhlMO/6MBGxPidpw==}
|
resolution: {integrity: sha512-xEiEE5oDW6tK4jXCAyliuntGR+amEMO7HLtdSshVuhFnKTYoeYMyXQK7pLouAJJj5KHdwdn87bfHAR2nSdNAUA==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [android]
|
os: [android]
|
||||||
|
|
||||||
'@rollup/rollup-android-arm64@4.43.0':
|
'@rollup/rollup-android-arm64@4.44.0':
|
||||||
resolution: {integrity: sha512-ss4YJwRt5I63454Rpj+mXCXicakdFmKnUNxr1dLK+5rv5FJgAxnN7s31a5VchRYxCFWdmnDWKd0wbAdTr0J5EA==}
|
resolution: {integrity: sha512-uNSk/TgvMbskcHxXYHzqwiyBlJ/lGcv8DaUfcnNwict8ba9GTTNxfn3/FAoFZYgkaXXAdrAA+SLyKplyi349Jw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [android]
|
os: [android]
|
||||||
|
|
||||||
'@rollup/rollup-darwin-arm64@4.43.0':
|
'@rollup/rollup-darwin-arm64@4.44.0':
|
||||||
resolution: {integrity: sha512-eKoL8ykZ7zz8MjgBenEF2OoTNFAPFz1/lyJ5UmmFSz5jW+7XbH1+MAgCVHy72aG59rbuQLcJeiMrP8qP5d/N0A==}
|
resolution: {integrity: sha512-VGF3wy0Eq1gcEIkSCr8Ke03CWT+Pm2yveKLaDvq51pPpZza3JX/ClxXOCmTYYq3us5MvEuNRTaeyFThCKRQhOA==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@rollup/rollup-darwin-x64@4.43.0':
|
'@rollup/rollup-darwin-x64@4.44.0':
|
||||||
resolution: {integrity: sha512-SYwXJgaBYW33Wi/q4ubN+ldWC4DzQY62S4Ll2dgfr/dbPoF50dlQwEaEHSKrQdSjC6oIe1WgzosoaNoHCdNuMg==}
|
resolution: {integrity: sha512-fBkyrDhwquRvrTxSGH/qqt3/T0w5Rg0L7ZIDypvBPc1/gzjJle6acCpZ36blwuwcKD/u6oCE/sRWlUAcxLWQbQ==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@rollup/rollup-freebsd-arm64@4.43.0':
|
'@rollup/rollup-freebsd-arm64@4.44.0':
|
||||||
resolution: {integrity: sha512-SV+U5sSo0yujrjzBF7/YidieK2iF6E7MdF6EbYxNz94lA+R0wKl3SiixGyG/9Klab6uNBIqsN7j4Y/Fya7wAjQ==}
|
resolution: {integrity: sha512-u5AZzdQJYJXByB8giQ+r4VyfZP+walV+xHWdaFx/1VxsOn6eWJhK2Vl2eElvDJFKQBo/hcYIBg/jaKS8ZmKeNQ==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
|
|
||||||
'@rollup/rollup-freebsd-x64@4.43.0':
|
'@rollup/rollup-freebsd-x64@4.44.0':
|
||||||
resolution: {integrity: sha512-J7uCsiV13L/VOeHJBo5SjasKiGxJ0g+nQTrBkAsmQBIdil3KhPnSE9GnRon4ejX1XDdsmK/l30IYLiAaQEO0Cg==}
|
resolution: {integrity: sha512-qC0kS48c/s3EtdArkimctY7h3nHicQeEUdjJzYVJYR3ct3kWSafmn6jkNCA8InbUdge6PVx6keqjk5lVGJf99g==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-gnueabihf@4.43.0':
|
'@rollup/rollup-linux-arm-gnueabihf@4.44.0':
|
||||||
resolution: {integrity: sha512-gTJ/JnnjCMc15uwB10TTATBEhK9meBIY+gXP4s0sHD1zHOaIh4Dmy1X9wup18IiY9tTNk5gJc4yx9ctj/fjrIw==}
|
resolution: {integrity: sha512-x+e/Z9H0RAWckn4V2OZZl6EmV0L2diuX3QB0uM1r6BvhUIv6xBPL5mrAX2E3e8N8rEHVPwFfz/ETUbV4oW9+lQ==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-musleabihf@4.43.0':
|
'@rollup/rollup-linux-arm-musleabihf@4.44.0':
|
||||||
resolution: {integrity: sha512-ZJ3gZynL1LDSIvRfz0qXtTNs56n5DI2Mq+WACWZ7yGHFUEirHBRt7fyIk0NsCKhmRhn7WAcjgSkSVVxKlPNFFw==}
|
resolution: {integrity: sha512-1exwiBFf4PU/8HvI8s80icyCcnAIB86MCBdst51fwFmH5dyeoWVPVgmQPcKrMtBQ0W5pAs7jBCWuRXgEpRzSCg==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-gnu@4.43.0':
|
'@rollup/rollup-linux-arm64-gnu@4.44.0':
|
||||||
resolution: {integrity: sha512-8FnkipasmOOSSlfucGYEu58U8cxEdhziKjPD2FIa0ONVMxvl/hmONtX/7y4vGjdUhjcTHlKlDhw3H9t98fPvyA==}
|
resolution: {integrity: sha512-ZTR2mxBHb4tK4wGf9b8SYg0Y6KQPjGpR4UWwTFdnmjB4qRtoATZ5dWn3KsDwGa5Z2ZBOE7K52L36J9LueKBdOQ==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-musl@4.43.0':
|
'@rollup/rollup-linux-arm64-musl@4.44.0':
|
||||||
resolution: {integrity: sha512-KPPyAdlcIZ6S9C3S2cndXDkV0Bb1OSMsX0Eelr2Bay4EsF9yi9u9uzc9RniK3mcUGCLhWY9oLr6er80P5DE6XA==}
|
resolution: {integrity: sha512-GFWfAhVhWGd4r6UxmnKRTBwP1qmModHtd5gkraeW2G490BpFOZkFtem8yuX2NyafIP/mGpRJgTJ2PwohQkUY/Q==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-loongarch64-gnu@4.43.0':
|
'@rollup/rollup-linux-loongarch64-gnu@4.44.0':
|
||||||
resolution: {integrity: sha512-HPGDIH0/ZzAZjvtlXj6g+KDQ9ZMHfSP553za7o2Odegb/BEfwJcR0Sw0RLNpQ9nC6Gy8s+3mSS9xjZ0n3rhcYg==}
|
resolution: {integrity: sha512-xw+FTGcov/ejdusVOqKgMGW3c4+AgqrfvzWEVXcNP6zq2ue+lsYUgJ+5Rtn/OTJf7e2CbgTFvzLW2j0YAtj0Gg==}
|
||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-powerpc64le-gnu@4.43.0':
|
'@rollup/rollup-linux-powerpc64le-gnu@4.44.0':
|
||||||
resolution: {integrity: sha512-gEmwbOws4U4GLAJDhhtSPWPXUzDfMRedT3hFMyRAvM9Mrnj+dJIFIeL7otsv2WF3D7GrV0GIewW0y28dOYWkmw==}
|
resolution: {integrity: sha512-bKGibTr9IdF0zr21kMvkZT4K6NV+jjRnBoVMt2uNMG0BYWm3qOVmYnXKzx7UhwrviKnmK46IKMByMgvpdQlyJQ==}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-gnu@4.43.0':
|
'@rollup/rollup-linux-riscv64-gnu@4.44.0':
|
||||||
resolution: {integrity: sha512-XXKvo2e+wFtXZF/9xoWohHg+MuRnvO29TI5Hqe9xwN5uN8NKUYy7tXUG3EZAlfchufNCTHNGjEx7uN78KsBo0g==}
|
resolution: {integrity: sha512-vV3cL48U5kDaKZtXrti12YRa7TyxgKAIDoYdqSIOMOFBXqFj2XbChHAtXquEn2+n78ciFgr4KIqEbydEGPxXgA==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-musl@4.43.0':
|
'@rollup/rollup-linux-riscv64-musl@4.44.0':
|
||||||
resolution: {integrity: sha512-ruf3hPWhjw6uDFsOAzmbNIvlXFXlBQ4nk57Sec8E8rUxs/AI4HD6xmiiasOOx/3QxS2f5eQMKTAwk7KHwpzr/Q==}
|
resolution: {integrity: sha512-TDKO8KlHJuvTEdfw5YYFBjhFts2TR0VpZsnLLSYmB7AaohJhM8ctDSdDnUGq77hUh4m/djRafw+9zQpkOanE2Q==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-s390x-gnu@4.43.0':
|
'@rollup/rollup-linux-s390x-gnu@4.44.0':
|
||||||
resolution: {integrity: sha512-QmNIAqDiEMEvFV15rsSnjoSmO0+eJLoKRD9EAa9rrYNwO/XRCtOGM3A5A0X+wmG+XRrw9Fxdsw+LnyYiZWWcVw==}
|
resolution: {integrity: sha512-8541GEyktXaw4lvnGp9m84KENcxInhAt6vPWJ9RodsB/iGjHoMB2Pp5MVBCiKIRxrxzJhGCxmNzdu+oDQ7kwRA==}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-gnu@4.43.0':
|
'@rollup/rollup-linux-x64-gnu@4.44.0':
|
||||||
resolution: {integrity: sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==}
|
resolution: {integrity: sha512-iUVJc3c0o8l9Sa/qlDL2Z9UP92UZZW1+EmQ4xfjTc1akr0iUFZNfxrXJ/R1T90h/ILm9iXEY6+iPrmYB3pXKjw==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-musl@4.43.0':
|
'@rollup/rollup-linux-x64-musl@4.44.0':
|
||||||
resolution: {integrity: sha512-3yATWgdeXyuHtBhrLt98w+5fKurdqvs8B53LaoKD7P7H7FKOONLsBVMNl9ghPQZQuYcceV5CDyPfyfGpMWD9mQ==}
|
resolution: {integrity: sha512-PQUobbhLTQT5yz/SPg116VJBgz+XOtXt8D1ck+sfJJhuEsMj2jSej5yTdp8CvWBSceu+WW+ibVL6dm0ptG5fcA==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rollup/rollup-win32-arm64-msvc@4.43.0':
|
'@rollup/rollup-win32-arm64-msvc@4.44.0':
|
||||||
resolution: {integrity: sha512-wVzXp2qDSCOpcBCT5WRWLmpJRIzv23valvcTwMHEobkjippNf+C3ys/+wf07poPkeNix0paTNemB2XrHr2TnGw==}
|
resolution: {integrity: sha512-M0CpcHf8TWn+4oTxJfh7LQuTuaYeXGbk0eageVjQCKzYLsajWS/lFC94qlRqOlyC2KvRT90ZrfXULYmukeIy7w==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@rollup/rollup-win32-ia32-msvc@4.43.0':
|
'@rollup/rollup-win32-ia32-msvc@4.44.0':
|
||||||
resolution: {integrity: sha512-fYCTEyzf8d+7diCw8b+asvWDCLMjsCEA8alvtAutqJOJp/wL5hs1rWSqJ1vkjgW0L2NB4bsYJrpKkiIPRR9dvw==}
|
resolution: {integrity: sha512-3XJ0NQtMAXTWFW8FqZKcw3gOQwBtVWP/u8TpHP3CRPXD7Pd6s8lLdH3sHWh8vqKCyyiI8xW5ltJScQmBU9j7WA==}
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@rollup/rollup-win32-x64-msvc@4.43.0':
|
'@rollup/rollup-win32-x64-msvc@4.44.0':
|
||||||
resolution: {integrity: sha512-SnGhLiE5rlK0ofq8kzuDkM0g7FN1s5VYY+YSMTibP7CqShxCQvqtNxTARS4xX4PFJfHjG0ZQYX9iGzI3FQh5Aw==}
|
resolution: {integrity: sha512-Q2Mgwt+D8hd5FIPUuPDsvPR7Bguza6yTkJxspDGkZj7tBRn2y4KSWYuIXpftFSjBra76TbKerCV7rgFPQrn+wQ==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@swc/core-darwin-arm64@1.12.1':
|
'@swc/core-darwin-arm64@1.12.4':
|
||||||
resolution: {integrity: sha512-nUjWVcJ3YS2N40ZbKwYO2RJ4+o2tWYRzNOcIQp05FqW0+aoUCVMdAUUzQinPDynfgwVshDAXCKemY8X7nN5MaA==}
|
resolution: {integrity: sha512-HihKfeitjZU2ab94Zf893sxzFryLKX0TweGsNXXOLNtkSMLw50auuYfpRM0BOL9/uXXtuCWgRIF6P030SAX5xQ==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@swc/core-darwin-x64@1.12.1':
|
'@swc/core-darwin-x64@1.12.4':
|
||||||
resolution: {integrity: sha512-OGm4a4d3OeJn+tRt8H/eiHgTFrJbS6r8mi/Ob65tAEXZGHN900T2kR7c5ALr0V2hBOQ8BfhexwPoQlGQP/B95w==}
|
resolution: {integrity: sha512-meYCXHyYb6RDdu2N5PNAf0EelyxPBFhRcVo4kBFLuvuNb0m6EUg///VWy8MUMXq9/s9uzGS9kJVXXdRdr/d6FA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@swc/core-linux-arm-gnueabihf@1.12.1':
|
'@swc/core-linux-arm-gnueabihf@1.12.4':
|
||||||
resolution: {integrity: sha512-76YeeQKyK0EtNkQiNBZ0nbVGooPf9IucY0WqVXVpaU4wuG7ZyLEE2ZAIgXafIuzODGQoLfetue7I8boMxh1/MA==}
|
resolution: {integrity: sha512-szfDbf7mE8V64of0q/LSqbk+em+T+TD3uqnH40Z7Qu/aL8vi5CHgyLjWG2SLkLLpyjgkAUF6AKrupgnBYcC2NA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@swc/core-linux-arm64-gnu@1.12.1':
|
'@swc/core-linux-arm64-gnu@1.12.4':
|
||||||
resolution: {integrity: sha512-BxJDIJPq1+aCh9UsaSAN6wo3tuln8UhNXruOrzTI8/ElIig/3sAueDM6Eq7GvZSGGSA7ljhNATMJ0elD7lFatQ==}
|
resolution: {integrity: sha512-n0IY76w+Scx8m3HIVRvLkoResuwsQgjDfAk9bxn99dq4leQO+mE0fkPl0Yw/1BIsPh+kxGfopIJH9zsZ1Z2YrA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@swc/core-linux-arm64-musl@1.12.1':
|
'@swc/core-linux-arm64-musl@1.12.4':
|
||||||
resolution: {integrity: sha512-NhLdbffSXvY0/FwUSAl4hKBlpe5GHQGXK8DxTo3HHjLsD9sCPYieo3vG0NQoUYAy4ZUY1WeGjyxeq4qZddJzEQ==}
|
resolution: {integrity: sha512-wE5jmFi5cEQyLy8WmCWmNwfKETrnzy2D8YNi/xpYWpLPWqPhcelpa6tswkfYlbsMmmOh7hQNoTba1QdGu0jvHQ==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@swc/core-linux-x64-gnu@1.12.1':
|
'@swc/core-linux-x64-gnu@1.12.4':
|
||||||
resolution: {integrity: sha512-CrYnV8SZIgArQ9LKH0xEF95PKXzX9WkRSc5j55arOSBeDCeDUQk1Bg/iKdnDiuj5HC1hZpvzwMzSBJjv+Z70jA==}
|
resolution: {integrity: sha512-6S50Xd/7ePjEwrXyHMxpKTZ+KBrgUwMA8hQPbArUOwH4S5vHBr51heL0iXbUkppn1bkSr0J0IbOove5hzn+iqQ==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@swc/core-linux-x64-musl@1.12.1':
|
'@swc/core-linux-x64-musl@1.12.4':
|
||||||
resolution: {integrity: sha512-BQMl3d0HaGB0/h2xcKlGtjk/cGRn2tnbsaChAKcjFdCepblKBCz1pgO/mL7w5iXq3s57wMDUn++71/a5RAkZOA==}
|
resolution: {integrity: sha512-hbYRyaHhC13vYKuGG5BrAG5fjjWEQFfQetuFp/4QKEoXDzdnabJoixxWTQACDL3m0JW32nJ+gUzsYIPtFYkwXg==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@swc/core-win32-arm64-msvc@1.12.1':
|
'@swc/core-win32-arm64-msvc@1.12.4':
|
||||||
resolution: {integrity: sha512-b7NeGnpqTfmIGtUqXBl0KqoSmOnH64nRZoT5l4BAGdvwY7nxitWR94CqZuwyLPty/bLywmyDA9uO12Kvgb3+gg==}
|
resolution: {integrity: sha512-e6EbfjPL8GA/bb1lc9Omtxjlz+1ThTsAuBsy4Q3Kpbuh6B3jclg8KzxU/6t91v23wG593mieTyR5f3Pr7X3AWw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@swc/core-win32-ia32-msvc@1.12.1':
|
'@swc/core-win32-ia32-msvc@1.12.4':
|
||||||
resolution: {integrity: sha512-iU/29X2D7cHBp1to62cUg/5Xk8K+lyOJiKIGGW5rdzTW/c2zz3d/ehgpzVP/rqC4NVr88MXspqHU4il5gmDajw==}
|
resolution: {integrity: sha512-RG2FzmllBTUf4EksANlIvLckcBrLZEA0t13LIa6L213UZKQfEuDNHezqESgoVhJMg2S/tWauitATOCFgZNSmjg==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@swc/core-win32-x64-msvc@1.12.1':
|
'@swc/core-win32-x64-msvc@1.12.4':
|
||||||
resolution: {integrity: sha512-+Zh+JKDwiFqV5N9yAd2DhYVGPORGh9cfenu1ptr9yge+eHAf7vZJcC3rnj6QMR1QJh0Y5VC9+YBjRFjZVA7XDw==}
|
resolution: {integrity: sha512-oRHKnZlR83zaMeVUCmHENa4j5uNRAWbmEpjYbzRcfC45LPFNWKGWGAGERLx0u87XMUtTGqnVYxnBTHN/rzDHOw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@swc/core@1.12.1':
|
'@swc/core@1.12.4':
|
||||||
resolution: {integrity: sha512-aKXdDTqxTVFl/bKQZ3EQUjEMBEoF6JBv29moMZq0kbVO43na6u/u+3Vcbhbrh+A2N0X5OL4RaveuWfAjEgOmeA==}
|
resolution: {integrity: sha512-hn30ebV4njAn0NAUM+3a0qCF+MJgqTNSrfA/hUAbC6TVjOQy2OYGQwkUvCu/V7S2+rZxrUsTpKOnZ7qqECZV9Q==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@swc/helpers': '>=0.5.17'
|
'@swc/helpers': '>=0.5.17'
|
||||||
|
@ -1378,9 +1378,6 @@ packages:
|
||||||
'@types/deep-eql@4.0.2':
|
'@types/deep-eql@4.0.2':
|
||||||
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
|
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
|
||||||
|
|
||||||
'@types/estree@1.0.7':
|
|
||||||
resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==}
|
|
||||||
|
|
||||||
'@types/estree@1.0.8':
|
'@types/estree@1.0.8':
|
||||||
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
||||||
|
|
||||||
|
@ -3329,8 +3326,8 @@ packages:
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0
|
rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0
|
||||||
|
|
||||||
rollup@4.43.0:
|
rollup@4.44.0:
|
||||||
resolution: {integrity: sha512-wdN2Kd3Twh8MAEOEJZsuxuLKCsBEo4PVNLK6tQWAn10VhsVewQLzcucMgLolRlhFybGxfclbPeEYBaP6RvUFGg==}
|
resolution: {integrity: sha512-qHcdEzLCiktQIfwBq420pn2dP+30uzqYxv9ETm91wdt2R9AFcWfjNAmje4NWlnCIQ5RMTzVf0ZyisOKqHR6RwA==}
|
||||||
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
|
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
@ -4370,13 +4367,13 @@ snapshots:
|
||||||
- bare-buffer
|
- bare-buffer
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@rollup/plugin-alias@5.1.1(rollup@4.43.0)':
|
'@rollup/plugin-alias@5.1.1(rollup@4.44.0)':
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/plugin-commonjs@28.0.6(rollup@4.43.0)':
|
'@rollup/plugin-commonjs@28.0.6(rollup@4.44.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/pluginutils': 5.2.0(rollup@4.43.0)
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
commondir: 1.0.1
|
commondir: 1.0.1
|
||||||
estree-walker: 2.0.2
|
estree-walker: 2.0.2
|
||||||
fdir: 6.4.6(picomatch@4.0.2)
|
fdir: 6.4.6(picomatch@4.0.2)
|
||||||
|
@ -4384,152 +4381,152 @@ snapshots:
|
||||||
magic-string: 0.30.17
|
magic-string: 0.30.17
|
||||||
picomatch: 4.0.2
|
picomatch: 4.0.2
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/plugin-inject@5.0.5(rollup@4.43.0)':
|
'@rollup/plugin-inject@5.0.5(rollup@4.44.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/pluginutils': 5.2.0(rollup@4.43.0)
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
estree-walker: 2.0.2
|
estree-walker: 2.0.2
|
||||||
magic-string: 0.30.17
|
magic-string: 0.30.17
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/plugin-json@6.1.0(rollup@4.43.0)':
|
'@rollup/plugin-json@6.1.0(rollup@4.44.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/pluginutils': 5.2.0(rollup@4.43.0)
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/plugin-node-resolve@16.0.1(rollup@4.43.0)':
|
'@rollup/plugin-node-resolve@16.0.1(rollup@4.44.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/pluginutils': 5.2.0(rollup@4.43.0)
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
'@types/resolve': 1.20.2
|
'@types/resolve': 1.20.2
|
||||||
deepmerge: 4.3.1
|
deepmerge: 4.3.1
|
||||||
is-module: 1.0.0
|
is-module: 1.0.0
|
||||||
resolve: 1.22.10
|
resolve: 1.22.10
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/plugin-replace@5.0.4(rollup@4.43.0)':
|
'@rollup/plugin-replace@5.0.4(rollup@4.44.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/pluginutils': 5.2.0(rollup@4.43.0)
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
magic-string: 0.30.17
|
magic-string: 0.30.17
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/pluginutils@5.2.0(rollup@4.43.0)':
|
'@rollup/pluginutils@5.2.0(rollup@4.44.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/estree': 1.0.8
|
'@types/estree': 1.0.8
|
||||||
estree-walker: 2.0.2
|
estree-walker: 2.0.2
|
||||||
picomatch: 4.0.2
|
picomatch: 4.0.2
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
'@rollup/rollup-android-arm-eabi@4.43.0':
|
'@rollup/rollup-android-arm-eabi@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-android-arm64@4.43.0':
|
'@rollup/rollup-android-arm64@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-darwin-arm64@4.43.0':
|
'@rollup/rollup-darwin-arm64@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-darwin-x64@4.43.0':
|
'@rollup/rollup-darwin-x64@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-freebsd-arm64@4.43.0':
|
'@rollup/rollup-freebsd-arm64@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-freebsd-x64@4.43.0':
|
'@rollup/rollup-freebsd-x64@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-gnueabihf@4.43.0':
|
'@rollup/rollup-linux-arm-gnueabihf@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-musleabihf@4.43.0':
|
'@rollup/rollup-linux-arm-musleabihf@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-gnu@4.43.0':
|
'@rollup/rollup-linux-arm64-gnu@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-musl@4.43.0':
|
'@rollup/rollup-linux-arm64-musl@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-loongarch64-gnu@4.43.0':
|
'@rollup/rollup-linux-loongarch64-gnu@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-powerpc64le-gnu@4.43.0':
|
'@rollup/rollup-linux-powerpc64le-gnu@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-gnu@4.43.0':
|
'@rollup/rollup-linux-riscv64-gnu@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-musl@4.43.0':
|
'@rollup/rollup-linux-riscv64-musl@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-s390x-gnu@4.43.0':
|
'@rollup/rollup-linux-s390x-gnu@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-gnu@4.43.0':
|
'@rollup/rollup-linux-x64-gnu@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-musl@4.43.0':
|
'@rollup/rollup-linux-x64-musl@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-win32-arm64-msvc@4.43.0':
|
'@rollup/rollup-win32-arm64-msvc@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-win32-ia32-msvc@4.43.0':
|
'@rollup/rollup-win32-ia32-msvc@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rollup/rollup-win32-x64-msvc@4.43.0':
|
'@rollup/rollup-win32-x64-msvc@4.44.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-darwin-arm64@1.12.1':
|
'@swc/core-darwin-arm64@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-darwin-x64@1.12.1':
|
'@swc/core-darwin-x64@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-linux-arm-gnueabihf@1.12.1':
|
'@swc/core-linux-arm-gnueabihf@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-linux-arm64-gnu@1.12.1':
|
'@swc/core-linux-arm64-gnu@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-linux-arm64-musl@1.12.1':
|
'@swc/core-linux-arm64-musl@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-linux-x64-gnu@1.12.1':
|
'@swc/core-linux-x64-gnu@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-linux-x64-musl@1.12.1':
|
'@swc/core-linux-x64-musl@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-win32-arm64-msvc@1.12.1':
|
'@swc/core-win32-arm64-msvc@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-win32-ia32-msvc@1.12.1':
|
'@swc/core-win32-ia32-msvc@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core-win32-x64-msvc@1.12.1':
|
'@swc/core-win32-x64-msvc@1.12.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@swc/core@1.12.1':
|
'@swc/core@1.12.4':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@swc/counter': 0.1.3
|
'@swc/counter': 0.1.3
|
||||||
'@swc/types': 0.1.23
|
'@swc/types': 0.1.23
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@swc/core-darwin-arm64': 1.12.1
|
'@swc/core-darwin-arm64': 1.12.4
|
||||||
'@swc/core-darwin-x64': 1.12.1
|
'@swc/core-darwin-x64': 1.12.4
|
||||||
'@swc/core-linux-arm-gnueabihf': 1.12.1
|
'@swc/core-linux-arm-gnueabihf': 1.12.4
|
||||||
'@swc/core-linux-arm64-gnu': 1.12.1
|
'@swc/core-linux-arm64-gnu': 1.12.4
|
||||||
'@swc/core-linux-arm64-musl': 1.12.1
|
'@swc/core-linux-arm64-musl': 1.12.4
|
||||||
'@swc/core-linux-x64-gnu': 1.12.1
|
'@swc/core-linux-x64-gnu': 1.12.4
|
||||||
'@swc/core-linux-x64-musl': 1.12.1
|
'@swc/core-linux-x64-musl': 1.12.4
|
||||||
'@swc/core-win32-arm64-msvc': 1.12.1
|
'@swc/core-win32-arm64-msvc': 1.12.4
|
||||||
'@swc/core-win32-ia32-msvc': 1.12.1
|
'@swc/core-win32-ia32-msvc': 1.12.4
|
||||||
'@swc/core-win32-x64-msvc': 1.12.1
|
'@swc/core-win32-x64-msvc': 1.12.4
|
||||||
|
|
||||||
'@swc/counter@0.1.3': {}
|
'@swc/counter@0.1.3': {}
|
||||||
|
|
||||||
|
@ -4554,8 +4551,6 @@ snapshots:
|
||||||
|
|
||||||
'@types/deep-eql@4.0.2': {}
|
'@types/deep-eql@4.0.2': {}
|
||||||
|
|
||||||
'@types/estree@1.0.7': {}
|
|
||||||
|
|
||||||
'@types/estree@1.0.8': {}
|
'@types/estree@1.0.8': {}
|
||||||
|
|
||||||
'@types/hash-sum@1.0.2': {}
|
'@types/hash-sum@1.0.2': {}
|
||||||
|
@ -6623,54 +6618,54 @@ snapshots:
|
||||||
glob: 11.0.3
|
glob: 11.0.3
|
||||||
package-json-from-dist: 1.0.1
|
package-json-from-dist: 1.0.1
|
||||||
|
|
||||||
rollup-plugin-dts@6.2.1(rollup@4.43.0)(typescript@5.6.3):
|
rollup-plugin-dts@6.2.1(rollup@4.44.0)(typescript@5.6.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
magic-string: 0.30.17
|
magic-string: 0.30.17
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
typescript: 5.6.3
|
typescript: 5.6.3
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@babel/code-frame': 7.27.1
|
'@babel/code-frame': 7.27.1
|
||||||
|
|
||||||
rollup-plugin-esbuild@6.2.1(esbuild@0.25.5)(rollup@4.43.0):
|
rollup-plugin-esbuild@6.2.1(esbuild@0.25.5)(rollup@4.44.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
debug: 4.4.1
|
debug: 4.4.1
|
||||||
es-module-lexer: 1.7.0
|
es-module-lexer: 1.7.0
|
||||||
esbuild: 0.25.5
|
esbuild: 0.25.5
|
||||||
get-tsconfig: 4.10.1
|
get-tsconfig: 4.10.1
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
unplugin-utils: 0.2.4
|
unplugin-utils: 0.2.4
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
rollup-plugin-polyfill-node@0.13.0(rollup@4.43.0):
|
rollup-plugin-polyfill-node@0.13.0(rollup@4.44.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/plugin-inject': 5.0.5(rollup@4.43.0)
|
'@rollup/plugin-inject': 5.0.5(rollup@4.44.0)
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
|
|
||||||
rollup@4.43.0:
|
rollup@4.44.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/estree': 1.0.7
|
'@types/estree': 1.0.8
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@rollup/rollup-android-arm-eabi': 4.43.0
|
'@rollup/rollup-android-arm-eabi': 4.44.0
|
||||||
'@rollup/rollup-android-arm64': 4.43.0
|
'@rollup/rollup-android-arm64': 4.44.0
|
||||||
'@rollup/rollup-darwin-arm64': 4.43.0
|
'@rollup/rollup-darwin-arm64': 4.44.0
|
||||||
'@rollup/rollup-darwin-x64': 4.43.0
|
'@rollup/rollup-darwin-x64': 4.44.0
|
||||||
'@rollup/rollup-freebsd-arm64': 4.43.0
|
'@rollup/rollup-freebsd-arm64': 4.44.0
|
||||||
'@rollup/rollup-freebsd-x64': 4.43.0
|
'@rollup/rollup-freebsd-x64': 4.44.0
|
||||||
'@rollup/rollup-linux-arm-gnueabihf': 4.43.0
|
'@rollup/rollup-linux-arm-gnueabihf': 4.44.0
|
||||||
'@rollup/rollup-linux-arm-musleabihf': 4.43.0
|
'@rollup/rollup-linux-arm-musleabihf': 4.44.0
|
||||||
'@rollup/rollup-linux-arm64-gnu': 4.43.0
|
'@rollup/rollup-linux-arm64-gnu': 4.44.0
|
||||||
'@rollup/rollup-linux-arm64-musl': 4.43.0
|
'@rollup/rollup-linux-arm64-musl': 4.44.0
|
||||||
'@rollup/rollup-linux-loongarch64-gnu': 4.43.0
|
'@rollup/rollup-linux-loongarch64-gnu': 4.44.0
|
||||||
'@rollup/rollup-linux-powerpc64le-gnu': 4.43.0
|
'@rollup/rollup-linux-powerpc64le-gnu': 4.44.0
|
||||||
'@rollup/rollup-linux-riscv64-gnu': 4.43.0
|
'@rollup/rollup-linux-riscv64-gnu': 4.44.0
|
||||||
'@rollup/rollup-linux-riscv64-musl': 4.43.0
|
'@rollup/rollup-linux-riscv64-musl': 4.44.0
|
||||||
'@rollup/rollup-linux-s390x-gnu': 4.43.0
|
'@rollup/rollup-linux-s390x-gnu': 4.44.0
|
||||||
'@rollup/rollup-linux-x64-gnu': 4.43.0
|
'@rollup/rollup-linux-x64-gnu': 4.44.0
|
||||||
'@rollup/rollup-linux-x64-musl': 4.43.0
|
'@rollup/rollup-linux-x64-musl': 4.44.0
|
||||||
'@rollup/rollup-win32-arm64-msvc': 4.43.0
|
'@rollup/rollup-win32-arm64-msvc': 4.44.0
|
||||||
'@rollup/rollup-win32-ia32-msvc': 4.43.0
|
'@rollup/rollup-win32-ia32-msvc': 4.44.0
|
||||||
'@rollup/rollup-win32-x64-msvc': 4.43.0
|
'@rollup/rollup-win32-x64-msvc': 4.44.0
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
rrweb-cssom@0.8.0: {}
|
rrweb-cssom@0.8.0: {}
|
||||||
|
@ -7086,10 +7081,10 @@ snapshots:
|
||||||
- tsx
|
- tsx
|
||||||
- yaml
|
- yaml
|
||||||
|
|
||||||
vite-plugin-inspect@0.8.9(rollup@4.43.0)(vite@6.3.5(@types/node@22.15.32)(sass@1.89.2)(yaml@2.8.0)):
|
vite-plugin-inspect@0.8.9(rollup@4.44.0)(vite@6.3.5(@types/node@22.15.32)(sass@1.89.2)(yaml@2.8.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@antfu/utils': 0.7.10
|
'@antfu/utils': 0.7.10
|
||||||
'@rollup/pluginutils': 5.2.0(rollup@4.43.0)
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
debug: 4.4.1
|
debug: 4.4.1
|
||||||
error-stack-parser-es: 0.1.5
|
error-stack-parser-es: 0.1.5
|
||||||
fs-extra: 11.3.0
|
fs-extra: 11.3.0
|
||||||
|
@ -7106,7 +7101,7 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.21.5
|
esbuild: 0.21.5
|
||||||
postcss: 8.5.6
|
postcss: 8.5.6
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 22.15.32
|
'@types/node': 22.15.32
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
@ -7118,7 +7113,7 @@ snapshots:
|
||||||
fdir: 6.4.6(picomatch@4.0.2)
|
fdir: 6.4.6(picomatch@4.0.2)
|
||||||
picomatch: 4.0.2
|
picomatch: 4.0.2
|
||||||
postcss: 8.5.6
|
postcss: 8.5.6
|
||||||
rollup: 4.43.0
|
rollup: 4.44.0
|
||||||
tinyglobby: 0.2.14
|
tinyglobby: 0.2.14
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 22.15.32
|
'@types/node': 22.15.32
|
||||||
|
|
Loading…
Reference in New Issue