-
Notifications
You must be signed in to change notification settings - Fork 175
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
Create an Ideal Components Bag / Skeleton for DateTimeFormat #1317
Comments
@gregtatum will provide mentorship. |
I'm spreading the word about this issue looking for candidates. More details:
|
I'm interested to work on this issue. |
@gregtatum are you still open to mentor? |
If this issue is still open, I'm definitely interested to work on this. |
@ozghimire Great! How would you prefer to get started? There is a document linked above outlining the strategy which should discuss how to get things going. I would suggest starting with #1318. I will fill in more details on that issue. @pdogr I think ozghimire is taking the first step on this to move it forward, and it's hard to parallelize this initial step, but there will probably be work to help out on around the issues. You could take another DateTimeFormat issue to get onboarded. I'm sure there will be opportunities to help in the short term. #1581 would be a good bug to onboard with if you wanted to take it. |
Hello @gregtatum, are still looking for contributors? |
How should I organize the code in the repo? I know this is banal, but I need to do something. What we currently have is a bit of a mess, and we need to move things anyway as part of the big rename, so I may as well move them into good places. Currently, inside components/datetime/src:
All re-exports are from the root unless otherwise specified. What I think I want to move:
Note: I want everything to have exactly 1 place where it is exported. Thoughts/approval? @Manishearth @robertbastian |
These were useful when code was shared between 1.x and 2.x formatting code paths, but now removing them reduces failure paths. #1317
This seems fine! I think we should be organized but it's flexible and we don't have to get it perfect right now. Something vaguely sensible is enough for me! |
Type naming discussion: Points brought up:
Discussion:
Conclusion:
Agreed: @sffc @Manishearth @robertbastian |
Review with Zibi:
DateTimePattern verbiage: Original: Most clients should use DateTimeFormatter instead of directly formatting with patterns. [ Type exports:
On the filesystem:
Errors:
|
Let's not use macros in type position, they don't work in every possible type position and this gets annoying quickly. I think it's fine to provide such a macro but having a fallback is good. |
Notes from brief discussion with @Manishearth: The user-facing field set related types can be put into 4 buckets
Where should these all go? My original idea (Option 1):
One that @Manishearth suggested (Option 2):
Here's another one that might be good (Option 3):
I'm not sure about It also occurs to me that |
To add some points, personally I think the ideal situation is that the fieldsets, runtime fieldsets, skeleta are all in their own modules, containing nothing but those types, combiner types ( My vision is that each of these (except for |
@sffc's current thinking:
@Manishearth But then we have two dimensions in the same module: (Date, Time, DateTime, ZonedDateTime)(Skeleton, Fieldset) @sffc We could reduce it to one type, like this: // mod fieldset_dynamic
enum DateFieldSet {
YMD(fieldset::YMD),
MD(fieldset::MD),
} @Manishearth But currently it's nice to write: let skeleton = NeoDateSkeleton {YearMonthDay, YearStyle::whatever}; and this gets a bit more complicated on construction? depends on what the user patterns would be like.
Proposal:
LGTM: @sffc @Manishearth |
I made a proposal to switch around how time fields are handled: https://docs.google.com/document/d/1SkxoitlCFiQ_KGW3dmRk7lbumGd_N1rfYJLMlkiXvh4/edit?tab=t.0 I started implementing this in ICU4X. My idea:
Then, I will update #5761 to switch around the dynamic field sets as discussed previously. One small caveat: I realized that overlap patterns already use the variants for year style. However, none of our overlap patterns currently contain the year field, so I'm currently adding a debug assertion and changing the variants there to be for time precision instead. Does this sound okay @Manishearth? |
👍 |
This is a meta issue to track implementing the "ideal components bag" as laid out in the DateTimeFormat Deep Dive 2021-10-01 design document. Originally there was some discussion to have this replace the current components bag, but it is to be implemented alongside the existing components bag. A better name can be bikeshed if needed.
The following need to be completed.
The text was updated successfully, but these errors were encountered: