-
Notifications
You must be signed in to change notification settings - Fork 87
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
[NO-TICKET] Upgrade day picker #2920
Conversation
@dmethvin-gov, while it could indeed be a problem with Storybook, have you tried the upgraded component outside the context of Storybook? Like running it in one of the projects in the |
@pwolfert This PR upgrades Storybook, so doing that didn't help. The As for examples, the |
I've at least been able to narrow down the issue a little bit in my investigations so far. Looks like it works in React and not Preact. |
Narrowed it down to something that happened in that library between |
It seems like the most likely commit to have caused the problem is gpbl/react-day-picker@f3327c9 because most everything else was dependency updates or minor changes. (diff of the two versions) That would also make some sense because it's changing the way imports are done, along with several other settings changes. (tsconfig reference) There's a preact issue that sounds like it might be similar, but that one in particular is about Vite. |
I was thinking the same thing, that it was the removal of the React imports and changing of the JSX transform implementation, but I hadn't gathered enough evidence or figured out a way forward. Even though we still support React 16, I tried changing our JSX transform settings in the repo yesterday, but I still wasn't able to get it to work right. I see in the issue you linked to that someone had a Vite config setting for Storybook 7.6 that seemed to work. We could go down that road of discovery to see if it fixes it. |
Another interesting thing I just found is that the current version of our |
Noting here for context that upgrading to react-day-picker v8.10 is necessary to be able to upgrade date-fns to v3.0 so that that dependency supports ES Modules. Without that, modern build systems that need ES Modules support can't build a project that uses |
Putting this note here because it's related: If we wanted to be able to switch to the new JSX transform, I found the minimum requirements:
|
Update: I've made a pull request to fix the issue upstream in |
The pull request has been merged and released! I'm going to follow up on this tomorrow. |
Succeeded by the pull request linked above |
Summary
This is the current state of my attempt to upgrade react-day-picker. There is some problem in Storybook where it crashes, see below. I'm making a PR to see how it does on the rest of the tests.
In trying to revive Storybook I upgraded the version, the one currently being used is an alpha.
How to test
yarn storybook
and go to the SingleInputDateField, with Picker. Click the button.Checklist
[WNMGDS-####] Title
or [NO-TICKET] if this is unticketed work.Type
(only one) label for this PR, if it is a breaking change, label should only beType: Breaking
Impacts
, multiple can be selected.If this is a change to design:
If this is a change to code:
yarn test:unit:update
) and browser-test snapshots (yarn test:browser:update
)If this is a change to documentation: