Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v-skip #12767

Open
wants to merge 38 commits into
base: minor
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
81992b0
wip: v-skip
edison1105 Jan 22, 2025
ac5005f
wip: v-skip
edison1105 Jan 22, 2025
1bf4e9c
chore: update error code
edison1105 Jan 22, 2025
32ac9ed
wip: ssr v-skip
edison1105 Jan 22, 2025
80c1e5c
wip: v-skip work with v-if/v-else/v-else-if
edison1105 Jan 22, 2025
4dbcd89
wip: warn work with v-for
edison1105 Jan 23, 2025
7a6f1cb
wip: reuse check logic
edison1105 Jan 23, 2025
6529c3d
refactor: add new node type for v-skip node
edison1105 Jan 23, 2025
7327a57
chore: cache buildSlots result
edison1105 Jan 23, 2025
277e1f0
wip: add test case
edison1105 Jan 23, 2025
1ca1bba
test: add tests
edison1105 Jan 23, 2025
5407b05
wip: save
edison1105 Jan 23, 2025
74e8bb4
Revert "chore: cache buildSlots result"
edison1105 Jan 23, 2025
4974e5d
Revert "Revert "chore: cache buildSlots result""
edison1105 Jan 23, 2025
84a733e
fix: ssr buildSlots not use cache
edison1105 Jan 23, 2025
905805f
test: update
edison1105 Jan 23, 2025
bb62400
wip: test
edison1105 Jan 23, 2025
25b023d
wip: ssr test cases
edison1105 Jan 23, 2025
e756c52
wip: test
edison1105 Jan 23, 2025
172c16d
wip: inject attrs for skip node
edison1105 Jan 23, 2025
f725472
wip: properly inject fallthrough attrs to alternate node
edison1105 Jan 24, 2025
1d49d53
test: add more tests
edison1105 Jan 24, 2025
6c17a37
chore: minor tweaks
edison1105 Jan 24, 2025
453aa03
test: add tests
edison1105 Jan 24, 2025
feda7a0
refactor: tweak v-skip on component
edison1105 Jan 24, 2025
e3fc703
wip: save
edison1105 Jan 24, 2025
7efaafb
wip: analyze slots to find default slot when possible
edison1105 Jan 26, 2025
c0f00d2
wip: add ssrRenderSkipVNode
edison1105 Jan 26, 2025
7031b59
wip: add more ssr test
edison1105 Jan 26, 2025
46825ca
wip: add more test
edison1105 Jan 26, 2025
80b32bf
wip: fix on component slot + v-if in ssr
edison1105 Jan 26, 2025
ac55a02
test: make test pass
edison1105 Jan 26, 2025
f4b0498
chore: tweaks comments
edison1105 Jan 27, 2025
2328f91
chore: update
edison1105 Jan 27, 2025
c3cb610
chore: update
edison1105 Jan 27, 2025
69162d3
fix: codegen
edison1105 Jan 27, 2025
12df730
test: add more tests
edison1105 Jan 31, 2025
e44f4a1
test: update
edison1105 Feb 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: ssr buildSlots not use cache
edison1105 committed Jan 23, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 84a733ebccc7b1566f31f0c5eb1ab32256030080
5 changes: 3 additions & 2 deletions packages/compiler-core/src/transforms/vSlot.ts
Original file line number Diff line number Diff line change
@@ -117,12 +117,13 @@ export function buildSlots(
node: ComponentNode,
context: TransformContext,
buildSlotFn: SlotFnBuilder = buildClientSlotFn,
useCache: boolean = true,
): {
slots: SlotsExpression
hasDynamicSlots: boolean
} {
// return early if slots are already built to avoid duplication
if (node.slots) {
// early return if slots are already built to avoid duplication
if (useCache && node.slots) {
return {
slots: node.slots,
hasDynamicSlots: node.hasDynamicSlots,
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ export const ssrTransformComponent: NodeTransform = (node, context) => {
}

const slots = node.children.length
? buildSlots(node, context, buildSSRSlotFn).slots
? buildSlots(node, context, buildSSRSlotFn, false).slots
: `null`

if (typeof component !== 'string') {