tcmulder / aquamin

Aquamin WordPress Theme
3 stars 1 forks source link

Consider renaming script.js to view.js. #87

Closed tcmulder closed 3 months ago

tcmulder commented 3 months ago

Not sure if it's worthwhile... but it's called viewScript in block.json, and view.js makes it feel more like a front-end script, which it is, while script.js feels more generic and could apply to the back or front end.

tcmulder commented 3 months ago

Actually, consider changing script.js and style.css to be view.js and view.css. This makes all the work much more attractive. For this to work, aquamin will require WordPress v6.5.0's new viewStyle tag in the block.json file. I'll then need to double check that editor.css imports view.css properly on the front-end.

If all that works, I think it's definitely worth it, as it makes it super clear that these two items are meant for the view (front-end), and things with "editor" in the name are for the back-end.

Further, there's an editorScript option in the block.json; and, while I don't use it, it's use of "script" would confuse things as they are.