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

Guidance for library authors #4

Open
ptomato opened this issue Jan 2, 2023 · 0 comments
Open

Guidance for library authors #4

ptomato opened this issue Jan 2, 2023 · 0 comments

Comments

@ptomato
Copy link
Contributor

ptomato commented Jan 2, 2023

Originally from tc39/proposal-temporal#861

A page with guidance for library authors could include:

  • What types should my library accept as input, and in what use cases?
  • What types should my library emit as output, and in what use cases?
  • Be careful of implicit assumptions, especially around time zones. For example, Brazil's missing midnight after a DST transition. In a future where a date-picker library is built using Temporal, it might seem fine for it to accept and/or return a DateTime because no time zone is shown or accepted in the UI. But if the library's implementation is making assumptions that require a time zone, then using ZonedDateTime might be more appropriate for the use case.
  • Serialization and deserialization, including custom formats and interop with other systems. This includes parsing and formatting guidance, but also includes guidance for how to handle limitations and incompatibility between Temporal and other platforms. For example, if your library pulls an OffsetDateTime from a Java or .NET web service, how should that value be represented in Temporal?
  • How to migrate the implementation of a library from moment, date-fns, legacy Date, etc. ? What changes and problems to expect?

There's some overlap with user-facing guidance, but I suspect that some of the issues that library authors run into (e.g. how to pick types properly to minimize their users running into errors) might be unique to libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant