kittenchief117
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Why is the WordPress Block code so verbose and inefficient?Yeah, I have been looking into Block Patterns.
Though, at least personally, I find it much faster to edit the raw code in my code editor (with all the advanced editing capabilities) versus changing things in the UI, but I’ll look into it more.
Thank you for all the suggestions and help!
Forum: Developing with WordPress
In reply to: Why is the WordPress Block code so verbose and inefficient?Hi @dmsnell,
Thank you for taking the time to write the detailed response! I appreciate it.
I understand and agree with you for the most part. I guess I’m used to having a modern JS dev environment with automatic type-checking, completions, linting, prettifying, highlighting, and many other dev-friendly features, that developing on WordPress still seems a bit cumbersome.
Regarding point #1: Yes, you’re right that other assets will be much larger than the block code, but those assets can also often be lazy-loaded separately and aren’t as critical for UX and Core Web Vitals (FCP, first-byte) as the initial HTML page, which loads the main content the user is interested in.
But even more importantly, it takes much longer to write the code! I love utility-style class names for how quickly and efficiently you can build layouts, and I wish WP had them too (side note: for my sanity I might even write a script that takes my Tailwind HTML code and auto-converts it to WP block code wherever possible!)
Of course, if a block has a property that isn’t directly correlated/mapped to a class name or CSS style, it can go in the block comment (or perhaps a better structure as the block comment JSON isn’t easily prettified, autocompleted, or syntax highlighted by code editors).
But I believe the majority of the styles are duplicated, which can add unnecessary confusion, extra learning curve, weird bugs, and more things to remember, especially because of the non-standard naming schemes.
I’ll also try looking into other editors like Elementor and Divi to see how things are.
But either way, thank you again for the answers. Have a great day Dennis…