Skip to content

Support prototype-named component store keys - #8347

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-component-store-prototype-names
Open

Support prototype-named component store keys#8347
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-component-store-prototype-names

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem

The component Store keeps five public component-name/ID registries in ordinary objects. Names such as toString and __proto__ therefore resolve inherited values: lazy registration can be skipped, unregistered props/instances/wrapped components appear present, and normal store/retrieve operations return incorrect data.

Fix

Initialize all five key registries without Object prototypes. This preserves the existing string-key API and constant-time lookups while making every public component name and ID an independent own key.

Breaking changes

None. Previously broken names now behave like ordinary component names and IDs.

Test plan

  • Added parameterized toString and __proto__ regressions covering initial absence and normal store/retrieve behavior for props, component providers, instances, and wrapped components.
  • Exact baseline fails both parameterized cases; fixed focused suite passes 17/17.
  • Full yarn test-js passes: 38 suites, 397 tests; 11 suites/59 tests remain intentionally skipped.
  • Bob module/type builds and git diff --check pass.
  • Focused ESLint has no errors; its one no-shadow warning is pre-existing in an unchanged callback test.

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.

1 participant