-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix(datetime)!: get day of week key without using locale #23
base: alpha
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
📊 Package size report -0.39%↓
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
* @param {String} timezone | ||
* @return {DayOfWeek} | ||
*/ | ||
export const getDayOfWeekKey = (dateObj: Date, locale: string, timezone: string): DayOfWeek => { |
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.
This looks like a breaking change since we're changing the param signature, are any of these methods public to the developer?
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.
we do expose a couple methods whose param signatures are changing, yeah: getNextOpenIntervalToday
and getOpenIntervalsForToday
(although we're not using them in Mise)
We could fix the bug while keeping backwards compatibility, by keeping the locale
parameter there and simply not using it, marking it as deprecated etc. I don't know if that's worth it though tbh. We could investigate
@kevinlee11 how are we handling breaking changes in the SDK at the moment?
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.
If it's not being used by Mise yet, it's likely safe to make a breaking change because we never documented any of these helpers. Once we document them and/or start using it in Mise I'd have said we should avoid breaking changes for the external theme devs' sake.
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.
kk. are we tracking breaking changes in the semver for Alpha versions, or no?
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.
Nope, but we haven't had any breaking changes to date.
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 think we should still mark this as a breaking change and get into the habit of it since this generates release notes (see https://github.com/square/site-theme-sdk/releases/tag/v1.0.0-alpha.11), while some of our internal themes may not use it i think we should still run through the process
This repo uses convention commits so it takes the guess work out of humans making up version numbers and its just based off of what is changed in the code
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.
Nope, but we haven't had any breaking changes to date.
we actually did just release a breaking change last release, it's fine because it's just Alpha right now so it won't actually bump the major value
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.
oh right, forgot about the orders removal
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.
agreed, we should still have the release notes cover the breaking change, but like Kevin said, it will just incrementally update the version because it's in alpha
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've rebased this with Conventional Commit messages, and marked it as a breaking change
bca7bc1
to
a2ff2d9
Compare
note that this removes the "locale" parameter from the param signature of several methods: * helpers.datetime.getDayOfWeekKey * helpers.location.getNextOpenIntervalAfterToday * helpers.location.getOpenIntervalsForToday
a2ff2d9
to
d77f075
Compare
@kchung @kevinlee11 just need øne more approval on this |
Bug
When requesting store hours for the current day, and the Locale Language is other than English, the SDK throws an error
Cause
The days of the week are not localised in Square Data; we are fetching them by generating a localised key according to the current day
Fix
don't localize the key when we are accessing that data.