refactor: freeze components after create and use copy_with for mutations

FA
2h ago
+1089-540

Components are now immutable after construction (children stored as tuples, setattr blocks writes outside a small cache allowlist). Compile-time edits go through a new copy_with() helper instead of mutating shared instances, replacing the PageContext.own() page-local clone mechanism so components can be safely reused across pages without deep copies.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

fixes #6214
fixes ENG-9146