-
Notifications
You must be signed in to change notification settings - Fork 364
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
upcoming: [M3-8638] - Introduce the new (at)linode/ui
package
#11057
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized this was a draft 🤦 Going to leave this early feedback so it doesn't get lost but will wait to continue reviewing, sorry about that!
packages/ui/.eslintrc.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from packages/api-v4/.eslintrc.json
@linode/ui
package(at)linode/ui
package
packages/ui/.prettierrc
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from packages/api-v4/.prettierrc
padding: 0, | ||
}, | ||
fontSize: '0.625rem', | ||
fontFamily: '"LatoWebBold", sans-serif', // TODO: remove hardcoded font once theme is added to this package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theme.font
is a custom declaration from our theme.ts file
(at)linode/ui
package(at)linode/ui
package
(at)linode/ui
package(at)linode/ui
package
packages/ui/src/components/Chip.tsx
Outdated
* Optional component to render instead of a span. | ||
*/ | ||
component?: React.ElementType; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something we should address in a follow-up. I don't remember why we ever needed this abstraction, but the _ChipProps
already has component
as part of it's type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured this was small enough to include in this PR 07e44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Importing components from this package into Cloud Manager works as expected - confirmed chips look good
- Type checking passes
- All unit tests pass - left a ❓ about running tests locally
- Release scripts continue to work as expected with this package (changelog, package versions) - no issues other than what Jaalah already noted 👍🏼
- CI passes -- the package passes typechecking and unit testing
packages/ui/vitest.config.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor and non-blocking: Is there anything we can change in our root package.json
to be able to run tests from both manager and ui packages? (Edit: yeah, yarn workspace linode-manager test && yarn workspace @linode/ui test
should do it.)
It looks like we have "test": "yarn workspace linode-manager test"
configured in the root package.json
scripts, but when I ran yarn test
from the root, I was only seeing manager
tests run.
Navigating into the ui
package and running yarn test
from there worked as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some reservations about &&
ing these two commands together since it might make it hard to read the output of the test command. For example, failing Manager tests would be hidden somewhere in the middle of the command output.
I wonder if there is a way to instruct vitest
to run both test suites as if they are one -- curious if @bnussman-akamai has any suggestions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also am anti-&&
I think we should just use commands like yarn test:manager
and yarn test:ui
I don't really know of anything else more elegant we can do 🫤
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, failing Manager tests would be hidden somewhere in the middle of the command output.
@hkhalil-akamai Could you elaborate on what you mean by this? Wouldn't the commands run in order -manager
tests would run first and ui
tests would run second? That's what I was seeing when I ran it that way, at least.
Using separate commands is okay with me, though - I do just eventually want a way to run all the tests from the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General setup looks good!
I do think our themes should move to this package, but I imagine that requires some significant changes. We can do this as soon as it's feasible
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a job that typechecks the new UI package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Side note: why don't we typecheck the api-v4 and validation packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build steps for api-v4 and validation (build-validation
, build-sdk
) inherently type-check because they run tsc
during the build process
e23a7fa
to
45078a5
Compare
Test failures in CI are not related to this PR; merging this on Hussain's behalf. |
Cloud Manager E2E Run #6655
Run Properties:
|
Project |
Cloud Manager E2E
|
Run status |
Failed #6655
|
Run duration | 27m 43s |
Commit |
dbf2e0c067: upcoming: [M3-8638] - Introduce the new `(at)linode/ui` package (#11057)
|
Committer | Hussain Khalil |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
1
|
Flaky |
2
|
Pending |
2
|
Skipped |
0
|
Passing |
429
|
Tests for review
cypress/e2e/core/placementGroups/delete-placement-groups.spec.ts • 1 failed test
Test | Artifacts | |
---|---|---|
Placement Group deletion > can delete with Linodes assigned when unexpected error show up and retry |
Screenshots
Video
|
clone-linode.spec.ts • 1 flaky test
Test | Artifacts | |
---|---|---|
clone linode > can clone a Linode from Linode details page |
Screenshots
Video
|
rebuild-linode.spec.ts • 1 flaky test
Test | Artifacts | |
---|---|---|
rebuild linode > cannot rebuild a provisioning linode |
Screenshots
Video
|
Description 📝
Introduces the new
@linode/ui
package, which will host our shared UI component library. The package also supports unit tests viavitest
and will eventually become the home of our Storybook declarations.This is the first step in our modularization effort. These components will eventually be published and used outside of Cloud Manager, such as in downstream microfrontends. Therefore, they need to function independently of any tools, utilities or components specific to Cloud Manager.
The package must support unit testing through
vitest
. Existing unit tests will be migrated alongside their associated components.Storybook and all storybook declarations will also eventually be hosted from this package.
Changes 🔄
@linode/ui
packagegenerate-changelog
andpackage-version
scripts to include this packageci.yml
to typecheck and test this packageChip
andBetaChip
components to demonstrate the usage of this packageHow to test 🧪