2 ms·
Yeah I'm talking mainly about React + Typescript as a combo. With more gnarly Django templates sometimes it's hard to even know what we are looking at in a temp
by rtpg 3y ago
Yeah I'm talking mainly about React + Typescript as a combo. With more gnarly Django templates sometimes it's hard to even know what we are looking at in a template, whereas inside a React component I'm going to be a "jump to definition" away, not just for components (or template tags in the case of Django, I know PyCharm offers good jump to def there, including for stuff like Angluar!), but for variables and the like as well.
I think django-components only has part of the story there, because even if that helps writing out your page, you're still looking at going to the other side of the frontend/backend wall to add, at the very least, an endpoint using that template. And if you're following this whole "hypertext API and data API as separate things", you'll need to also code handling of submitting any data, and routing involved.
I'm not against this stuff entirely, because I think there's a bit of a Go-like niceness to how it's "at worst" boilerplate (that you can abstract over on a per-project basis). But if you have a comfortable, well designed API all that work spread over you templates and controllers might actually all just be in one place.