fix(withExtensions): Performance refactor
Description
withExtensions currently runs on _construct for every instance of a component class. This updates the extension creation process to only modify component prototypes, so the createExtensions workflow only needs to run once for all instances of a component class.
- Adds additional tests
- Adds a note to the readme about the
_constructhook not being supported in extensions. This is not a new limitation, it was just previously not documented. - Adds timestamp to theme when processed for tracking purposes
- Also question: there are technically some type changes, but only on underscored methods. Let me know how we semver that?
- Note on subtheme: I don't believe the current versions handles running the cleanup methods on subtheme events, so I haven't gotten into that. May be an outstanding feature?
Testing
Tricky to test this in open source repo... Need to apply some extensions and make sure they are functioning properly.
Checklist
- [x] all commented code has been removed
- [x] any new console issues have been resolved
- [x] code linter and formatter has been run
- [x] test coverage meets repo requirements
- [x] PR name matches the expected semantic-commit syntax
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
Test Execution Passed.
I discovered a unique scenario in which it appears that when you expand a component beyond the boundaries of the UI component library, it may not consistently recognize the extension. For instance, in my application, I have a "TestTile" that extends the "Tile" component. When I apply a "FocusRing" extension to the "Surface," it sometimes fails to load as expected on "TestTile"
Closing, no recent updates.