Robyn icon indicating copy to clipboard operation
Robyn copied to clipboard

Plans for the new year! ✨

Open sansyrox opened this issue 3 years ago • 10 comments

Hey All! 👋

Wishing everyone a very happy new year. I have been on vaccation from 28th December and will be a little afk till 10th Jan. I will be on full throttle after that.

I am a believer of the statement that "Plans are useless but planning is important." and I plan to remain flexible throughout.

However, I do have some targets that I would like to achieve this year.

  • [x] Check windows and mac support - Mac support works fine for me on intel macs. Need to check if it works well for arm macs as well.
  • [ ] Add a way to release on test pypi before actual pypi
  • [x] Add the bases of python stubs
  • [x] Add flake8 config for the entire project
  • [x] Fix hot reloading
  • [ ] Better support for cargo fuzz
  • [ ] Use click for better cli parsing
  • [ ] Web3 extension
  • [x] Middleware support
  • [x] Make readme more colorful
  • [ ] add the link to the benchmarking scripts.
  • [ ] Make better support for ORMs
  • [ ] Make a community of plugins
  • [ ] Split the branches in stable and main
  • [ ] Improve docs website
  • [ ] JSON response parsing for the dictionary
  • [ ] Better jsonify method
  • [x] Response customization More docs / customization on the response should be supported (e.g. headers, status codes, and so on). Is it already implemented?

These are some of the plans that I would want to achieve this year. If the community has any suggestions that you'd like me to include, I'll be happy to take them under consideration.

Happy new year again. Hope this year is better than the last one! 😄

sansyrox avatar Jan 02 '22 16:01 sansyrox

Very exciting! And super congratulations for this project 👏

A few possible points of improvements are below!

Response customization

More docs / customization on the response should be supported (e.g. headers, status codes, and so on). Is it already implemented?

OpenAPI

Have you considered adding an OpenAPI integration? I think that it is one of the main key points for the success of FastAPI in the Python ecosystem, and it would surely enhance the dev experience a ton.

As for how to do that, I think there have two main routes:

  • going the Python way (similarly to FastAPI)
  • integrating it directly in Rust with Actix (but it may be more tricky I think, since the parsing will be written in Python, and you'd have to extrapolate it from the pyo3 function signature).

This also means having a standardized way to access requests' parameters and body, so that they can easily be parsed and put in the OpenAPI doc. What do you think?

Mypy

I see a project with Rust and I am very excited thinking about type safety, but there is no Python typing in the current functions; have you considered adding them?

Python communities are going towards type adoption since it helps a lot to identify bugs with static checking. The code is also not big so I think it wouldn't even be very difficult to add 😄

klaa97 avatar Jan 09 '22 14:01 klaa97

Hi @klaa97 ,

Sorry for the late revert( I was travelling back from vacation) and thank you for the great suggestions! 😄

Response customization More docs / customization on the response should be supported (e.g. headers, status codes, and so on). Is it already implemented?

This is definitely in the works. Added to the roadmap!

OpenAPI Have you considered adding an OpenAPI integration? I think that it is one of the main key points for the success of FastAPI in the Python ecosystem, and it would surely enhance the dev experience a ton.

I was considering just Swagger integration but this is much better. However, I do have one question: Do people only use this in dev mode and not in prod? If this is the case then, plain python will not be an issue otherwise we may have to look at the rust integration.

Mypy I see a project with Rust and I am very excited thinking about type safety, but there is no Python typing in the current functions; have you considered adding them?

I am not a big fan of strongly typed languages(sorry but this is just me xD) BUT I found out that the community loves them. So, this is definitely a high priority issue. But, I don't have much experience with it so any help(either docs, resources or code contributions) would be highly appreciated.

Thank you again for the amazing suggestions 😄 ✨

sansyrox avatar Jan 11 '22 19:01 sansyrox

I was considering just Swagger integration but this is much better. However, I do have one question: Do people only use this in dev mode and not in prod? If this is the case then, plain python will not be an issue otherwise we may have to look at the rust integration.

Usually, an OpenAPI integration that allows having a ReDoc/Swagger documentation is used also in production (obviously not public if the service is not open source)... but there should be no performance drawbacks apart from a small one during server startup: you build the OpenAPI YAML only once from the routes you define, and then you can serve it using Swagger or ReDoc.

klaa97 avatar Jan 11 '22 21:01 klaa97

but there should be no performance drawbacks apart from a small one during server startup: you build the OpenAPI YAML only once from the routes you define, and then you can serve it using Swagger or ReDoc.

The startup doesn't really matter much. I was worried more about request serving. This makes sense. I'll have a look at the docs. Thank you! :D

sansyrox avatar Jan 11 '22 23:01 sansyrox

Super cool project! I'm looking forward to using it in the future.

sjquant avatar Feb 13 '22 04:02 sjquant

Thank you @sjquant . It really means a lot. :D

sansyrox avatar Feb 13 '22 15:02 sansyrox

may I suggest using msgspec for json encoding and decoding.

https://github.com/jcrist/msgspec

crypt0miester avatar Jul 24 '22 06:07 crypt0miester

Thanks @crypt0miester . I was not aware about msgspec. Is it faster than the native python json encoding and decoding?

sansyrox avatar Jul 24 '22 06:07 sansyrox

indeed it is. it is rather faster than orjson.

it has amazing functionalities other than jsonifying

crypt0miester avatar Jul 24 '22 13:07 crypt0miester

Ah, perfect then. I will go through the documentation. Thank you! :smile:

sansyrox avatar Jul 24 '22 15:07 sansyrox

robyn + prisma + jinja + htmx + openapi/swagger = Perfect !

shaohaiyang avatar Dec 16 '22 03:12 shaohaiyang

@shaohaiyang , that's the plan for this year 😉

sansyrox avatar Jan 06 '23 22:01 sansyrox

Also, you might not even need htmx 👀

sansyrox avatar Jan 06 '23 22:01 sansyrox