Skip to content

fix(hmr): #6978 render wrong list #6988

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

Closed
wants to merge 1 commit into from
Closed

Conversation

hoi-lau
Copy link

@hoi-lau hoi-lau commented Oct 29, 2022

#6978 In dev, hoisted nodes are not always "static".

@zhangzhonghe
Copy link
Member

Thanks for the PR - But I don't think this is the right fix because it doesn't pass the test below:

test('rerender in change hoisted nodes', () => {
const root = nodeOps.createElement('div')
const appId = 'test-app-id'
const App: ComponentOptions = {
__hmrId: appId,
render: compileToFunction(
`<div v-for="item of 2"><div>1</div></div><p>2</p><p>3</p>`
)
}
createRecord(appId, App)
render(h(App), root)
expect(serializeInner(root)).toBe(
`<div><div>1</div></div><div><div>1</div></div><p>2</p><p>3</p>`
)
// move the <p>3</p> into the <div>1</div>
rerender(
appId,
compileToFunction(
`<div v-for="item of 2"><div>1<p>3</p></div></div><p>2</p>`
)
)
expect(serializeInner(root)).toBe(
`<div><div>1<p>3</p></div></div><div><div>1<p>3</p></div></div><p>2</p>`
)
})

see #7114 (waiting for review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants