refactor: do not use Host in functional components#10352
Conversation
| delete props.level; | ||
|
|
||
| return ( | ||
| <HeadingTag class={props.class} key={props.key} level={props.level}> |
There was a problem hiding this comment.
level prop doesn't seem to exist in the DOM?
was it used for styling or testing? if not, we should remove it
There was a problem hiding this comment.
I think this is fine to remove. @driskull Can you confirm?
There was a problem hiding this comment.
jcfranco
left a comment
There was a problem hiding this comment.
Thanks for the PR, @maxpatiiuk!
Since some additional refactors were made to files unrelated to avoiding using host in functional components, can you either:
- separate non-Host-related refactors to a separate PR?
- update the PR title to convey all PR changes?
Thanks!
| delete props.level; | ||
|
|
||
| return ( | ||
| <HeadingTag class={props.class} key={props.key} level={props.level}> |
There was a problem hiding this comment.
I think this is fine to remove. @driskull Can you confirm?
jcfranco
left a comment
There was a problem hiding this comment.
Thanks for the PR, @maxpatiiuk!
Since some additional refactors were made to files unrelated to avoiding using host in functional components, can you either:
- separate non-Host-related refactors to a separate PR?
- update the PR title to convey all PR changes?
Thanks!
Lumina does not have a `<Host>` element, but there is an equivalent syntax. The codemod can take care of migrating to the alternative syntax, as long as the `<Host>` element appears in the `render()` methods. This PR moves the `<Host>` element from the `<List>` functional component into the parent `render()` methods. With this change, all `<Host>` elements in Calcite's codebase are migrated automatically.
d16144b to
53cae99
Compare
|
Moved non-Host changes into #10356 |
|
Test failed on the CI but passed locally. Do you commonly experience flakiness with e2e tests? Do you know what are the main sources of flakiness in your tests? Is this something that can be addressed during migration to Vitest browser mode? |
jcfranco
left a comment
There was a problem hiding this comment.
🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊
🌊🌊🦈🦈🦈🌊🦈🦈🦈🦈🌊🦈🌊🌊🌊🌊🌊🦈🌊🌊🦈🦈🦈🌊🌊🦈🦈🌊🌊🦈🌊🌊🌊🦈🌊🦈🦈🦈🦈🌊🦈🌊
🌊🌊🌊🦈🌊🌊🦈🌊🌊🦈🌊🦈🌊🌊🌊🌊🌊🦈🌊🦈🌊🌊🌊🌊🦈🌊🌊🦈🌊🦈🦈🌊🦈🦈🌊🦈🌊🌊🌊🌊🦈🌊
🌊🌊🌊🦈🌊🌊🦈🦈🦈🦈🌊🦈🌊🌊🦈🌊🌊🦈🌊🌊🦈🦈🌊🌊🦈🌊🌊🦈🌊🦈🌊🦈🌊🦈🌊🦈🦈🦈🌊🌊🦈🌊
🌊🦈🌊🦈🌊🌊🦈🌊🌊🦈🌊🦈🌊🦈🌊🦈🌊🦈🌊🌊🌊🌊🦈🌊🦈🌊🌊🦈🌊🦈🌊🌊🌊🦈🌊🦈🌊🌊🌊🌊🌊🌊
🌊🌊🦈🦈🌊🌊🦈🌊🌊🦈🌊🌊🦈🌊🌊🌊🦈🌊🌊🦈🦈🦈🌊🌊🌊🦈🦈🌊🌊🦈🌊🌊🌊🦈🌊🦈🦈🦈🦈🌊🦈🌊
🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊
We have experienced test flakiness. Hard to pinpoint the main source, but here are some culprits:
We're actively working on stabilizing tests. When we identify a flaky one, we skip it and create a follow-up issue to restore it. By the way, would you mind sharing the flaky test you encountered? We can take a closer look at it. |
|
Thanks for the info! The flaky test: Link to error message: @esri/calcite-components:test: expect(received).toBe(expected) // Object.is equality
@esri/calcite-components:test:
@esri/calcite-components:test: Expected: "tel"
@esri/calcite-components:test: Received: "decimal"
@esri/calcite-components:test:
@esri/calcite-components:test: 145 |
@esri/calcite-components:test: 146 | expect(input.getAttribute("autofocus")).toBe("");
@esri/calcite-components:test: > 147 | expect(input.getAttribute("inputmode")).toBe(testInputMode);
@esri/calcite-components:test: | ^
@esri/calcite-components:test: 148 | expect(input.getAttribute("enterkeyhint")).toBe(testEnterKeyHint);
@esri/calcite-components:test: 149 | });
@esri/calcite-components:test: 150 |
@esri/calcite-components:test:
@esri/calcite-components:test: at Object.<anonymous> (src/components/input/common/tests.ts:147:45)
Do you "skip" the test in a separate pull request or in the pull request where the flakiness was identified? |
…tracking * origin/dev: (40 commits) feat: add parcel parameter (#10384) feat(alert): apply --calcite-alert-corner-radius to internal close button (#10388) feat(dialog, panel): Add css properties for background-color (#10387) fix: remove aria-disabled from components where necessary (#10374) feat(action-group, block, panel): add `menuPlacement` and `menuFlipPlacements` properties (#10249) fix(list, filter): fix sync between list items and filtered data (#10342) feat(popover): apply component tokens to arrow (#10386) feat(list-item): add `unavailable` property (#10377) fix(segmented-control): honor appearance, layout and scale when items are added after initialization (#10368) fix(action-pad): fix horizontal action group alignment (#10359) fix(combobox): selection-mode="single-persist" correctly selects an item when items have same values (#10366) fix(input-time-zone): fix region mode labeling and value mapping (#10345) fix(dropdown): open dropdown on `ArrowDown` & `ArrowUp` keys (#10264) refactor(components): reduce post-migration TypeScript errors (#10356) refactor: do not use Host in functional components (#10352) refactor(tests): reduce TypeScript errors (#10344) feat(alert): add component tokens (#10218) fix(card): properly handle slotted elements (#10378) refactor(panel): remove duplicate tailwind class (#10379) feat(popover, action): add component tokens (#10253) ...
Generally, we skip in a separate PR. We have some info on this in our testing conventions. |
…estone-estimates * origin/dev: (29 commits) fix(input-time-zone): fix region mode labeling and value mapping (#10345) fix(dropdown): open dropdown on `ArrowDown` & `ArrowUp` keys (#10264) refactor(components): reduce post-migration TypeScript errors (#10356) refactor: do not use Host in functional components (#10352) refactor(tests): reduce TypeScript errors (#10344) feat(alert): add component tokens (#10218) fix(card): properly handle slotted elements (#10378) refactor(panel): remove duplicate tailwind class (#10379) feat(popover, action): add component tokens (#10253) chore(t9n): add translations (#10339) feat: add 3d building, 3d building parameter, divide, parcel, spaces, spaces parameter, square brackets x, n variable, zoning parameter (#10373) build: update browserslist db (#10370) ci: resolve husky pre-push and pre-commit errors (#10365) docs: update component READMEs (#10371) feat(text-area): add component tokens (#10343) fix(action): prefer `disabled` in favor of `aria-disabled` (#10367) docs(a11y): add reference to a11y guidance to issue template (#10372) chore(action): add new string for accessible indicator label (#10360) feat(chip): add component tokens (#10179) feat(avatar): add component tokens (#10280) ...
Lumina does not have a
<Host>element, but there is an equivalent syntax.The codemod can take care of migrating to the alternative syntax, as long as the
<Host>element appears in therender()methods.This PR moves the
<Host>element from the<List>functional component into the parentrender()methods.With this change, all
<Host>elements in Calcite's codebase are migrated automatically.