-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 optional property types #6872
Open
alecmev
wants to merge
6
commits into
adobe:main
Choose a base branch
from
alecmev:fix-optional-property-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b715f1a
Fix optional property types
alecmev de41e1f
Use vanilla Intl.ResolvedDateTimeFormatOptions
alecmev 0ad564b
Define DOMProps via HTMLAttributes
alecmev 7291d42
Merge branch 'main' into fix-optional-property-types
snowystinger a9911d1
add id back into the docs
snowystinger 4f13f0a
fix lint
snowystinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 correct, but is really going to need to exist in so many more places
https://github.com/microsoft/TypeScript/blob/a86b5e2b01075db5046521958a3e0b905b4ca667/tests/lib/react18/react18.d.ts#L1863
Any way we can use the type from the original set instead of creating our own? maybe
extends Pick<HTMLElement, 'id'>
?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.
The focus of this PR is to just fix the public API. I don't see anything wrong with adding
| undefined
in more places, but that's #1890.Updated to use
extends
π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.
Sure, I guess i'm worried about potential regressions, and I'm also not sure that this is really all there is to fix in the public API, seems like too small a change?
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.
You're right, there's most likely more, I only submitted the changes necessary to unblock our particular cocktail of Spectrum π I'll create more PRs in the future as I run into other issues.
Hopefully #1890 will be addressed soon, but until then, one option could be to add a quick smoke test, that just lists every single package as a dependency and runs
tsc
withskipLibCheck: false
,strict: true
andexactOptionalPropertyTypes: true
? This will allow you to make sure that the public API is clean, without switching the whole monorepo toexactOptionalPropertyTypes: true
.