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 Temporals API #115

Closed
wants to merge 37 commits into from

Conversation

logaretm
Copy link
Member

@logaretm logaretm commented Jan 25, 2025

This pull request introduces several significant changes to the i18n (internationalization) and calendar functionalities within the packages/core module. The most important changes include the addition of new dependencies, enhancements to locale handling, and the introduction of new calendar-related utilities.

Enhancements to locale handling:

Calendar-related utilities:

New dependencies:

Additional changes:

Copy link

changeset-bot bot commented Jan 25, 2025

⚠️ No Changeset found

Latest commit: 37c55d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@logaretm logaretm changed the base branch from 87-date-fields to main January 25, 2025 16:29
@logaretm logaretm changed the base branch from main to 87-date-fields January 25, 2025 16:29
@logaretm logaretm force-pushed the 87-date-fields-with-temporals branch 2 times, most recently from e44886d to c7e114d Compare January 28, 2025 19:43
@logaretm logaretm changed the title feat: Experiment with temporals for date fields feat: Implement useDateField Jan 28, 2025
@logaretm logaretm changed the title feat: Implement useDateField feat: Implement useDateField and useCalendar Jan 28, 2025
@logaretm logaretm changed the base branch from 87-date-fields to main January 28, 2025 22:10
@logaretm logaretm force-pushed the 87-date-fields-with-temporals branch from ef1db9b to 4024641 Compare February 3, 2025 22:48
@logaretm logaretm force-pushed the 87-date-fields-with-temporals branch from d189c1a to f01a5ad Compare February 8, 2025 19:16
@logaretm logaretm linked an issue Feb 11, 2025 that may be closed by this pull request
@logaretm logaretm changed the title feat: Implement useDateField and useCalendar feat: Implement useDateField and useCalendar with Temporals API Feb 13, 2025
@logaretm logaretm changed the title feat: Implement useDateField and useCalendar with Temporals API feat: Implement useDateField with Temporals API Feb 13, 2025
@logaretm
Copy link
Member Author

Closing this in favor of #132

We will switch the implementation to use @internationalized/date instead. The 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.

@logaretm logaretm closed this Feb 13, 2025
@logaretm logaretm removed a link to an issue Feb 19, 2025
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.

1 participant