-
Notifications
You must be signed in to change notification settings - Fork 282
fix: remove dependencies for TSX components and fix features #10449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pskelin
approved these changes
Jan 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Deprecate
dependenciesin@customElementBackground
When
jsxRendereris used, scoping comes out of the box when dependencies are used as components in the.tsx(f.e.<Button>), and was never supported if they were used directly as tags (f.e.<ui5-button>) anyway.Additionally, components no longer await for their dependencies to be defined (since chore: call customElements.define synchronously #9857)
This makes the
dependenciesoption in@customElementrelevant only for the scoping functionality oflitRendererand can be discarded for all JSX-based components.Features
The TSX rework made features' dependencies hard dependencies of the respective components via the templates, thus defeating the purpose of features (to load less dependencies when the feature is not needed).
This change fixes this by extracting the feature-relevant part of the template and moving it into the feature itself. Affected components:
Input.tsColorPicker.tsAdditionally,
Toolbar.tsno longer aggregates the dependencies of its items as this comes out of the box now. @dobrinyonkovHandling components that import their own items
Some components automatically import their items (f.e.
Wizard.ts->WizardStep.ts) to facilitate users.These components used
dependenciesfor that purpose by declaring their item as a dependency. With this change the item is imported as an unnamed import (f.e.import "./WizardStep.js")Note: the
ComboBox.tscomponent imports both its item, relying on the side effect (per documentation / API contract) and also its item's "instanceof" function, thus requiring two imports of the same module. Otherwise, the item will be tree-shaken.Breaking changes
This change fixes some bugs - a few components used to import items they should not have imported. If an application relied on such a bug, and did not import the component explicitly, it will break:
The side navigation group was imported by side navigation, which was a bug (users may want to have no groups, only normal items/subitems), and was missing from the bundle. @TeodorTaushanov
The calendar legend was imported by calendar, which was a bug (users may want to have no legend), and was missing from the bundle. @tsanislavgatev