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

deps: Update @geometricpanda/storybook-addon-badges to v0.2.2 #687

Merged
merged 4 commits into from
Aug 24, 2022

Conversation

frankieyan
Copy link
Member

@frankieyan frankieyan commented Aug 23, 2022

Closes #678

Short description

This updates @geometricpanda/storybook-addon-badges to the latest version, because the previous version we were using has an older version of @storybook/theming as a dependency, which includes the non-React 18 compatible Emotion 10.

The interesting thing is that the newest version of addon-badges lists @storybook/[email protected] as a prod dependency without using the ^ semver range, but once installed in Reactist, the semver symbol is included, allowing it to use v6.5.3 and deduped between other dependencies that use the theming package. I have no idea why this happened though I've been looking at the wrong package.json the whole time in the repo. This is the correct one: https://github.com/geometricpanda/geometricpanda/blob/72ac16e6eb121480efccc426a4aac275d3b09b4d/libs/storybook-addon-badges/package.json#L40

image
image

The only remaining package that pulls in Emotion 10 is addon-knobs, which will be removed with #677

image

How the badges are styled were deprecated as well, and has been updated to the new API (ref).

Test plan

  • Test that running npm install on this branch results in the package tree above (same versions of @storybook/theming throughout, only one instance of @emotion/core left)
  • Run npm run storybook and check that the badges resembles the deployed docs at https://doist.github.io/reactist (it's by default positioned a little further away from the tabs which I thought looked better)
Before After
image image

PR Checklist

  • Added tests for bugs / new features
  • Updated docs (storybooks, readme)
  • Executed npm run validate and made sure no errors / warnings were shown
  • Described changes in CHANGELOG.md
  • Bumped version in package.json and package-lock.json (npm --no-git-tag-version version <major|minor|patch>) ref
  • Updated all static build artifacts (npm run build-all)

Versioning

No release needed

@frankieyan frankieyan requested review from a team and pawelgrimm and removed request for a team August 23, 2022 03:24
Copy link
Contributor

@pawelgrimm pawelgrimm left a comment

Choose a reason for hiding this comment

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

🚀 Looks great! 2 small nits, but I don't need to see this again.


✅ I ran npm explain @emotion/core and got this, so I think we're in good shape:

@emotion/[email protected] dev
node_modules/@emotion/core
@emotion/core@"^10.0.9" from [email protected]
node_modules/react-select👍
react-select@"^3.2.0" from @storybook/[email protected]
node_modules/@storybook/addon-knobs
dev @storybook/addon-knobs@"^6.3.1" from the root project

💭 (nit): The badge has more padding on the left than on the right:
image

.storybook/preview.js Outdated Show resolved Hide resolved
@frankieyan
Copy link
Member Author

💭 (nit): The badge has more padding on the left than on the right: image

@pawelgrimm the padding/margin around the badges are set here: https://github.com/geometricpanda/geometricpanda/blob/72ac16e6eb121480efccc426a4aac275d3b09b4d/libs/storybook-addon-badges/src/lib/blocks/badges.tsx#L57

I've tried setting layoutMargin on the theme (in .storybook/theme.js), but it doesn't seem to allow being overridden. Its type and docs also exclude it from create's config options. I tried to run the addon's storybook, but I ran into some errors on that end too. We can log an issue later so they can be aware of the issue though.

@frankieyan frankieyan merged commit c3c43a7 into main Aug 24, 2022
@frankieyan frankieyan deleted the frankie/addon-badge-react-18-compat branch August 24, 2022 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update storybook-addon-badges to React 18 compatible version
2 participants