Repository navigation
Commit e78631c
committed
fix(ssr): set signal declaration invocations during server component renders
The first-declaration-wins guard in RedeclarableBinding.redeclare() keys
off currentSignalDeclarationInvocation(), which only the client native-read
driver was setting. Server renders stayed at 0, so the guard never fired
and the second declaration still installed its definition. This caused a
client/server mismatch when a shared cell (duplicate explicit key or an
uncompiled hook called twice) was declared, because the client showed the
first closure while SSR showed the second.
Set unique invocation numbers during server component renders, mirroring
what the client driver does in beginRender/endRender. Both
renderComponentFramed (nested components) and runFullFramedPass (root
component) now bracket their body invocations with
setSignalDeclarationInvocation, giving each server render a nonzero
invocation so the existing presented guard fires correctly.1 parent ae34b18 commit e78631c
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
| |||
5185 | 5187 | | |
5186 | 5188 | | |
5187 | 5189 | | |
| 5190 | + | |
5188 | 5191 | | |
5189 | 5192 | | |
5190 | 5193 | | |
| |||
5258 | 5261 | | |
5259 | 5262 | | |
5260 | 5263 | | |
| 5264 | + | |
5261 | 5265 | | |
5262 | 5266 | | |
5263 | 5267 | | |
| |||
8965 | 8969 | | |
8966 | 8970 | | |
8967 | 8971 | | |
| 8972 | + | |
8968 | 8973 | | |
8969 | 8974 | | |
8970 | 8975 | | |
| |||
8985 | 8990 | | |
8986 | 8991 | | |
8987 | 8992 | | |
| 8993 | + | |
8988 | 8994 | | |
8989 | 8995 | | |
8990 | 8996 | | |
| |||
0 commit comments