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

feat: Implement useDateField with @internationalized/date #132

Merged
merged 73 commits into from
Feb 19, 2025

Conversation

logaretm
Copy link
Member

What

Swaps out the temporal implementation in #115 for @internationalized/date.

Why

While I loved working with temporals, the fact that they are not widely supported yet is not encouraging. I would have proceeded with them if they were at least Baseline supported.

My main reasons are:

  • Existing polyfill sizes are too much to justify the investment
    • @js-temporal/polyfill is 56.7kb gzipped.
    • temporal-polyfill is 20.5kb gzipped.
    • @internationalized/date is 10.9kb gzipped.
  • The question of what value type to use is muddied further.
    • Temporals while are great in serializing values, they cannot be used anywhere else. They need to be supported in Node.js and to be more common in the ecosystem as a whole.
    • Temporals won't probably be used by any developer today, so we are asking them to add a huge bundle size for little reason, especially those who are not interested in our i18n offering.
    • @internationalized/date is a little more common in the ecosystem and has utility outside formwerk use.

I think once temporals hit baseline, we will make that switch, its such a shame because it is a great API imo. Another alternative, is we find or fork or build a minimal version of the temporal spec and use it internally.

Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: 379b5cf

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

This PR includes changesets to release 1 package
Name Type
@formwerk/core Minor

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

@logaretm logaretm force-pushed the 87-with-internationalized branch from 9975e05 to a586c96 Compare February 15, 2025 00:23
@logaretm logaretm self-assigned this Feb 16, 2025
@logaretm logaretm force-pushed the 87-with-internationalized branch 2 times, most recently from 24a3b2d to 77f427f Compare February 16, 2025 11:41
Copy link

pkg-pr-new bot commented Feb 16, 2025

Open in Stackblitz

npm i https://pkg.pr.new/formwerkjs/formwerk/@formwerk/core@132

commit: f68dacb

@logaretm logaretm force-pushed the 87-with-internationalized branch from 77f427f to 987be85 Compare February 16, 2025 11:50
@logaretm logaretm force-pushed the 87-with-internationalized branch from 1389a79 to 1f1d7b7 Compare February 16, 2025 23:05
@logaretm logaretm merged commit 20001c5 into main Feb 19, 2025
5 checks passed
@logaretm logaretm deleted the 87-with-internationalized branch February 19, 2025 22:44
@logaretm logaretm linked an issue Feb 19, 2025 that may be closed by this pull request
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.

Date fields
1 participant