3 ms·
> I think Django and ASP.NET are wonderful, but neither really offers a great answer for handling the JS/TypeScript/SCSS/SASS/minification stuff that you really
by reducesuffering 4y ago
> I think Django and ASP.NET are wonderful, but neither really offers a great answer for handling the JS/TypeScript/SCSS/SASS/minification stuff that you really want for a modern web app.
Why not? For building my project, I came across the relatively simply paradigm of using standard create-react-app / webpack boilerplate to bundle React/SPA into a .js file and deliver it from a Django template. So you can choose which pages are Django templates and which are individual SPA's.
- likortera 4y agoThis is the worst of all of the solutions in my experience. For example, say you have a "card" or a "dropdown" component, now you need to maintain two implementations of it, one for the django templates and another for the React parts. Then when you load a page it will start blank or with small blanks or spinners all around while the components are initialised. Code splitting becomes really complicated as it will have to be mostly done manually, or just loading everything on every page. Then if you need translations, you'll need two systems, the Django one and the one for your "SPA" parts. Some parts of your app will need a backend API, some others will post to controllers... then suddenly due to changing requirements something that was a Django template now needs to be a bit more reactive, so... you rewrite the entire thing in React? or you sprinkle some react here and keep some templating there?... it quickly becomes a mess. I'd say either stay on the templating world, and use something like Unpoly/HTMX/Hotwire/Livewire, etc.... or go "full frontend framework" with Next.js, Inertia.js. Both options are great in my opinion. The middle ground is very muddy. I've been there.