Open
Conversation
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the summary. Please try again in a few hours by commenting |
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
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.
Feature
Migrate internal Stencil web components to plain functional components to reduce the
dist/web-componentsbundle size.Root cause
Every component decorated with
@Component({ tag: 'mvx-...' })gets registered as a custom element and included in the web components bundle, even when the component is only used internally. Internal components — those never consumed directly bymx-sdk-dapp,mx-wallet-dapp, ormx-template-dapp— don't need to be web components.Fix
Converted 36 internal components from Stencil class components (
@Component+@Prop+render()) to plain exported functions. Parents were updated to import and call these functions directly instead of using custom element tags.Groups migrated:
src/assets/icons/—arc-extension-provider-icon,arrow-right-icon,brave/edge/firefox/extension-provider-icon,circle-info-icon,default-transaction-icon-large/small,ledger-icon,ledger-provider-icon,magnifying-glass-icon,metamask-provider-icon,multiversx-logo/symbol-icon,passkey-provider-icon,shard-icon,spinner-icon,wallet-connect-app-gallery/store/google-play-icon,wallet-provider-icon,xportal-download-qr-icon,xportal-qr-code-preloadertransaction-toast,transaction-toast-content,transaction-toast-details,transaction-toast-details-body,transaction-toast-progresskept as@Component(requires lifecycle hooks),simple-toast,generic-toast,custom-toastwallet-connect-download,wallet-connect-scanledger-confirm,ledger-introtooltip(wrapper),preloader,pagination,pagination-ellipsis,pagination-ellipsis-formState management approach for migrated components with internal state:
Components that had
@State()(e.g.transaction-toast-detailsexpand/collapse, tooltips) were handled by:isTooltipVisible+onVisibilityChangedown from the nearest@State-capable ancestor (class components likeaddress-table,data-with-explorer-link,transactions-table)Mapkeyed bytoastId+onForceUpdatecallback for toast-scoped state (transaction-toast-details,MvxTooltipin toast content)mvx-transaction-toast-progresswas intentionally left as a@Componentclass because it requirescomponentDidLoad,disconnectedCallback, and@Watchlifecycle hooks for itssetInterval-based animation.Additional changes
<mvx-xxx />JSX with direct function imports<XxxComponent />common/LedgerIntro/LedgerIntro.tsxupdated to useLedgerIconfunction directlyexplorer-link.spec.ts: removed unusedArrowRightIconimportContains breaking changes
[x] No
The exported web components API (
mvx-*custom element tags consumed externally) is unchanged. Only internal composition changed.Updated CHANGELOG
[] Yes
Testing
[x] User testing
[x] Unit tests
All 130 unit/e2e tests pass. Build produces clean output.
Bundle size:
dist/web-componentsreduced from 2.1 MB → 1.1 MB (~48% reduction).