-
Notifications
You must be signed in to change notification settings - Fork 159
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
Temporal.Date vs "Classic" Date ? #563
Comments
You can rename anything while importing, so if you need to use both, you have a pretty easy solution. |
Temporal won't be a module (that was considered at one point, but IIUC it didn't seem like a good idea to make this proposal depend on built-in modules). Instead it's a globally available object (like |
@ptomato - Got it, makes sense. Sounds like name conflicts in user code would be unusual. I still think it's a little unusual to have two built-in classes sharing the same name because logging or debugging code often has a default display for objects which uses Can (and if yes, should) Temporal to override (with Object.setProperty) set |
I found another problem case in #562. Every time anyone writes For example, how will Temporal's own documentation distinguish between the two? Will every reference to |
We do specify that
In the Temporal documentation we are referring consistently to " |
Both Yes, |
Unreliable or not, logging & debuggers needs to show something-- and if that something ends up being FWIW, we faced exactly this problem at my last company and we ended up naming types DateTime, DateOnly, TimeOnly, etc. Anything that was a subset of another type got the |
You won't be logging the constructors tho, you'll be logging the instances, where the |
I agree with others here that, part of the idea of settling on the We had a very lengthy discussion on the name of these classes, earlier in this repository, see #33 |
I added better debug output some time ago, I think all the concerns are addressed and we can close this? Feel free to reopen if there's still something we should discuss. |
One possible open issue is what we should call the existing "Date" type in Temporal docs and in other official places. Whatever we call it will (probably? hopefully?) be picked up by the wider community, assuming we pick the right phrase. Have we done any bikeshedding on what to call the old Date? If not, should we? I assume that the default answer is "legacy Date" which I'd be OK with, but I also wonder if there's a better phrase. I'm also not sure if "legacy" has connotations in some (spoken, not computer) languages that we'd want to avoid. Also, has this come up elsewhere in JS? Are there JS features that have deprecated older JS features? |
We did some bikeshedding on that topic in March or April or so, and settled on consistently calling it "legacy Date". There aren't any other such features that I can think of! There's |
Sounds good. At some point (later!) it may be worth a scrub through the docs to make sure that we're calling it "legacy Date" consistently. |
What are the implications of Temporal.Date sharing a name with classic JS
Date
?Will devs have to
import . . . from temporal
, and if so willimport { Date } from 'temporal'
break all previously-working uses of classic JSDate
in the same module?Regardless, should
temporal.Date
be called something else (e.g.DateOnly
) to remove this ambiguity? I assume that this change might also imply changes toTime
,MonthDay
, andYearMonth
.The text was updated successfully, but these errors were encountered: