Skip to content
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

CalciteFlowItem.showBackButton causes type error in public types #10801

Closed
2 of 6 tasks
maxpatiiuk opened this issue Nov 20, 2024 · 2 comments
Closed
2 of 6 tasks

CalciteFlowItem.showBackButton causes type error in public types #10801

maxpatiiuk opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. estimate - 1 Very small fix or change (potentially a single line), doesn't require updates to tests. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@maxpatiiuk
Copy link
Member

Check existing issues

Actual Behavior

Consuming Calcite's dev branch typings in JS API produces this TypeScript error:

node_modules/@esri/calcite-components/dist/components/calcite-flow/interfaces.d.ts:3:61 - error TS2344: Type '"selected" | "setFocus" | "beforeBack" | "menuOpen" | "showBackButton"' does not satisfy the constraint 'keyof HTMLCalciteFlowItemElement'.
  Type '"showBackButton"' is not assignable to type 'keyof HTMLCalciteFlowItemElement'.

3 export type FlowItemLike = Pick<HTMLCalciteFlowItemElement, "beforeBack" | "menuOpen" | "setFocus" | "showBackButton" | "selected">;

The showBackButton property is marked as private, which makes it excluded from public typings:

/**
* When `true`, displays a back button in the component's header.
*
* @private
*/
@property() showBackButton = false;

Solutions:

  1. (easy) Mark the showBackButton as @internal rather than @private - it will still be present in the typings, but you can can be excluded when rendering the public documentation.
  2. Update the FlowItemLike interface to not rely on showBackButton (or at least not in the way that produces a typescript error when that property is absent)

Expected Behavior

Do not produce TypeScript errors when consuming Calcite typings in a project that has "skipLibCheck": false

Reproduction Sample

(JS API PR 66756)

Reproduction Steps

Simplest way to reproduce is to comment out the showBackButton property from the CalciteFlowItem component to simulate how it would appear in the public typings.

Otherwise, you can try npx build:ts on the calcite-lumina branch in JS API (PR 66756)

Reproduction Version

3.0.0-next.12

Relevant Info

No response

Regression?

No response

Priority impact

impact - p1 - need for current milestone

Impact

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Maps SDK for JavaScript

@maxpatiiuk maxpatiiuk added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Nov 20, 2024
@github-actions github-actions bot added ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone labels Nov 20, 2024
@jcfranco jcfranco self-assigned this Nov 20, 2024
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 1 Very small fix or change (potentially a single line), doesn't require updates to tests. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Nov 20, 2024
jcfranco added a commit that referenced this issue Nov 20, 2024
**Related Issue:** #10801

## Summary

Restores internal prop that was unintentionally made private by #10482.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Nov 20, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Nov 20, 2024
Copy link
Contributor

Installed and assigned for verification.

@DitwanP
Copy link
Contributor

DitwanP commented Nov 20, 2024

🍡 Verified.

@DitwanP DitwanP closed this as completed Nov 20, 2024
@DitwanP DitwanP added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. estimate - 1 Very small fix or change (potentially a single line), doesn't require updates to tests. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

4 participants