You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a large PR, but it's mostly moving code out into packages. Due to the dependency tree, splitting this up would mean a lot of half-measures leading to this point, and more time to complete.
This PR splits types and mocks from each component package into their own packages. It also leverages a new Storybook mock manager to make composing stories standard (and easier).
TODO
READMEs
Documentation
Add tests
Why?
Jest tests and Storybook stories live alongside their subjects. This is fine when testing a single component in its own package, but when composing components in a parent, the parent package needs access to the mocks in the composed components. This means the composed component packages need to export their mocks. And that means the mocks (and all of their dependencies) become part of the bundle.
In #136245 I explored splitting things up to eliminate the dependencies. This PR uses the peer feedback and applies that proof-of-concept into a hardened approach.
How?
The /[package] directory becomes a folder, rather than the package.
Source code for the package is moved to [package]/impl.
All mocks are moved to [package]/mocks.
All types for a package are moved to [package]/types to be used in both [package]/impl and [package]/mocks.
[package]/mocks packages are then left out of the BUILD.bazel files for dependent packages.
Service and Prop types are re-exported from [package] for ease-of-use for consumers.
Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.
Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.
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
backport:skipThis PR does not require backportingimpact:criticalThis issue should be addressed immediately due to a critical level of impact on the product.loe:mediumMedium Level of Effortrelease_note:skipSkip the PR/issue when compiling release notesreviewTeam:SharedUXPlatform AppEx-SharedUX (formerly Global Experience) t//v8.5.0
5 participants
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.
Summary
This PR splits types and mocks from each component package into their own packages. It also leverages a new Storybook mock manager to make composing stories standard (and easier).
TODO
Why?
Jest tests and Storybook stories live alongside their subjects. This is fine when testing a single component in its own package, but when composing components in a parent, the parent package needs access to the mocks in the composed components. This means the composed component packages need to export their mocks. And that means the mocks (and all of their dependencies) become part of the bundle.
In #136245 I explored splitting things up to eliminate the dependencies. This PR uses the peer feedback and applies that proof-of-concept into a hardened approach.
How?
/[package]directory becomes a folder, rather than the package.[package]/impl.[package]/mocks.[package]/typesto be used in both[package]/impland[package]/mocks.[package]/mockspackages are then left out of theBUILD.bazelfiles for dependent packages.[package]for ease-of-use for consumers.Next up
NoDataPage.shared-ux-services.shared-ux-components.shared-ux-storybook.shared-ux-utility.