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

update Boa to be inline with Temporal #4034

Merged
merged 9 commits into from
Dec 5, 2024

Conversation

jasonwilliams
Copy link
Member

This PR brings Boa inline with the latest changes in Temporal

@jasonwilliams jasonwilliams added the Intl Changes related to the `Intl` implementation label Nov 10, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 4.42478% with 108 lines in your changes missing coverage. Please review.

Project coverage is 53.14%. Comparing base (6ddc2b4) to head (53e6da7).
Report is 308 commits behind head on main.

Files with missing lines Patch % Lines
...ore/engine/src/builtins/temporal/plain_date/mod.rs 0.00% 60 Missing ⚠️
...ngine/src/builtins/temporal/plain_month_day/mod.rs 0.00% 31 Missing ⚠️
core/engine/src/builtins/temporal/instant/mod.rs 40.00% 6 Missing ⚠️
...ore/engine/src/builtins/temporal/plain_time/mod.rs 0.00% 5 Missing ⚠️
...gine/src/builtins/temporal/plain_year_month/mod.rs 0.00% 4 Missing ⚠️
...ngine/src/builtins/temporal/plain_date_time/mod.rs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4034      +/-   ##
==========================================
+ Coverage   47.24%   53.14%   +5.90%     
==========================================
  Files         476      484       +8     
  Lines       46892    47735     +843     
==========================================
+ Hits        22154    25371    +3217     
+ Misses      24738    22364    -2374     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

Overall looks good to me! I have a couple of nits that I would prefer are addressed, but nothing that is necessarily blocking.

I think there were a couple more updates in the temporal_rs mainly around ZonedDateTime. Were these still in the work?

core/engine/src/builtins/temporal/plain_month_day/mod.rs Outdated Show resolved Hide resolved
core/engine/src/builtins/temporal/plain_date/mod.rs Outdated Show resolved Hide resolved
@jasonwilliams
Copy link
Member Author

@nekevss i've cleaned up the comments and rebased, ill look at zonedDateTime in a follow up PR

Copy link
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.

Just a small suggestion. Everything else looks good!

core/engine/src/builtins/temporal/plain_date/mod.rs Outdated Show resolved Hide resolved
jasonwilliams added a commit to boa-dev/temporal that referenced this pull request Nov 26, 2024
- md_record from parse_ixdtf is enough, we shouldn't need to fall back
to datetime parsing.
- from_str should lowercase the iso8601 (fixes tests)
- Support parsing the ISO string then getting the calendar from that.
- Support ref year

This is to support changes in boa-dev/boa#4034
Copy link
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.

Looks great! I have a couple of suggestions.

core/engine/src/try_into_js_result_impls.rs Outdated Show resolved Hide resolved
Comment on lines +317 to +345
let day = item
.get_v(js_string!("day"), context)
.expect("Day not found")
.to_i32(context)
.expect("Cannot convert day to i32");
let month = item
.get_v(js_string!("month"), context)
.expect("Month not found")
.to_i32(context)
.expect("Cannot convert month to i32");

let month_code = item
.get_v(js_string!("monthCode"), context)
.expect("monthCode not found");
let resolved_month_code = if month_code.is_undefined() {
None
} else {
TinyAsciiStr::<4>::from_str(
&month_code
.to_string(context)
.expect("Cannot convert monthCode to string")
.to_std_string_escaped(),
)
.map_err(|e| JsError::from(JsNativeError::range().with_message(e.to_string())))
.ok()
};
let year = item.get_v(js_string!("year"), context).map_or(1972, |val| {
val.to_i32(context).expect("Cannot convert year to i32")
});
Copy link
Member

Choose a reason for hiding this comment

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

Thought: this was already here, but I'm a bit worried that we're just expecting a lot of missing values instead of throwing errors.

Copy link
Member

Choose a reason for hiding this comment

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

😕 Hmmmm, that's a good point.

Copy link
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.

Looks good!

@jasonwilliams jasonwilliams added this pull request to the merge queue Dec 5, 2024
@jedel1043 jedel1043 added this to the v0.20.0 milestone Dec 5, 2024
@jasonwilliams jasonwilliams added this pull request to the merge queue Dec 5, 2024
Merged via the queue into boa-dev:main with commit b345775 Dec 5, 2024
14 checks passed
@jasonwilliams jasonwilliams deleted the update_temporal branch December 5, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Intl Changes related to the `Intl` implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants