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

[@next] port deprecated (2.x) button for backwards compatibility #454

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

DRiFTy17
Copy link
Collaborator

This change brings support for the "decorator" pattern for buttons that we used in the 2.x version to the 3.0 version. This is only for backwards compatibility and should be API-compatible with the 2.x implementation.

It allows for slotting native <button> elements in for backwards compatibility to ease the upgrade process:

<forge-deprecated-button>
  <button type="button">Decorated button</button>
</forge-deprecated-button>

This was ported from the 2.x version and integrated with design tokens (it uses the same styles from the new 3.0 button but with ::slotted() selectors instead and some minor overrides to match 2.x.

This is not a direct port from 2.x and it wasn't intended to be. The styles were moved to the shadow DOM, and it was integrated with the new state-layer and focus-indicators. This is purely for supporting slotted native <button> elements.

Consumers will need to opt-in to renaming their existing elements to <forge-deprecated-button> if they want to avoid sweeping their code.

@DRiFTy17 DRiFTy17 added minor Increment the minor version when merged @next labels Jan 19, 2024
@DRiFTy17 DRiFTy17 requested a review from a team as a code owner January 19, 2024 18:33
Copy link

stackblitz bot commented Jan 19, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

@MikeMatusz MikeMatusz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Probably should throw an @deprecated JSDoc tag on the component class/interface and define method. Curious if there'd be a good way to propagate that to the Angular modules via the schematic, too.

@DRiFTy17 DRiFTy17 added the skip-release Preserve the current version when merged label Jan 25, 2024
@DRiFTy17 DRiFTy17 merged commit ad38de0 into next Jan 25, 2024
9 checks passed
@DRiFTy17 DRiFTy17 deleted the next-deprecated-button-compat branch January 25, 2024 01:15
Copy link
Contributor

github-actions bot commented Feb 1, 2024

🚀 PR was released in v3.0.0-next.17 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged @next prerelease This change relates to a prerelease. skip-release Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants