Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the JS pipeline #897

Merged
merged 15 commits into from
Dec 13, 2023
Merged

Update the JS pipeline #897

merged 15 commits into from
Dec 13, 2023

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Nov 22, 2023

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.

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Nov 22, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review November 22, 2023 09:25
Copy link

github-actions bot commented Nov 22, 2023

Plugin build for bbc83a9 is ready ๐Ÿ›Ž๏ธ!

artifacts/storage-states/admin.json Outdated Show resolved Hide resolved
includes/admin/class-rop-admin.php Show resolved Hide resolved
includes/admin/class-rop-admin.php Show resolved Hide resolved
vue/src/models/rop_store.js Show resolved Hide resolved
vue/src/vue-elements/account-schedule.vue Outdated Show resolved Hide resolved
vue/src/vue-elements/accounts-selector-panel.vue Outdated Show resolved Hide resolved
vue/src/vue-elements/accounts-selector-panel.vue Outdated Show resolved Hide resolved
vue/src/vue-elements/accounts-tab-panel.vue Outdated Show resolved Hide resolved
vue/src/vue-elements/main-page-panel.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@GrigoreMihai GrigoreMihai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a small thing, we can mention the node version that should be used in the contributing file.

@irinelenache
Copy link

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

@vytisbulkevicius vytisbulkevicius merged commit 312b47a into development Dec 13, 2023
6 checks passed
@pirate-bot
Copy link
Contributor

๐ŸŽ‰ This PR is included in version 9.0.22 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants