Frojd / django-react-templatetags

A quick way to add React components to your Django templates.
MIT License
443 stars 38 forks source link

Recommended development environment #59

Closed baranyildirim closed 2 years ago

baranyildirim commented 3 years ago

Not a bug or problem with the project.

Is there a development environment that anyone would recommend for doing frontend development with django-react-templatetags?

Specifically, how do you go about developing react components and debugging them with the Django and Hypernova SSR setup?

Thanks

marteinn commented 3 years ago

Excellent question @baranyildirim, there are sadly very few examples out there, and Hypernova is in itself is looking more and more like abandonware (last update 2 years ago - https://github.com/airbnb/hypernova), and there are few (or if any at all) standalone SSR renders like it. We at Fröjd (the agency that mainly maintain this package) maintained one of our own for a while https://github.com/Frojd/Hastur.

We decided in october to take another approach when it comes to React+SSR and to gradually adopt an integrated clientside/SSR environment like Next.js instead, which of removes the need for DRTT. AirBnb that developed Hypernova did something similar with their Hyperloop project.

But when it comes to examples, we have a older iteration of our Wagtail boilerplate that uses DRTT+Create-React-App and Hypernova, you can find code for it here: https://github.com/airbnb/hypernova

My recommendation is, if you are relying on SSR, try to use a integrated environment such as Next.js or Razzle. I think DRTT hits it's sweet spot for quick client side integrations without SSR rendering.

If a new SSR render like Hypernova arises I would be more than happy to add a adapter for it.

baranyildirim commented 3 years ago

Hey @marteinn thanks for responding. The problem I am facing is I have a Django backend, but need to use React with SSR. This has been a massive headache. I would still like to use Django templates to some extent because I very much dislike react-router and all its variants. At Fröjd did you move away from Django completely?

marteinn commented 3 years ago

Totally understand. We have sort of a hybrid approach where we use Next.js to serve any type of user facing frontend, but still maintain a Django backend that has an API that serves content and of course we keep the admin. You can see our current approach here: https://github.com/frojd/wagtail-pipit

I've also worked a lot with Create-React-App and Routing pains. I think Next.js has a better approach where it rather goes by filename instead, its pretty interesting: https://nextjs.org/docs/routing/introduction

baranyildirim commented 3 years ago

Thank you for sharing @marteinn . For now I will continue with Hypernova and try to get hot-reloading to work somehow.

But when it comes to examples, we have a older iteration of our Wagtail boilerplate that uses DRTT+Create-React-App and Hypernova, you can find code for it here: https://github.com/airbnb/hypernova

I would love to see this example if it is public.

marteinn commented 3 years ago

NP @baranyildirim. I wish you the best of luck! And if you find a way forward, ping me so I can update our examples.

I would love to see this example if it is public.

For sure! I was supposed to attach a link but somehow forgot, here it is: https://github.com/Frojd/Wagtail-Pipit/tree/c88c981abbc3d284029315bdc672f73c0cf19f47

marteinn commented 2 years ago

I'm closing this issue as it is an already answered question.