Codeinwp / tweet-old-post

Plugin to tweet about your old posts to get more hits for them and keep them alive.
GNU General Public License v2.0
13 stars 16 forks source link

Update the JS pipeline #897

Closed Soare-Robert-Daniel closed 8 months ago

Soare-Robert-Daniel commented 9 months ago

Highlights

šŸš€ Babel is on the latest version, modern features like boo ?? foo and boo?.name can be used. šŸ‘®ā€ā™‚ļø Eslint is on the latest version, and new warnings are now available to enforce best practices. šŸ”§ Format command has been added via Eslint --fix. šŸ”§ New Github job added to check for lining and dev build posting. šŸ”„ DevTools now available via inline-source-map šŸ”„ Webpack is on the latest version. šŸ–Œļø SCSS lang now available šŸ”„ E2E Testing with Playwright for Free Version

Breakdown

The current state of the JS packages is unacceptable, especially the Babel version, which was very old, and many JS features needed to have the required support.

Upgrading the Babel version was a straight process; we removed some old packages and added new ones like core-js, which can provide polyfills for old browsers if needed.

Vue was updated to its latest version of supported 2.X. Related packages like vuex and vue-loader were also updated to the version that still supports Vue 2.X -- in the future, it is recommended to migrate to Vue 3 and Pina store (since it is a new officially recommended store). SASS lang can now be used.

After much refactoring to Webpack, the new version of Webpack has excellent features like --mode, which can easily control the build flow without the need for an env and additional lib like cross-env.

Also, the build result is now simplified. The old one created two types of files build.js and build.min.js, which were coordinated by a PHP var named ROP_DEBUG. Now, only build.js is created and loaded, and its content is determined by Webpack --mode.

ā„¹ļø On the published version of ROP on WordPress, you will see that both build.js and build.min.js were uploaded. Also, the build files were submitted via Git -- now the assets/js/build is excluded via .gitignore and the deploy job has been updated to run an npm run build before uploading the the version to WordPress.

DevTools are now in full force, inline-source-map is now available. Fixing bugs should now be a lot more easier.

The E2E setup is similar to the one from Gutenberg which allows us to use their utility function to deal with WordPress internals.

Testing

This is a pretty big update and we need to make sure that we did not introduce any regression. Please check each feature in the interface to ensure the components works as expected.

github-actions[bot] commented 9 months ago

Plugin build for bbc83a95bd3345cbd4db977794a0f99d837a242d is ready :bellhop_bell:!

irinelenache commented 8 months ago

@Soare-Robert-Daniel Tested the PR and didn't find any issue šŸš€

pirate-bot commented 8 months ago

:tada: This PR is included in version 9.0.22 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: