Skip to content

Conversation

@jamieomaguire
Copy link
Contributor

@jamieomaguire jamieomaguire commented Mar 18, 2025

Screenshot 2025-04-03 at 14 55 34

Describe your changes (can list changeset entries if preferable)

  • Creates a new custom decorator that wraps around the CustomElement decorator provided by Lit.
  • The reason for this is that we want to only attempt to register the custom element if it has not already been registered on the page. Failing to do this can result in runtime errors due to duplicate registrations.
  • We previously did this using a custom function, however we have found that in some SSR frameworks (hint, NextJS), this causes some problems with multiple Lit bundles.
  • For whatever reason, using the Lit CustomElement decorator prevents this issue. So this change is an attempt at combining both approaches

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /test-aperture command.
  • I have filled out the DS Review Tracker checklist (Moving PR to "Ready to Review")

Not-applicable Checklist items

Please move any Author checklist items that do not apply to this pull request here.

  • I have added thorough tests where applicable (unit / component / visual).

Testing

How do I test my changes?

Task Link
Aperture PR 🔗
NextJS 14 deployment 🔗
Nuxt 3 deployment 🔗
Vanilla deployment 🔗

Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1 @raoufswe

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • [-] If there are visual test updates, I have reviewed them.

Reviewer 2 - @fernandofranca

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • [-] If there are visual test updates, I have reviewed them.

@changeset-bot
Copy link

changeset-bot bot commented Mar 18, 2025

🦋 Changeset detected

Latest commit: 64abca6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 34 packages
Name Type
@justeattakeaway/pie-webc-core Minor
@justeattakeaway/pie-icons-webc Minor
@justeattakeaway/pie-assistive-text Minor
@justeattakeaway/pie-checkbox-group Minor
@justeattakeaway/pie-toast-provider Minor
@justeattakeaway/pie-cookie-banner Minor
@justeattakeaway/pie-lottie-player Minor
@justeattakeaway/pie-notification Minor
@justeattakeaway/pie-icon-button Minor
@justeattakeaway/pie-radio-group Minor
@justeattakeaway/pie-form-label Minor
@justeattakeaway/pie-text-input Minor
@justeattakeaway/pie-thumbnail Minor
@justeattakeaway/pie-checkbox Minor
@justeattakeaway/pie-textarea Minor
@justeattakeaway/pie-divider Minor
@justeattakeaway/pie-spinner Minor
@justeattakeaway/pie-button Minor
@justeattakeaway/pie-select Minor
@justeattakeaway/pie-switch Minor
@justeattakeaway/pie-modal Minor
@justeattakeaway/pie-radio Minor
@justeattakeaway/pie-toast Minor
@justeattakeaway/pie-card Minor
@justeattakeaway/pie-chip Minor
@justeattakeaway/pie-link Minor
@justeattakeaway/pie-tag Minor
@justeattakeaway/pie-breadcrumb Patch
@justeattakeaway/pie-list Patch
@justeattakeaway/pie-storybook Patch
@justeattakeaway/pie-webc Patch
wc-nuxt2 Patch
wc-react17 Patch
wc-react18 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jamieomaguire
Copy link
Contributor Author

/snapit

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@jamieomaguire
Copy link
Contributor Author

/test-aperture

@pie-design-system-bot
Copy link
Contributor

@jamieomaguire Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-cookie-banner@0.0.0-snapshot-release-20250318102028 --mode=update-lockfile
yarn up @justeattakeaway/pie-divider@0.0.0-snapshot-release-20250318102028 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20250318102028 --mode=update-lockfile

Then finally:

yarn install

@jamieomaguire
Copy link
Contributor Author

/snapit

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@jamieomaguire Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-assistive-text@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-breadcrumb@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-button@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-card@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-checkbox@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-checkbox-group@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-chip@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-cookie-banner@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-divider@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-form-label@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-icon-button@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-link@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-list@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-lottie-player@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-modal@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-notification@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-radio@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-radio-group@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-select@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-spinner@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-switch@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-tag@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-text-input@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-thumbnail@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-toast@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-toast-provider@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc-core@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile
yarn up @justeattakeaway/pie-icons-webc@0.0.0-snapshot-release-20250514110916 --mode=update-lockfile

Then finally:

yarn install

@jamieomaguire jamieomaguire self-assigned this May 14, 2025
@raoufswe raoufswe self-requested a review May 16, 2025 07:44
raoufswe
raoufswe previously approved these changes May 16, 2025
@jamieomaguire
Copy link
Contributor Author

/snapit

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@jamieomaguire Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-assistive-text@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-breadcrumb@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-button@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-card@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-checkbox@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-checkbox-group@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-chip@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-cookie-banner@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-divider@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-form-label@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-icon-button@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-link@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-list@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-lottie-player@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-modal@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-notification@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-radio@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-radio-group@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-select@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-spinner@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-switch@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-tag@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-text-input@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-thumbnail@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-toast@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-toast-provider@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc-core@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile
yarn up @justeattakeaway/pie-icons-webc@0.0.0-snapshot-release-20250520075727 --mode=update-lockfile

Then finally:

yarn install

@jamieomaguire jamieomaguire merged commit 07b8fca into main May 22, 2025
54 of 55 checks passed
@jamieomaguire jamieomaguire deleted the dsw-000-divider-decorator branch May 22, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment