Conversation
|
@AugustinMauroy Can you check the original implementations and make sure these match them? If they do, can you make that clear? |
|
@avivkeller & @ljharb I just applied what the docs said. So I will not change it for now. Here docs ref
|
|
I'm sorry @ljharb but If you think there are better way to handle that please first update node api doc and then we will update this codemod |
|
For the opinion ones, fine, but one of them is a bug and is just broken. It shouldn't matter what's in the docs, but it matters what code does. |
I'm annoyed because I'm caught between two stools. On the one hand, I agree with you. On the other, I want to follow the documentation strictly so that the org node is consistent. |
|
That seems like an arbitrary and counterproductive constraint to me. The docs aren’t the source of truth, they need to reflect the actual source of truth, the code. |
76b6fb5 to
1f71b3e
Compare
|
cc @ljharb synced with the pr |
|
LGTM, thanks! |
Co-authored-by: Bruno Rodrigues <swe@brunocroh.com>
7d65dc8 to
b52adfd
Compare
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Looking good!
Aside from a few small things / nets, I think it's just missing support for dynamic imports?
Any of our codemod support that so if we want to support that do it in aside pr that create utility + update codemod |
I think all of our migrations must support that in order to claim the deprecation is handled, which I believe is the intention. If it's best to create a shared util to do it, let's do that right away. I thought you had previously said all of our current ones do handle this (and your message here also says they do, but I'm guessing from the rest that they actually don't?). |
I just realized that we have utility for that but I was never used
It's a misunderstanding there are any of our codemod that support that |
Co-Authored-By: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Did dynamic import support get added? I think that was my only previous request.
| * 6. util.isFunction() → typeof value === 'function' | ||
| * 7. util.isNull() → value === null | ||
| * 8. util.isNullOrUndefined() → value == null | ||
| * 8. util.isNullOrUndefined() → value === null || value === undefined |
There was a problem hiding this comment.
very nit since it's a comment:
| * 8. util.isNullOrUndefined() → value === null || value === undefined | |
| * 8. util.isNullOrUndefined() → value == null |
There was a problem hiding this comment.
There was a problem hiding this comment.
Yes, I understand :)
null == null // true
undefined == null // true
false == null // false
0 == null // false
'' == null // falseThere was a problem hiding this comment.
The difference is in document.all, I believe, which doesn't apply to node but would if someone cargoculted the info into a browser.
There was a problem hiding this comment.
so what should I do ?
There was a problem hiding this comment.
I don't understand @ljharb's comment, so I'm not sure.
But this thread was based on a nit—it's not blocking. The blocking issue is supporting dynamic import.
There was a problem hiding this comment.
document.all == null but document.all !== null && typeof document.all !== 'undefined'.
There was a problem hiding this comment.
Ah. I think we can ignore that extreme edge-case.
| console.log('someValue is null'); | ||
| } | ||
| if (someValue == null) { | ||
| if (someValue === null || someValue === undefined) { |
There was a problem hiding this comment.
nit:
| if (someValue === null || someValue === undefined) { | |
| if (someValue == null) { |
|
Dynamic import work well ! |
| | `util.isError(value)` | `Error.isError(value)` | | ||
| | `util.isFunction(value)` | `typeof value === 'function'` | | ||
| | `util.isNull(value)` | `value === null` | | ||
| | `util.isNullOrUndefined(value)` | `value === null || value === undefined` | |
There was a problem hiding this comment.
opened a pr for that !

Description
Close #116