[react-notifaction-system] Ref instances are nullable#58972
Conversation
| ActionWrapper?: WrapperStyle | undefined; | ||
| } | ||
|
|
||
| export interface Attributes extends React.ClassAttributes<System> { |
There was a problem hiding this comment.
Props can't determine the ref type for class components. Needed to move code around so that NotificationSystem correctly extends a React.Component.
|
@eps1lon Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 58972,
"author": "eps1lon",
"headCommitOid": "b5b0ab63875a1e3e946cd648f3814b3ada1a070e",
"mergeBaseOid": "322b09e7e97422bbeb564159b9ffaafdd1c1827f",
"lastPushDate": "2022-02-24T18:18:19.000Z",
"lastActivityDate": "2022-03-16T19:50:45.000Z",
"mergeOfferDate": "2022-03-16T19:48:34.000Z",
"mergeRequestDate": "2022-03-16T19:50:45.000Z",
"mergeRequestUser": "eps1lon",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "react-notification-system",
"kind": "edit",
"files": [
{
"path": "types/react-notification-system/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-notification-system/react-notification-system-tests.tsx",
"kind": "test"
}
],
"owners": [
"GiedriusGrabauskas",
"DeividasBakanas",
"LKay",
"sztobar"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "peterblazejewicz",
"date": "2022-03-16T19:47:55.000Z",
"isMaintainer": true
}
],
"mainBotCommentID": 1050151178,
"ciResult": "pass"
} |
|
🔔 @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar — please review this PR in the next few days. Be sure to explicitly select |
|
Re-ping @GiedriusGrabauskas, @DeividasBakanas, @LKay, @sztobar: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
|
It has been more than two weeks and this PR still has no reviews. I'll bump it to the DT maintainer queue. Thank you for your patience, @eps1lon. (Ping @GiedriusGrabauskas, @DeividasBakanas, @LKay, @sztobar.) |
|
this one is potentially breaking if accepted, due to changes symbols with 'export' keyword. Any feedback from the owners? |
What is the breaking change here? Or rather what is the "bad" breaking change here. As far as I can tell this is only breaking for incorrect usage. But maybe I'm missing something? |
|
To be clear: I don't know how this namespace + declare var even works. As soon as I try to change So it seems to me this is a very old typing pattern that isn't used anymore. So I'd really like to get rid of it and take the breaking change since it's been blocking work for over 20 days now. |
|
The 'bad' change is someone using explicit types, just like in the code you've changed: private notificationSystem: NotificationSystem.System = null;just raising this as a concern, there is no major/minor change and there is no feedback from owners. |
|
The native module export class, this DT could have been written differently, so I agree. |
|
@eps1lon: Everything looks good here. I am ready to merge this PR (at b5b0ab6) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@GiedriusGrabauskas, @DeividasBakanas, @LKay, @sztobar: you can do this too.) |
|
Ready to merge |
Currently instances in ref callbacks are allowed to be nullable due to our bivariance hack. However, during runtime these instances can be null: https://codesandbox.io/s/refs-are-nullable-m44vxx
We'll likely remove the bivariance hack to catch these issues in the future. In the meantime, existing packages and tests should guard against nullable instances regardless.
The issue was first reported in #58464