311 karma · joined February 18, 2019
But yeah if you use something like Zod you can at least say "this is what I'm pretty sure the API should return" but also define what should happen if things change / don't meet your types.
Types that are too complex... hmmmm - I'm sure this exists in domains other than the bullshit CRUD apps I write. So yeah, I guess I don't know what I don't know here. I've written some pretty crazy types though, not sure what TypeScript is unable to represent.
But for your own handwritten application code, there is no excuse to use `any`.
Without this, Typescript is next to useless. Not knowing if the types are good is worse than no types at all.
Even the devs involved don't have their heads around what they've built, considering responses in github issues.
Integration tests for complex flows inadvertently tests your dependencies, which as you say is awesome for when you have to upgrade.
I mean have them in the CI as well, but for sure have them as pre-commit hooks.
You still need to handle the "what happens next" part on each side, but at least your validation rules are shared.
Configuration as code is actually one of the best parts of Drupal now. I think it's probably symfony as well under the hood, but you can just import / export your config with a CLI and commit as yml, makes moving configuration to higher / lower environments so pleasant.
But yes, I think with Drupal 7 there were a lot more "site builders" using Drupal, where D8 I imagine it's mostly just developers left standing.
1. You need a deep knowledge of Drupal to put together something good. It's not beginner-friendly, you will build a couple clunkers before things click.
2. The mind-share is not there like it was for Drupal 7 - the devs still contributing are great, progress is being made, but if you're used to Wordpress plugins or an NPM package being available for whatever you need, Drupal can be frustrating.
Less code, centralized messaging.
Trade offs, as usual.