-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 WordPress Packages #347
Conversation
We need to update node and npm versions according to https://make.wordpress.org/systems/2020/01/21/update-svn1-node-versions-for-gutenberg/:
|
function gutenberg_enqueue_block_editor_assets_block_directory() {
wp_enqueue_script( 'wp-block-directory' );
wp_enqueue_style( 'wp-block-directory' );
}
add_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' ); All that is necessary to enable Block Directory. |
Travis works much better with the latest npm but there are some failure in a different place: https://travis-ci.com/github/WordPress/wordpress-develop/jobs/353584741#L2553
|
We're tackling that block directory PHP in #359. |
|
For the e2e tests: |
@@ -76,7 +76,7 @@ before_script: | |||
fi | |||
- npm --version | |||
- node --version | |||
- nvm install 10.13.0 | |||
- nvm install --latest-npm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm installs nodejs and you removed it to update npm.
nvm install 10.13.0
I think it should stay as before (or use newer node.. I don't know the requirements ).
nvm install --latest-npm
tries to update npm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, isn't this what Gutenberg does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking into Travis CI, as I haven't used it before, but it's definitely a different command, that does the above. Maybe node is already installed or installed in some other place.
Since it was there in WordPress Travis, it should stay there, except some change in node
installation has happened.
Also the command --latest-npm
is in different Travis hooks:
Wordpress: before_script
GB: before_install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With nodejs installation comes the npm too.. So it might explain the Puppeteer not found
module... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Puppeteer isn’t installed then it means that the lock file wasn’t properly updated. The simplest way to fix it is to install the alias that wp-scripts
uses as a dev dependency for the project, example:
It’s a bug in npm’s implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're still getting this error:
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
Chromium (737027) downloaded to /Applications/MAMP/htdocs/wordpress-git/node_modules/@wordpress/scripts/node_modules/puppeteer/.local-chromium/mac-737027
Error: Could not find browser revision 737027. Run "npm install" or "yarn install" to download a browser binary.
at ChromeLauncher.launch (/Applications/MAMP/htdocs/wordpress-git/node_modules/puppeteer/lib/Launcher.js:200:23)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like Chromium is downloaded to node_modules/@wordpress/scripts/node_modules/puppeteer
, while puppeteer runs from node_modules/puppeteer
.
Great work team!!! 🎉 |
For more info, please see: WordPress/wordpress-develop#347 (comment)
* Enqueue Sift JS on every WCPay page Fixes server issue 472 For more context and instructions, see the server PR. * Fix lint * Adding ActionScheduler dependency to composer.json * Update to include the Action Scheduler service and load actions on init. * Added logic to schedule the action when an order is created * Made WC_Payments_Action_Scheduler_Service non-static as it will need to support calls to the Payment Server API. * Updated the action names to try and make it a bit more clear * Added API client logic to make the request * small updates to naming based on Luiz's suggestions. * Update to create wrapper function for AS scheduling to allow easier mocking. * Update to make the tests match the update to add ActionScheduler service to Payment Gateway. * Fix for a comparison issue, adding tests. * Fix for a bug where we were getting payment method title rather than payment method. * Updated the unit tests. * Client updates after discussion with Luiz. - Adjust the logic to only fire the creation event when we have sufficient data (intent ID). - Sets a metadata property to show when an order has been tracked. - Updates to changelog. * Updated unit tests * Add puppeteer dependency and rebuild package.lock to fix E2E tests For more info, please see: WordPress/wordpress-develop#347 (comment) * Added `eslint-plugin-import` to stop JS lint test failing. * trying to fix issues with js linting * trying to fix issue with e2e tests * Trying to fix e2e tests * Updating the linter config temporarily until issues with eslint-plugin integration are worked out * Fixed an out of date snapshot on jest tests * reverting package.json and package-lock.json to how they are in . * Revert `index.js.snap` * Revert package-lock.json to how it is in trunk. * Updates based on discussion with Luiz to support update logic (not implemented in server yet. * Added actionscheduler to dev dependencies. * Add session ID to the create customer request We're sending the session_id on the create_customer WCPay call, so the server can link the newly created customer with the session. * Update WCPay gateway to check sift is enabled before scheduling order tracking. * Mock WC_Payments_Account in WC_Payment_Gateway_WCPay_Test * Fix unit tests * Adding test to cover new behaviour * All the changes we discussed for correctly linking session with user. Brain is too fried for a decent commit message. * Fix linting errors Co-authored-by: Daniel Mallory <daniel.mallory@automattic.com> Co-authored-by: Luiz Reis <luiz.reis@automattic.com>
Trac ticket: https://core.trac.wordpress.org/ticket/50420
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.