Skip to content

Commit db1a424

Browse files
authoredFeb 12, 2025··
perf: prefer mapped entries (#486)
* perf: prefer mapped entries * chore: fix build * chore: bump snapshots
1 parent 6d0e4b4 commit db1a424

24 files changed

+175
-136
lines changed
 

‎packages/unhead/src/client/plugins/domPlugin.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export function DomPlugin(options: DomPluginOptions) {
99
head.push(JSON.parse(initialPayload))
1010
}
1111
return {
12+
key: 'dom',
1213
mode: 'client',
1314
hooks: {
1415
'entries:updated': (head) => {

‎packages/unhead/src/client/plugins/eventHandlers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const ValidEventTags = new Set(['script', 'link', 'bodyAttrs'])
88
* When SSR we need to strip out these values. On CSR we
99
*/
1010
export const ClientEventHandlerPlugin = defineHeadPlugin({
11+
key: 'client-event-handler',
1112
hooks: {
1213
'tags:resolve': (ctx) => {
1314
for (const tag of ctx.tags) {

‎packages/unhead/src/createHead.ts

+34-41
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {
2+
ActiveHeadEntry,
23
CreateHeadOptions,
34
Head,
45
HeadEntry,
@@ -18,15 +19,13 @@ function filterMode(mode: RuntimeMode | undefined, ssr: boolean) {
1819
}
1920

2021
function registerPlugins(head: Unhead<any>, plugins: HeadPluginInput[], ssr: boolean) {
21-
plugins.forEach((p) => {
22+
for (const p of plugins) {
2223
const plugin = (typeof p === 'function' ? p(head) : p)
23-
if (!plugin.key || !head.plugins.some(existingPlugin => existingPlugin.key === plugin.key)) {
24-
head.plugins.push(plugin)
25-
if (filterMode(plugin.mode, ssr)) {
26-
head.hooks.addHooks(plugin.hooks || {})
27-
}
24+
if (filterMode(plugin.mode, ssr) && !head.plugins.has(plugin.key)) {
25+
head.plugins.set(plugin.key, plugin)
26+
head.hooks.addHooks(plugin.hooks || {})
2827
}
29-
})
28+
}
3029
}
3130

3231
/**
@@ -40,60 +39,54 @@ export function createHeadCore<T extends Record<string, any> = Head>(options: Cr
4039
const hooks = createHooks<HeadHooks>()
4140
hooks.addHooks(options.hooks || {})
4241
const ssr = !options.document
43-
44-
const updated = () => {
45-
// eslint-disable-next-line ts/no-use-before-define
46-
head.dirty = true
47-
// eslint-disable-next-line ts/no-use-before-define
48-
hooks.callHook('entries:updated', head)
49-
}
50-
let entryCount = 0
51-
let entries: HeadEntry<T>[] = []
52-
const plugins: HeadPlugin[] = []
42+
const entries: Map<number, HeadEntry<T>> = new Map()
43+
const plugins: Map<string, HeadPlugin> = new Map()
5344
const head: Unhead<T> = {
45+
_entryCount: 1, // 0 is reserved for internal use
5446
plugins,
5547
dirty: false,
5648
resolvedOptions: options,
5749
hooks,
5850
ssr,
51+
entries,
5952
headEntries() {
60-
return entries
53+
return [...entries.values()]
6154
},
6255
use(p: HeadPluginInput) {
6356
registerPlugins(head, [p], ssr)
6457
},
65-
push(input, entryOptions) {
66-
delete entryOptions?.head
67-
const entry: HeadEntry<T> = {
68-
_i: entryCount++,
69-
input,
70-
...entryOptions as Partial<HeadEntry<T>>,
71-
}
72-
// bit hacky but safer
73-
if (filterMode(entry.mode, ssr)) {
74-
entries.push(entry)
75-
updated()
76-
}
77-
return {
58+
push(input, _options) {
59+
const options = { ..._options } as Partial<HeadEntry<T>>
60+
// @ts-expect-error untyped
61+
delete options.head
62+
const _i = head._entryCount++
63+
const _: ActiveHeadEntry<T> = {
64+
_poll() {
65+
head.dirty = true
66+
hooks.callHook('entries:updated', head)
67+
},
7868
dispose() {
79-
entries = entries.filter(e => e._i !== entry._i)
80-
updated()
69+
if (entries.delete(_i)) {
70+
_._poll()
71+
}
8172
},
8273
// a patch is the same as creating a new entry, just a nice DX
8374
patch(input) {
84-
for (const e of entries) {
85-
if (e._i === entry._i) {
86-
// bit hacky syncing
87-
e.input = entry.input = input
88-
e.resolvedInput = undefined
89-
}
75+
if (filterMode(options.mode, ssr)) {
76+
entries.set(_i, {
77+
_i,
78+
input,
79+
...options,
80+
})
81+
_._poll()
9082
}
91-
updated()
9283
},
9384
}
85+
_.patch(input)
86+
return _
9487
},
9588
async resolveTags() {
96-
const resolveCtx: { tags: HeadTag[], entries: HeadEntry<T>[] } = { tags: [], entries: [...entries] }
89+
const resolveCtx: { tags: HeadTag[], entries: HeadEntry<T>[] } = { tags: [], entries: [...head.entries.values()] }
9790
await hooks.callHook('entries:resolve', resolveCtx)
9891
for (const entry of resolveCtx.entries) {
9992
// apply any custom transformers applied to the entry

‎packages/unhead/src/plugins/dedupe.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { defineHeadPlugin, HasElementTags, hashTag, tagWeight } from '../utils'
44
const UsesMergeStrategy = new Set(['templateParams', 'htmlAttrs', 'bodyAttrs'])
55

66
export const DedupePlugin = defineHeadPlugin(head => ({
7+
key: 'dedupe',
78
hooks: {
89
'tags:resolve': (ctx) => {
910
// 1. Dedupe tags

‎packages/unhead/src/plugins/deprecations.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineHeadPlugin } from '../utils'
22

33
export const DeprecationsPlugin = defineHeadPlugin({
4+
key: 'deprecations',
45
hooks: {
56
'tag:normalise': ({ tag }) => {
67
if (tag.props.children) {

‎packages/unhead/src/plugins/inferSeoMetaPlugin.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface InferSeoMetaPluginOptions {
2424

2525
export function InferSeoMetaPlugin(options: InferSeoMetaPluginOptions = {}) {
2626
return defineHeadPlugin({
27+
key: 'seo-meta',
2728
hooks: {
2829
entries: {
2930
resolve({ entries }) {

‎packages/unhead/src/plugins/promises.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ async function resolvePromisesRecursively(root: any): Promise<any> {
2525
}
2626

2727
export const PromisesPlugin = defineHeadPlugin({
28+
key: 'promises',
2829
hooks: {
2930
'entries:resolve': async (ctx) => {
3031
for (const k in ctx.entries) {

‎packages/unhead/src/plugins/sort.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineHeadPlugin, SortModifiers, tagWeight } from '../utils'
22

33
export const SortPlugin = defineHeadPlugin(head => ({
4+
key: 'sort',
45
hooks: {
56
'tags:resolve': (ctx) => {
67
// 2a. Sort based on priority

‎packages/unhead/src/plugins/templateParams.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const SupportedAttrs = {
1010
const contentAttrs = ['innerHTML', 'textContent']
1111

1212
export const TemplateParamsPlugin = defineHeadPlugin(head => ({
13+
key: 'template-params',
1314
hooks: {
1415
'tags:resolve': (ctx) => {
1516
const { tags } = ctx

‎packages/unhead/src/plugins/titleTemplate.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { HeadTag } from '../types'
22
import { defineHeadPlugin, resolveTitleTemplate } from '../utils'
33

44
export const TitleTemplatePlugin = defineHeadPlugin({
5+
key: 'title-template',
56
hooks: {
67
'tags:resolve': (ctx) => {
78
const { tags } = ctx

‎packages/unhead/src/plugins/xss.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineHeadPlugin } from '../utils'
22

33
export const XSSPlugin = defineHeadPlugin({
4+
key: 'xss',
45
hooks: {
56
'tags:afterResolve': (ctx) => {
67
for (const tag of ctx.tags) {

‎packages/unhead/src/server/plugins/eventHandlers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const ValidEventTags = new Set(['script', 'link', 'bodyAttrs'])
88
* When SSR we need to strip out these values. On CSR we
99
*/
1010
export const ServerEventHandlerPlugin = defineHeadPlugin({
11+
key: 'server-event-handler',
1112
hooks: {
1213
'tags:resolve': (ctx) => {
1314
for (const tag of ctx.tags) {

‎packages/unhead/src/server/plugins/payload.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineHeadPlugin } from '../../utils'
22

33
export const PayloadPlugin = defineHeadPlugin({
4+
key: 'payload',
45
hooks: {
56
'tags:beforeResolve': (ctx) => {
67
const payload: { titleTemplate?: string | ((s: string) => string), templateParams?: Record<string, string>, title?: string } = {}

‎packages/unhead/src/types/head.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface HeadEntry<Input> {
5656

5757
export type HeadPluginOptions = Omit<CreateHeadOptions, 'plugins'> & { mode?: RuntimeMode }
5858

59-
export type HeadPluginInput = HeadPluginOptions & { key?: string } | ((head: Unhead) => HeadPluginOptions & { key?: string })
59+
export type HeadPluginInput = HeadPluginOptions & { key: string } | ((head: Unhead) => HeadPluginOptions & { key: string })
6060
export type HeadPlugin = HeadPluginOptions & { key?: string }
6161

6262
/**
@@ -75,6 +75,10 @@ export interface ActiveHeadEntry<Input> {
7575
* Will queue side effects for removal.
7676
*/
7777
dispose: () => void
78+
/**
79+
* @internal
80+
*/
81+
_poll: () => void
7882
}
7983

8084
export interface CreateHeadOptions {
@@ -124,11 +128,16 @@ export interface Unhead<Input extends Record<string, any> = Head> {
124128
/**
125129
* Registered plugins.
126130
*/
127-
plugins: HeadPlugin[]
131+
plugins: Map<string, HeadPlugin>
128132
/**
129133
* The active head entries.
134+
* @deprecated Use `entries`
130135
*/
131136
headEntries: () => HeadEntry<Input>[]
137+
/**
138+
* The active head entries.
139+
*/
140+
entries: Map<number, HeadEntry<Input>>
132141
/**
133142
* Create a new head entry.
134143
*/
@@ -178,6 +187,10 @@ export interface Unhead<Input extends Record<string, any> = Head> {
178187
* @internal
179188
*/
180189
_separator?: string
190+
/**
191+
* @internal
192+
*/
193+
_entryCount: number
181194
}
182195

183196
export interface DomState {

‎packages/unhead/test/unit/client/order.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ describe('dom order', () => {
3030
expect(firstTagRendered).toMatchInlineSnapshot(`
3131
{
3232
"_d": "htmlAttrs",
33-
"_e": 0,
34-
"_p": 0,
33+
"_e": 1,
34+
"_p": 1024,
3535
"props": {
3636
"class": "no-js",
3737
},

‎packages/unhead/test/unit/client/promises.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ describe('promises', () => {
2121
[
2222
{
2323
"_d": "title",
24-
"_e": 0,
25-
"_p": 0,
24+
"_e": 1,
25+
"_p": 1024,
2626
"props": {},
2727
"tag": "title",
2828
"textContent": "hello",
2929
},
3030
{
31-
"_e": 0,
32-
"_p": 1,
31+
"_e": 1,
32+
"_p": 1025,
3333
"props": {
3434
"src": "https://example.com/script.js",
3535
},
3636
"tag": "script",
3737
},
3838
{
39-
"_e": 0,
40-
"_p": 2,
39+
"_e": 1,
40+
"_p": 1026,
4141
"innerHTML": "test",
4242
"props": {},
4343
"tag": "script",

‎packages/unhead/test/unit/client/resolveTags.test.ts

+36-36
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ describe('resolveTags', () => {
2020
[
2121
{
2222
"_d": "title",
23-
"_e": 0,
24-
"_p": 0,
23+
"_e": 1,
24+
"_p": 1024,
2525
"props": {},
2626
"tag": "title",
2727
"textContent": "My title",
2828
},
2929
{
3030
"_d": "meta:name:description",
31-
"_e": 0,
32-
"_p": 1,
31+
"_e": 1,
32+
"_p": 1025,
3333
"props": {
3434
"content": "My description",
3535
"name": "description",
@@ -50,25 +50,25 @@ describe('resolveTags', () => {
5050
[
5151
{
5252
"_d": "charset",
53-
"_e": 0,
54-
"_p": 3,
53+
"_e": 1,
54+
"_p": 1027,
5555
"props": {
5656
"charset": "utf-8",
5757
},
5858
"tag": "meta",
5959
},
6060
{
61-
"_e": 0,
62-
"_p": 2,
61+
"_e": 1,
62+
"_p": 1026,
6363
"props": {
6464
"src": "https://cdn.example.com/script.js",
6565
},
6666
"tag": "script",
6767
},
6868
{
6969
"_d": "htmlAttrs",
70-
"_e": 0,
71-
"_p": 0,
70+
"_e": 1,
71+
"_p": 1024,
7272
"props": {
7373
"dir": "ltr",
7474
"lang": "en",
@@ -77,16 +77,16 @@ describe('resolveTags', () => {
7777
},
7878
{
7979
"_d": "bodyAttrs",
80-
"_e": 0,
81-
"_p": 1,
80+
"_e": 1,
81+
"_p": 1025,
8282
"props": {
8383
"class": "dark",
8484
},
8585
"tag": "bodyAttrs",
8686
},
8787
{
88-
"_e": 0,
89-
"_p": 4,
88+
"_e": 1,
89+
"_p": 1028,
9090
"props": {
9191
"href": "https://cdn.example.com/favicon.ico",
9292
"rel": "icon",
@@ -118,8 +118,8 @@ describe('resolveTags', () => {
118118
expect(tags).toMatchInlineSnapshot(`
119119
[
120120
{
121-
"_e": 1,
122-
"_p": 1024,
121+
"_e": 2,
122+
"_p": 2048,
123123
"props": {
124124
"src": "https://cdn.example.com/script2.js",
125125
},
@@ -149,25 +149,25 @@ describe('resolveTags', () => {
149149
[
150150
{
151151
"_d": "charset",
152-
"_e": 0,
153-
"_p": 3,
152+
"_e": 1,
153+
"_p": 1027,
154154
"props": {
155155
"charset": "utf-8",
156156
},
157157
"tag": "meta",
158158
},
159159
{
160-
"_e": 0,
161-
"_p": 2,
160+
"_e": 1,
161+
"_p": 1026,
162162
"props": {
163163
"src": "https://cdn.example.com/script2.js",
164164
},
165165
"tag": "script",
166166
},
167167
{
168168
"_d": "htmlAttrs",
169-
"_e": 0,
170-
"_p": 0,
169+
"_e": 1,
170+
"_p": 1024,
171171
"props": {
172172
"dir": "ltr",
173173
"lang": "en",
@@ -176,16 +176,16 @@ describe('resolveTags', () => {
176176
},
177177
{
178178
"_d": "bodyAttrs",
179-
"_e": 0,
180-
"_p": 1,
179+
"_e": 1,
180+
"_p": 1025,
181181
"props": {
182182
"class": "dark",
183183
},
184184
"tag": "bodyAttrs",
185185
},
186186
{
187-
"_e": 0,
188-
"_p": 4,
187+
"_e": 1,
188+
"_p": 1028,
189189
"props": {
190190
"href": "https://cdn.example.com/favicon.ico",
191191
"rel": "icon",
@@ -223,17 +223,17 @@ describe('resolveTags', () => {
223223
[
224224
{
225225
"_d": "htmlAttrs",
226-
"_e": 0,
227-
"_p": 0,
226+
"_e": 1,
227+
"_p": 1024,
228228
"props": {
229229
"class": "foo bar something-new",
230230
},
231231
"tag": "htmlAttrs",
232232
},
233233
{
234234
"_d": "bodyAttrs",
235-
"_e": 0,
236-
"_p": 1,
235+
"_e": 1,
236+
"_p": 1025,
237237
"props": {
238238
"class": "foo2 bar2 something-new2",
239239
},
@@ -268,8 +268,8 @@ describe('resolveTags', () => {
268268
[
269269
{
270270
"_d": "htmlAttrs",
271-
"_e": 0,
272-
"_p": 0,
271+
"_e": 1,
272+
"_p": 1024,
273273
"props": {
274274
"class": "foo bar",
275275
},
@@ -301,8 +301,8 @@ describe('resolveTags', () => {
301301
[
302302
{
303303
"_d": "meta:name:description",
304-
"_e": 0,
305-
"_p": 0,
304+
"_e": 1,
305+
"_p": 1024,
306306
"props": {
307307
"content": "desc",
308308
"name": "description",
@@ -311,8 +311,8 @@ describe('resolveTags', () => {
311311
},
312312
{
313313
"_d": "meta:name:description:1",
314-
"_e": 0,
315-
"_p": 1,
314+
"_e": 1,
315+
"_p": 1025,
316316
"props": {
317317
"content": "desc 2",
318318
"name": "description",

‎packages/unhead/test/unit/client/state.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('state', () => {
1212
expect(head.headEntries()).toMatchInlineSnapshot(`
1313
[
1414
{
15-
"_i": 0,
15+
"_i": 1,
1616
"input": {
1717
"title": "hello",
1818
},

‎packages/unhead/test/unit/server/tagPriority.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ describe('tag priority', () => {
2323
expect(await head.resolveTags()).toMatchInlineSnapshot(`
2424
[
2525
{
26-
"_e": 1,
27-
"_p": 1024,
26+
"_e": 2,
27+
"_p": 2048,
2828
"props": {
2929
"src": "/very-important-script.js",
3030
},
3131
"tag": "script",
3232
"tagPriority": "critical",
3333
},
3434
{
35-
"_e": 0,
36-
"_p": 0,
35+
"_e": 1,
36+
"_p": 1024,
3737
"props": {
3838
"src": "/not-important-script.js",
3939
},

‎packages/vue/src/legacy/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import { resolveUnrefHeadInput } from '../utils'
3030
export * from './useScript'
3131
export { createHeadCore, resolveUnrefHeadInput }
3232

33-
export const CapoPlugin = () => defineHeadPlugin({})
33+
export const CapoPlugin = () => defineHeadPlugin({
34+
key: 'capo',
35+
})
3436

3537
export function createHead<T extends MergeHead>(options: CreateClientHeadOptions = {}): VueHeadClient<T> {
3638
return createVueHead({

‎packages/vue/test/unit/dom/keepalive.test.ts

+44-25
Original file line numberDiff line numberDiff line change
@@ -46,54 +46,73 @@ describe('keepalive', () => {
4646
},
4747
})
4848

49-
const homeHeadSnapshot = `
49+
/*
50+
Steps 1 and 2 are used to enable instances of each component,
51+
and steps 3 and 4 are used to check that the deactivated hooks in `useHead` are working properly.
52+
*/
53+
54+
// Step 1
55+
const app = mount(Provider, () => ({ head: createHead() }))
56+
await nextTick()
57+
expect(await app.head.resolveTags()).toMatchInlineSnapshot(`
5058
[
5159
{
5260
"_d": "title",
53-
"_e": 0,
54-
"_p": 0,
61+
"_e": 1,
62+
"_p": 1024,
5563
"props": {},
5664
"tag": "title",
5765
"textContent": "home",
5866
},
5967
]
60-
`
61-
const aboutHeadSnapshot = `
68+
`)
69+
70+
// Step 2
71+
app.name = 'about'
72+
await nextTick()
73+
expect(await app.head.resolveTags()).toMatchInlineSnapshot(`
6274
[
6375
{
6476
"_d": "title",
65-
"_e": 1,
66-
"_p": 1024,
77+
"_e": 2,
78+
"_p": 2048,
6779
"props": {},
6880
"tag": "title",
6981
"textContent": "about",
7082
},
7183
]
72-
`
73-
74-
/*
75-
Steps 1 and 2 are used to enable instances of each component,
76-
and steps 3 and 4 are used to check that the deactivated hooks in `useHead` are working properly.
77-
*/
78-
79-
// Step 1
80-
const app = mount(Provider, () => ({ head: createHead() }))
81-
await nextTick()
82-
expect(await app.head.resolveTags()).toMatchInlineSnapshot(homeHeadSnapshot)
83-
84-
// Step 2
85-
app.name = 'about'
86-
await nextTick()
87-
expect(await app.head.resolveTags()).toMatchInlineSnapshot(aboutHeadSnapshot)
84+
`)
8885

8986
// Step 3
9087
app.name = 'home'
9188
await nextTick()
92-
expect(await app.head.resolveTags()).toMatchInlineSnapshot(homeHeadSnapshot)
89+
expect(await app.head.resolveTags()).toMatchInlineSnapshot(`
90+
[
91+
{
92+
"_d": "title",
93+
"_e": 1,
94+
"_p": 1024,
95+
"props": {},
96+
"tag": "title",
97+
"textContent": "home",
98+
},
99+
]
100+
`)
93101

94102
// Step 4
95103
app.name = 'about'
96104
await nextTick()
97-
expect(await app.head.resolveTags()).toMatchInlineSnapshot(aboutHeadSnapshot)
105+
expect(await app.head.resolveTags()).toMatchInlineSnapshot(`
106+
[
107+
{
108+
"_d": "title",
109+
"_e": 2,
110+
"_p": 2048,
111+
"props": {},
112+
"tag": "title",
113+
"textContent": "about",
114+
},
115+
]
116+
`)
98117
})
99118
})

‎packages/vue/test/unit/e2e/keys.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ describe('vue e2e keys', () => {
6868
[
6969
{
7070
"_d": "link:main-icon",
71-
"_e": 1,
71+
"_e": 2,
7272
"_h": "6b4a565",
73-
"_p": 1024,
73+
"_p": 2048,
7474
"key": "main-icon",
7575
"props": {
7676
"data-hid": "6b4a565",

‎packages/vue/test/unit/promises.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ describe('vue promises', () => {
2323
[
2424
{
2525
"_d": "title",
26-
"_e": 0,
27-
"_p": 0,
26+
"_e": 1,
27+
"_p": 1024,
2828
"props": {},
2929
"tag": "title",
3030
"textContent": "hello",
3131
},
3232
{
33-
"_e": 0,
34-
"_p": 1,
33+
"_e": 1,
34+
"_p": 1025,
3535
"props": {
3636
"src": "https://example.com/script.js",
3737
},
3838
"tag": "script",
3939
},
4040
{
41-
"_e": 0,
42-
"_p": 2,
41+
"_e": 1,
42+
"_p": 1026,
4343
"innerHTML": "test",
4444
"props": {},
4545
"tag": "script",

‎packages/vue/test/unit/resolveTags.test.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ describe('resolveTags', () => {
2121
[
2222
{
2323
"_d": "htmlAttrs",
24-
"_e": 0,
25-
"_p": 0,
24+
"_e": 1,
25+
"_p": 1024,
2626
"props": {
2727
"class": "first-class second-class",
2828
},
@@ -61,17 +61,17 @@ describe('resolveTags', () => {
6161
[
6262
{
6363
"_d": "htmlAttrs",
64-
"_e": 0,
65-
"_p": 0,
64+
"_e": 1,
65+
"_p": 1024,
6666
"props": {
6767
"class": "layout-theme-dark home",
6868
},
6969
"tag": "htmlAttrs",
7070
},
7171
{
7272
"_d": "bodyAttrs",
73-
"_e": 0,
74-
"_p": 1,
73+
"_e": 1,
74+
"_p": 1025,
7575
"props": {
7676
"class": "test theme-dark",
7777
},
@@ -96,8 +96,8 @@ describe('resolveTags', () => {
9696
[
9797
{
9898
"_d": "htmlAttrs",
99-
"_e": 1,
100-
"_p": 1024,
99+
"_e": 2,
100+
"_p": 2048,
101101
"props": {
102102
"class": "second-class",
103103
},
@@ -149,8 +149,8 @@ describe('resolveTags', () => {
149149
[
150150
{
151151
"_d": "htmlAttrs",
152-
"_e": 0,
153-
"_p": 0,
152+
"_e": 1,
153+
"_p": 1024,
154154
"props": {
155155
"class": "someTrue someArrayClass",
156156
},

0 commit comments

Comments
 (0)
Please sign in to comment.