-
Notifications
You must be signed in to change notification settings - Fork 81
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: implement type safety fallback #2933
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
const sectionSlug = section?.slug ?? 'default-section'; | ||
const itemSlug = item?.slug ?? 'default-item'; |
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.
Do these exist?
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.
they usually are never undefined, but the type script error is now blocking the build, so i implemented a quick fallback to avoid the error.
the issue is that neither item nor section are properly typed and so this is the point where it falls trough. i can also go ahead and do a wider refactoring, fixing the initial types. but as all builds are failing at the moment, i wanted to have a quick fix.
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 mean do these default sections and items exist or would something break if they actually got used?
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.
Ahh, no, just the slug name and item would be displayed like that.
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.
Okay. I would like to understand what broke and why now, but we can get a hotfix in first.
Are we able to pinpoint what package bump caused this regression? |
@denkristoffer @cf-remylenoir i am also not sure, i was trying it out with the latest master where it failed immediately. and also versions above, so maybe its not an update in this package but one on circle ci? i mean its "just" a linter issue, so it seems like it could be based on some node or npm version or something like that. |
* feat: export media queries * feat: improve responsiveness of space switcher * refactor: give proper class name * chore: remove unneeded style * feat: improve switcher responsiveness * feat: adjust switcher label designs * fix: switcher label overflows * fix: adjust spacing left * fix: do not show decorator on non space contexts * fix: implement type safety fallback (#2933) * feat: enable different mobile navigation breakpoint * chore: update readme broken link * chore: release 5.0.0-alpha.41
With some package update, typescript errors got interpreted as more strict. This implements the slug handling in a typesafe way with fallbacks.