-
Notifications
You must be signed in to change notification settings - Fork 55
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
Response.json() #741
Comments
Any chance you could publish the explainer and questionnaire responses in markdown along side of the spec please? |
I've created Markdown versions at https://github.com/ricea/response-json-explainer. @annevk how would you feel about including them in the fetch repository? |
I could see adding an example to the standard. WHATWG standards are expected to be self-contained documents so I wouldn't really want to add separate markdown files that also need to be consulted/maintained. |
Hi @ricea, We took a look at this today during a breakout. While the functionality seems worthwhile, we are concerned that it might be confusing that there is an instance method and a static method with the same name that do exactly opposite things. This is also acknowledged in the explainer, but as a benefit:
We are also unsure if it's a good idea to have a factory method whose naming does not indicate that it's a factory method. What are your thoughts on this? What alternative names have you considered? |
Hi again. We looked at this again during a breakout today. We still think that it's confusing if any static method could be a factory method, and we believe there is value in making this obvious with a naming convention. As an example, we explored ideas such as However, we see that there is precedent in having factory methods in this API whose names are simple nouns ( |
Thank you for the feedback. I like the idea of |
Braw mornin' TAG!
I'm requesting a TAG review of Response.json().
Response.json(body)
is a static method used to construct a Response object from the JSON serialisation of "body". It does what you would wantnew Response(body)
to do if that was not ambiguous.Response.json
helper whatwg/fetch#1389Response.json
denoland/deno#14566 feat: addResponse.json
nodejs/undici#1452Further details:
You should also know that...
It is a very small feature.
We'd prefer the TAG provide feedback as (please delete all but the desired option):
💬 leave review feedback as a comment in this issue and @-notify ricea, annevk, lucacasonato
¹ We require an explainer to give the relevant context for the spec review, even if the spec has some background information. For background, see our explanation of how to write a good explainer. We recommend the explainer to be in Markdown.
² A Security and Privacy questionnaire helps us understand potential security and privacy issues and mitigations for your design, and can save us asking redundant questions. See https://www.w3.org/TR/security-privacy-questionnaire/.
The text was updated successfully, but these errors were encountered: