-
Notifications
You must be signed in to change notification settings - Fork 1
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
support exactOptionalPropertyTypes
#25
Conversation
Hello! Thanks for sending this contribution! However, supporting that feature is not only about merging this feature and forget. It will also enforce coding convention for our team. Before paying the cost of this new convention, we need to have more demand than just a few enthusiasts. So, both this PR and the issue will remain open, asking for more people and their use-cases |
The documenter PR doesn't enforce any convention. It's more of a bug fix that correctly identifies I would take some issue with calling exact optional properties a convention, when it is a type fix. It's not a code style. It is a bug fix to the language. Not using it blocks teams that accurately define their types, while using it supports both types of teams. It shouldn't be controversial: one configuration unblocks everyone while accurately defining types, and the other configuration blocks users who accurately define their types. I'm afraid what you will find is not teams arguing for their use case, but that they have already begrudgingly changed their configuration solely to support this library. Failing to support exact optional types is a compile time build failure, not a code style. Anyone using this package has already adjusted their configuration to support it. Others saw that this package doesn't support their configuration and possibly abandoned the library altogether. The best source for what you are seeking is the TypeScript documentation itself: the reasons for why they added the configuration in the first place. The issue referenced in the PR that added it is microsoft/TypeScript#13195. You see plenty of real world cases and justifications. I'm afraid you and your team would have to self-motivate to read it, as it's unlikely anyone will bring this issue to you. I tried to be exceptional to not only raise the issue but to address it; you'll find others (especially AWS teams) will have simply abandoned their preference in favor of a library that's required. I can't stress enough that this is less of an issue of the Cloudscape team having to add Please weigh the cost benefit analysis here in that this change is 100% backwards compatible. If you need more data, I ask you find it (e.g. the linked GitHub issue), as it won't passively comment on this thread. |
I am not taking this PR alone but also follow up steps to update all existing interfaces to follow the convention, update development documentation for creating new components and write some compatibility tests. If there are any signs of this property to become popular, we can go this way. I checked microsoft/TypeScript#44421 to predict the future for this mode and people posted some code examples where this new mode makes the code harder to write and read. Our team was not bitten much enough by object spread issues to justify the cost of this flag. |
Some experience from our past – in the beginning of v3.0 development we received a suggestion to use Past learning suggests that we should take only more or less popular type features or modes |
resolves #23
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 95.18% 95.28% +0.10%
==========================================
Files 15 15
Lines 415 424 +9
Branches 142 142
==========================================
+ Hits 395 404 +9
Misses 20 20
☔ View full report in Codecov by Sentry. |
Can you clarify what the extra cost of maintaining this is? This change should have unchanging transpilation and runtime behavior in all instances where you aren't using |
Now every time, we used to write
If a pull request changes existing team workflow (adds new coding convention), this is not a pull request which can come from outside that team. Rule of thumb for our case, if it requires documenter modifications - it is a kind of change which will be difficult for the team to accept |
I'd like to clarify that this is not a coding convention change, but a code accuracy change. This can be especially important when rendering conditional elements, such as "If the prop exists, render a div that contains it." This is great when I don't see |
Ack that I read your comment, but not sure what else I can add here 🤷 If something changes and |
I don't know how you handle version bumping, so I didn't try. Theoretically, this should be
1.0.10
.Issue #, if available: resolves #23
Description of changes:
Regarding cloudscape-design/components#1108,
Here's the fix.
Details
buildEventInfo
requires two pieces of information:When building event info for union types, it finds the reference type in the union, then grabs the respective metadata: from the handler and from the reference type in the union
For non-union reference types, the same logic still occurs: it grabs the metadata from the handler and from the reference type.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.