-
-
Notifications
You must be signed in to change notification settings - Fork 458
Allow TimeZoneProvider to be configurable via the ContextBuilder #4447
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
base: main
Are you sure you want to change the base?
Conversation
Test262 conformance changes
Fixed tests (53):
|
NOTE: the tests are not from this PR, but the |
There was a problem hiding this 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! :)
#[cfg(feature = "temporal")] | ||
pub(crate) fn tz_provider(&self) -> &impl TimeZoneProvider { | ||
&self.tz_provider | ||
pub(crate) fn timezone_provider(&self) -> &impl TimeZoneProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expose this as &dyn TimeZoneProvider
instead, which avoids the additional generic (impl
)
} | ||
} | ||
|
||
/// The `DynamicTimeZoneProvider` is a wrapper type that allows users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use Box<dyn TimeZoneProvider>
directly instead? We don't need a wrapper in this case, since the provider is only accessible within the crate
There was a problem hiding this 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
?
Probably blocked on boa-dev/temporal#599 |
This is related to work on #1804
It changes the following:
DynamicTimeZoneProvider
.TimeZoneProvider
onContextBuilder
.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.