Skip to content

Allow TimeZoneProvider to be configurable via the ContextBuilder#4447

Merged
nekevss merged 5 commits into
mainfrom
dynamic-tz-provider
Oct 31, 2025
Merged

Allow TimeZoneProvider to be configurable via the ContextBuilder#4447
nekevss merged 5 commits into
mainfrom
dynamic-tz-provider

Conversation

@nekevss
Copy link
Copy Markdown
Member

@nekevss nekevss commented Sep 26, 2025

This is related to work on #1804

It changes the following:

  • Implements a DynamicTimeZoneProvider.
  • Adds a method for setting a custom TimeZoneProvider on ContextBuilder.

This is related to the general API, so please feel free to let me know if you think this is the wrong approach.

Assuming we're happy with the result of this PR and its merged, I would be fine removing Temporal from the experimental feature flags for the next release. We still need to figure out a good way to make reading the host system time zone accessible, but that's still an odd aspect of the specification itself.

@nekevss nekevss added the A-API Changes related to public APIs label Sep 26, 2025
@nekevss nekevss requested a review from a team September 26, 2025 22:19
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 26, 2025

Test262 conformance changes

Test result main count PR count difference
Total 50,595 50,595 0
Passed 47,678 47,678 0
Ignored 2,036 2,036 0
Failed 881 881 0
Panics 0 0 0
Conformance 94.23% 94.23% 0.00%

@nekevss
Copy link
Copy Markdown
Member Author

nekevss commented Sep 26, 2025

NOTE: the tests are not from this PR, but the upsert PR

Copy link
Copy Markdown
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Nice work! Looks good to me! :)

Comment thread core/engine/src/context/mod.rs Outdated
Comment thread core/engine/src/context/time.rs Outdated
Copy link
Copy Markdown
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Looking nice! Though, I have some suggestions.

Also, it seems like we expose this as the timezone_provider, but the trait is called TimeZoneProvider, so it might be better to expose it as the time_zone_provider?

@jedel1043
Copy link
Copy Markdown
Member

Probably blocked on boa-dev/temporal#599

@jedel1043
Copy link
Copy Markdown
Member

This is unblocked now

@nekevss nekevss force-pushed the dynamic-tz-provider branch from 0952a79 to a31e5be Compare October 31, 2025 15:36
@nekevss nekevss force-pushed the dynamic-tz-provider branch from 03327d3 to 8904d71 Compare October 31, 2025 16:11
@nekevss nekevss requested a review from jedel1043 October 31, 2025 16:12
@nekevss nekevss added this to the v1.0.0 milestone Oct 31, 2025
Ok(self)
}

/// Set the [`timezone_provider::provider::TimeZoneProvider`] that should be used to source
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/timezone/time_zone
It is also in other places such as the name of the getter in Context or the debug implementation of ContextBuilder and Context.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've gone back and forth on this (partially why the name is different). I think timezone_provider makes sense for consistency with the crate, but there is also a good argument for time_zone_provider as that is what is implied by the pascal case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer timezone_provider imo, it looks nicer lol

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's what I went with too. 🤣 Something about time_zone_provider just does not seem right.

@nekevss nekevss requested a review from jedel1043 October 31, 2025 17:17
Copy link
Copy Markdown
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

LGTM

@nekevss nekevss added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit 035af5d Oct 31, 2025
17 checks passed
@nekevss nekevss deleted the dynamic-tz-provider branch October 31, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-API Changes related to public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants