Skip to content
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

Loader docs return value for source from transform? #35

Open
jonaskello opened this issue Sep 25, 2021 · 4 comments
Open

Loader docs return value for source from transform? #35

jonaskello opened this issue Sep 25, 2021 · 4 comments

Comments

@jonaskello
Copy link

I think the most current docs for the loader hooks are here:

https://github.com/nodejs/node/blob/master/doc/api/esm.md#loadurl-context-defaultload

In the section above in the table for formats, it has a column called

Acceptable types For source returned by resolve or load

This leads me to believe that resolve somehow would be capable of returning source but I think it is not? Is this an error in the docs or have I misunderstood something?

@GeoffreyBooth
Copy link
Member

It should probably say acceptable values for format; @JakobJingleheimer ?

@jonaskello
Copy link
Author

The format is specified in the first column so I think it the resolve part should just be removed?

Acceptable types For source returned by resolve or load

@JakobJingleheimer
Copy link
Contributor

JakobJingleheimer commented Sep 27, 2021

It should probably say acceptable values for format; @JakobJingleheimer ?

@GeoffreyBooth the 3rd column is indeed types for source. That table is saying when format is foo, source can be bar. I'm not sure how much value the table provides (it existed before though) as in most circumstances, the choice is made for you.

Acceptable types For source returned by ~resolve or ~load

Yes! resolve does not return a source property. Thank you for the catch @jonaskello. PR incoming.

@JakobJingleheimer
Copy link
Contributor

nodejs/node#40234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants