wikimedia / interconnection-wordpress-theme

WordPress theme created for https://diff.wikimedia.org/
GNU General Public License v2.0
2 stars 0 forks source link

Update JS build dependencies and modernize theme JS #46

Closed kadamwhite closed 4 months ago

kadamwhite commented 4 months ago

wp-scripts is getting updates targeted at Node v20, and sass is included internally within the @wordpress/scripts package dependencies. This PR updates the Interconnection build to use Node 20 and the latest version of wp-scripts, and assumes the sass executable will be provided internally by the wp dependency.

[!NOTE] We can't rely on wp-scripts build because that configuration makes too many assumptions about the structure of our project, and targets block-based builds. It isn't a good fit for a CSS-only theme build, especially with RTLCSS in play.

Then, to address #4 this fixes existing issues with npm run lint:js and then

kadamwhite commented 4 months ago

Merged to develop to test build, and it completed correctly: https://github.com/wikimedia/interconnection-wordpress-theme/actions/runs/8990525292/job/24696037305

kadamwhite commented 4 months ago

Inline annotations are working for JS!:

image

Reverting 59b6170

kadamwhite commented 4 months ago

@goldenapples Oh fun, look at this: https://developer.mozilla.org/en-US/docs/Web/API/Window/event Window.event will be the same as an event function argument, but was deprecated, so the change you flagged here was functionally more correct but will not have changed actual behavior. Explains a lot.