Skip to content

fix(tsx): dispose entry mounts for view exports - #1003

Merged
houko merged 1 commit into
mainfrom
assess/issue923-view-export
Nov 20, 2026
Merged

houko merged 1 commit into
mainfrom
assess/issue923-view-export

Conversation

@houko

@houko houko commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • track owners created by the entry module's mount helper
  • dispose mounted roots before rendering View.Export, removing their nodes and stopping effects, handlers, timers and animation frames
  • add a regression test proving an entry-mounted timer cannot update the exported view

Verification

  • go test ./tsx -run 'TestViewExportDisposesEntryMount|TestViewRendersNamedExportsWithIndependentState|TestViewRunsAVerifiedPackage' -count=1

Closes #923

@github-actions github-actions Bot added size/S tsx bug Something isn't working labels Nov 20, 2026
@houko
houko force-pushed the assess/issue923-view-export branch 2 times, most recently from bfdc2da to 52f3acc Compare November 20, 2026 15:02
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 20, 2026
@houko
houko force-pushed the assess/issue923-view-export branch from 52f3acc to 9466b8c Compare November 20, 2026 15:07
@github-actions github-actions Bot added the conflict Conflicts with the base branch; resolve it first label Nov 20, 2026
@houko
houko force-pushed the assess/issue923-view-export branch from 9466b8c to 57b508f Compare November 20, 2026 16:13
@houko

houko commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed.

  • Tracking timers only during the mount's first render still leaked: a requestAnimationFrame loop and an interval set from a microtask kept running (the strengthened test failed with "export 0 1 1").
  • Replaced it with the issue's second proposal: in a view of an export, mount neither renders nor runs its component and returns a no-op, so nothing it would set up exists.
  • Updated the View.Export docs (en, zh) and added the CHANGELOG bullet; ./tsx passes (220) and web and linux vet clean.

@houko
houko merged commit 30fa468 into main Nov 20, 2026
@houko
houko deleted the assess/issue923-view-export branch November 20, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working conflict Conflicts with the base branch; resolve it first documentation Improvements or additions to documentation size/S tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsx: rendering a View's Export leaves what the entry module mounted running

1 participant