feat: add streaming arg to createApp()#13273
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
sarah11918
left a comment
There was a problem hiding this comment.
So tiny! 😅 If @ArmandPhilippot is happy, then I am happy!
|
Neither of us are happy anymore! (Just to be clear 😂 ) |
|
Noting that now I think the changeset from the implementation PR has some text we can work with for creating a |
|
So just restating that I will merge the code PR because I need it for other stuff, but we don't need to rush to get this PR ready in time for release. No one uses |
|
I am removing the |
ArmandPhilippot
left a comment
There was a problem hiding this comment.
I was looking at the source code in the core repo to figure out how new App() should be used... but given the recent changes you made it seems this is kinda deprecated for the end-users and the new method is to always use createApp(), right?
Are there any use-cases where using new App() directly is better? Or should this be removed from the docs at some point (i.e. next major)? And instead of:
The App constructor accepts a required SSR manifest argument, and optionally an argument to enable or disable streaming, defaulting to true.
We could say:
You can create a new
AppusingcreateApp()... This gives you access to the following methods.
And the (updated) code snippet could be moved under createApp()?
|
I think it makes sense to stop documenting |
|
No need to accept suggestions, @florian-lefebvre ! Happy if you want to "start over" with what you think is most helpful on this page in general! |
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
|
I am not fully satisfied with the header structure of |
Welcome to our nightmare. 😄 I agree this is a bit weird to have Looking at the new structure, I realize this also means all the static methods are no longer relevant because we can't access them from So, are there any use cases for the following static methods (inherited from
Also, it seems the following static methods have been removed in v6 and so we'll need to remove them anyway:
|
|
I don't have context on these static methods, I'm not sure if they are deprecated or removed. Given that, it may be better to keep the |
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
|
I think having a dedicated page would make sense yeah!
No this is specific to the server entrypoint, the preview entrypoint cannot use the same mechanism
I don't know either! I have the feeling some of these are meant to be used internally so I would only document
Feel free to do it in this PR 👍 |
|
I guess a separate page would help future proof us for Algolia complaining the page is too long again 😅 My only concern is that Note that I don't think making it more visible it is necessarily a bad thing, though! I see Florian suggesting in support all the time, "Oh, you need this functionality, you can write an integration for that! So, integrations are a natural extension of Astro behaviour, and maybe one we should be encouraging! Again, my only concern would be people inadvertantly getting in there, getting confused etc. when they're just making a basic site, so clarity is key. But if that entire section of the Adapter API page is/would be simply a string of API references anyway, then moving it off to the modules section does make sense, I think! |
|
Yeah, that was also my concern re: "think about a better name than "App API Reference" for the astro/app page". But having one module documented here while all the others (including
Oh, thanks for pushing back! I assumed they worked in the same way. Alright, I'll polish what I have and I'll push the changes here. If we don't like them, we can always revert the commit! |
Well, not so tiny anymore. 😆 There is probably some wording to polish but I think all the changes are here, including broken links fixes because of the reorganization! To summarize what I've done:
|
|
|
||
| Astro uses the standard [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) objects. Hosts using a different API for requests/responses should convert to these types in their adapter. For example, Astro exposes [helpers to work with NodeJS](#imports-from-astroappnode). | ||
|
|
||
| ## `astro/app` types |
There was a problem hiding this comment.
Not sure if types should come first, or if the "runtime" should instead
There was a problem hiding this comment.
Yeah, I get what you mean. I hesitated. I left it there because I thought it might be confusing for the user to go into astro/app and not see any "direct" import option from that module (if that makes sense 😅 ).
But looking back, I think you you're right and we can move them at the bottom!
|
Looks pretty good! |
sarah11918
left a comment
There was a problem hiding this comment.
This looks fantastic @ArmandPhilippot !! (Not so tiny, indeed!) Just some polishing comments from me!
| } from "astro/app/node"; | ||
| ``` | ||
|
|
||
| This module is used in conjunction with [the methods provided by `createApp()`](#createapp) to convert a [NodeJS `IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) into a web-standard `Request` and stream a web-standard `Response` into a [NodeJS `ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse). |
There was a problem hiding this comment.
Really nice work here! Love this intro to the module!
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
florian-lefebvre
left a comment
There was a problem hiding this comment.
Very nice! I can't approve my own PR 😆 but huge LGTM!!
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
|
I love seeing how moving content helps to refine what we had! Great teamwork! If everyone is happy, I think this one is ready to be merged! 🎉 |
sarah11918
left a comment
There was a problem hiding this comment.
The world's best docs team! 🙌
|
Just noting that we have the one |
|
This is for v6 though, so we'll need to deal with Lunaria on the v6 PR not here, right? |
|
Oh, forgot! Yes, should be fine! Thank you! |
|
Alright then can this PR be merged? The associated code PR was released last week already so we're not blocked by that |
|
Yeah, Sarah approved it! I know I hijacked your PR but this is still your PR so I was waiting for you to merge it just in case you had second thoughts. 😄 |



Description (required)
Related issues & labels (optional)
For Astro version:
6.x. See astro PR #15483.