Uh oh!
There was an error while loading. Please reload this page.
esm: doc & validate source values for formats - #32202
Conversation
GeoffreyBooth
left a comment
There was a problem hiding this comment.
Looks good other than the docs note. Thanks for doing this!
| of the following: | ||
| | `format` | Description | | ||
| | `format` | Description | Acceptable Source Values | |
There was a problem hiding this comment.
Maybe it's just me, but I read this as "the source value of format", e.g. that 'builtin' should be a string. I think what you mean is the acceptable type of source returned by getSource for this format? So maybe call this "Acceptable Types for getSource Returned source"?
Should we also update the signature in getSource?
@returns{string|buffer}response.sourceThere was a problem hiding this comment.
Yes, I meant the value from either getSource OR transformSource
There was a problem hiding this comment.
Okay, do you mind making that clearer? Maybe “Acceptable Types For source Returned by getSource or transformSource”?
There was a problem hiding this comment.
done, also made sure to actually check both hooks rather than just transformSource
guybedford
left a comment
There was a problem hiding this comment.
Nice to see this being locked down well.
GeoffreyBooth
commented
Mar 13, 2020
Do we need to update the JSDoc function signatures? e.g. @returns{string|buffer}response.source |
nodejs-github-bot
commented
Mar 20, 2020
GeoffreyBooth
commented
Mar 20, 2020
@bmeck ☝️ #32202 (comment) do we need to fix this too? |
@GeoffreyBooth We could, but overall the signature isn't trivial and I think |
bmeck
commented
Mar 23, 2020
rebased and looks green locally, will CI then land if green and no comment in next few hours |
44fcb28 to
a3a01f4Comparebmeck
commented
Mar 23, 2020
rebase had a minor change, in particular I had to update |
nodejs-github-bot
commented
Mar 24, 2020
addaleax
commented
Mar 29, 2020
@bmeck Didn’t look into the other failures but at least the linter is complaining |
a3a01f4 to
cd5ccdfComparenodejs-github-bot
commented
Mar 31, 2020
bmeck
commented
Mar 31, 2020
Fixed lint, CI errors seem unrelated |
nodejs-github-bot
commented
Apr 17, 2020
nodejs-github-bot
commented
May 9, 2020
targos
commented
May 9, 2020
Test error without intl: |
ae2427c to
01af9cdCompare01af9cd to
614ec8eCompareUh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
nodejs-github-bot
commented
May 19, 2020
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Although much of this is new material to me, the previous layout didn't really make sense to me. :/
My suggestions are how I've made sense of it, but I could be wrong. I hope we can improve this little area, it's a rather important section for those implementing types on the function boundaries of the custom loader hooks API.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
nodejs-github-bot
commented
May 20, 2020
nodejs-github-bot
commented
May 20, 2020
PR-URL: #32202 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
himself65
commented
May 21, 2020
landed in cd4985c |
PR-URL: #32202 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
PR-URL: #32202 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesThis better specifies how decoding of source values returned from loaders are translated. Some formats expect different types of sources. This also fixes some problems where Buffers were properly decoding due to the custom
.toStringbut typed arrays were not.We could expand the tests if desired, but I felt just checking
Uint8Arraywas sufficient.