patrick.wtf

๐Ÿ“

Open-source updates - 04 October 2021

Open-source updates - 04 October 2021

Last two weeks have been intense! Iโ€™ve been working on improvements for our website and as usual Iโ€™ve been reviewing some PRs. I also did a bit of cleanup for Hacktobterfest ๐Ÿ˜Š Oh and we now also support Python 3.10 ๐Ÿ˜Š

Issues cleanup

Itโ€™s Hacktoberfest ๐ŸŽƒ time! This means we will get some new people wanting to contribute to Strawberry this month! So I spent a bit of time cleaning up old issues and checking if labels were alright ๐Ÿ˜Š

If you want to help feel free to take a look at the issues label as โ€œgood-first-issueโ€.

Python 3.10

Python 3.10 is going to be released this month, so we made a PR to add support for it. I had this open for quite a few months, but was waiting for dependencies to fix some issues. Now all of them seems to be working fine on Python 3.10, so Iโ€™ve update the PR to fix a couple of issues with Python 3.10 and to also add support for the new union syntax, which allows you to declare unions like so:

import strawberry

@strawberry.type
class User:
    name: str

@strawberry.type
class Error:
    code: str

@strawberry.type
class Query:
    find_user: User | Error

Release is available here.

Website improvements

I honestly canโ€™t fully remember why I did start working on this, but I always wanted a better code block for our website. I always liked Stripeโ€™s docs and always wanted to copy some of their code block features, for example being able to add inline notes to parts of the code.

This is something Iโ€™ve now implemented in this PR. You can see an example in action here.

Basically we are now able to highlight individual lines, individual words and add notes to parts of the code.

The code for the notes is a bit fragile, but for now it works. I have some ideas on how to improve it, but it would probably require using/writing a different syntax highlighter.

# Search support

I almost forgot about this, not having search on the website was something that came up during our monthly meeting. So I applied for Algoliaโ€™s doc search and in a couple of days we got the request approved and so I implemented it in our website. Itโ€™s so fast and useful, I wish I did this a while ago!

PR reviews

Marcelo Trylesinski added a PR to better document how to use Strawberry and Starlette. We already supported Starlette using our ASGI integration, but it does make sense to have a dedicated page for this!

Michael Ossareh submitted two PRs to improve the Open Tracing support, I definitely appreciate being able to get better traces out for Strawberry!

Guillaume Andreu Sabater made a PR to fix a typo in a docstring. Always nice to see when people take time to improve things, even if it is just a tiny typo.

Jon Kim made a very useful PR to document all our extensions. We think extensions are going to make Strawberry much more flexible and powerful. Go and check the extensions out!

Fin

Iโ€™m not doing well at doing this every week, I hope thatโ€™s ok ๐Ÿ˜Š

Anyway, Iโ€™m so excited about Hacktoberfest, Iโ€™m sure weโ€™ll get some nice contributions. Also canโ€™t wait to start doing some contribution to other projects myself, if I manage to make time ๐Ÿ˜Š


Written at home ๐Ÿ˜Š

Webmentions