-
-
Notifications
You must be signed in to change notification settings - Fork 951
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
Version 1.0 #51
Comments
We have everything that I'd originally wanted for 1.0 support. The only bit of API that's giving me any pause on a 1.0 jump is the async bits of requests/websockets. eg. request parsing. Ideally we'd like to eventually be able to use |
One other thing that I'd like to throw in is a request that you keep the ability for Starlette to be utilized as a library toolset. I personally dislike Flask's style of global application objects. I much prefer having my own class where I can inject dependencies and then call out your framework as needed. BTW; I love this library/framework. Thanks so much for the hard work you've put into it! |
Oh, absolutely! We'll want the documentation to come from a "here's how you use a Starlette app" first, and a "here's the low level stuff" second, but it's really important that Starlette remains both a framework and a toolkit. At some point the datastructures ought to get some documentation. Also I'm planning on expanding out |
That's great to hear. I have found certain things that I've had to dig into the source to figure out. Particularly how to setup my own router instance. Also, clues to wrapping middle-ware exist, but it could be called out a bit stronger in the documentation also. BTW; I love your tests. They have generally supplied for documentation lack, except in the case of routers which you only seem to test when coupled with an |
Scratch part of the last comment, I must've been thinking of something other than routers, but I can't think of what right now. |
Would supporting trio (as an optional replacement for asyncio) be an option? |
@sscherfke Potentially. The awkwardness is that asyncio and trio are completely incompatible, so anywhere we're using asyncio primitives is a point where we'd need to be able to intelligently switch between the two. My personally opinion is that rather than promoting an ecosystem split, the most productive approach here is to take the design lessons from trio and apply them to asyncio. If someone did want to try to tackle a pull request for this, the place to look would be |
Yes, I know that it is not an easy task. I like trio's design for structured concurrency, its API and that it is based on coroutines all the way down. But I also see the “problem” that asyncio has currently more users and is, at least when using uvloop, a lot faster. |
Indeed, me too. One thing that certainly needs to happen is for Python to get a task supervisor that's similar to Trio's nurseries, and for the documentation and ecosystem to start moving users away for more gnarly lower-level primitives. (Same goes for timeouts too) |
Luckily, you can support both with the anyio project. This gives you the nice trio-inspired APIs whilst working on both asyncio and trio. |
Are there any plans to introduce a back end so web socket connections in different Starlette processes (production) can communicate with each other? This would be nice for v1.0. |
@skewty I think that would belong to the "application development" side. It would probably involve some kind of message passing system/DB. E.g. a Redis instance and connections between different processes to receive and write messages to that central DB from their own WebSocket connections with their clients. As any system like that would be very application-dependent, having something very strictly pre-defined like that probably wouldn't fit in the framework. |
I found this issue, and see that it's asking a question I have an opinion on, and it's still pre-1.0, so maybe it'll persuade someone to see it my way ;-) My recommendation for organizing the code would be to use singular names, and move sub-classes into separate modules that relate to the specializations rather than the base class. For example, if you have a In this system, you would rarely use a plural name, and the file names would represent, in general, separations of specializations, or unique ideas, rather than groupings of specializations for a given base type. This idea became known to me as "separation of concerns, not technologies". Here's someone describing roughly these thoughts in the context of .NET: https://www.youtube.com/watch?v=PRns0rqPonA One benefit of this approach is that things like optional dependencies are rather straightforward. If you have some specializations that depend on an external module, those will rather naturally be in a package related to that dependency, and if that package is imported, you know that they are looking to use that dependency. Thus you can import directly, and allow the error of the missing module to surface via the normal python import error mechanism. If you find that you don't like this suggestion, the plural name for the module strikes me as better than using the singular name for a group of specializations combined with the base class. So I'm glad you went with it. |
@tomchristie Love the ongoing work on starlette, what's your current timeline for cutting a 1.0 release? |
Hi, just wanted to mention that #1157 adds |
SSE is implemented on this package: https://github.com/sysid/sse-starlette For HTTP/2, I guess we first want to have support on Should we add " |
No not really. I'm very keen that Starlette really should be absolutely as minimal as possible. Moreso than it currently is now.
HTTP/2 support isn't really a Starlette issue. Also we could perfectly well be pointing folks towards Hypercorn, which does have HTTP/2 support. I'm actually quite keen on that.
That's pretty much my number one thing I'd like to see switched around on Starlette yeah. |
I guess the removal of GraphQL code should be included on the 1.0 milestone. |
TestClient is now using I'll try to create a plan for this bump. It's a big step for us. 🙏 |
Introduce
App
first in README / Docs intro.app = App()
style, but then go on to demonstrate plain ASGI style example, and discuss design philosophy of "everything is just ASGI" , interoperable, eg. useTestClient
with Channels.Naming
WebSocketSession
as justWebSocket
? Renamesession
variable aswebsocket
in docs?StaticFile
, and just leaveStaticFiles
andFileResponse
.starlette.requests
/starlette.responses
instead ofstarlette.request
/starlette.response
? Would fitwebsockets
and align better with documentation titles.App
should perhaps beStarlette
instead. Less likely to be confused with plain ASGIApp
class examples, and mirrors eg.flask.Flask
andsanic.Sanic
.HTTPEndpoint
andWebSocketEndpoint
?Ensure that
requests
is only required ifTestClient
is used. Ensure thataiofiles
is only required ifFileResponse
/StaticFiles
is used. We could choose to pushFileResponse
into thestarlette.staticfiles
module, and only ever importaiofiles
from there.Features
See https://github.com/encode/starlette/milestone/1
Later
Important
The text was updated successfully, but these errors were encountered: