-
Notifications
You must be signed in to change notification settings - Fork 215
Update NodeJS to v20 #4264
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
base: develop
Are you sure you want to change the base?
Update NodeJS to v20 #4264
Changes from all commits
16e0caa
d6bedb7
04bbd9a
ad71d37
bec8c7d
23a4e52
fd856cb
9ceabb1
4836e74
0740c53
14552aa
7efdb6a
1feb133
fec00f4
93ded00
775279e
68bff0b
4a184ed
7c9f75a
0bec463
8b1f1a8
2c82ed4
dc0a6d5
f927c4a
6dc9758
1759faf
0c3e9f8
75fce62
3e0345c
d79b754
aa26844
8cded66
23038b4
b0796e5
8eb5552
dea439c
c1dbefe
a337c11
e72e5c3
4cc361a
0d4ee34
398f0e7
0cf831f
1a3d9f0
35d0bc1
1482cc2
a068088
89c54b9
85c8e22
04c8120
6299c98
27f0d6a
354f604
f0b4ccf
5b92371
27b4289
39dc563
72ba24f
12ee857
ad11e06
9e5ae58
086e697
d0644d6
9df9777
5388eaa
d4302c6
3b74ea7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,12 @@ module.exports = { | |
'testing-library/no-unnecessary-act': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@wordpress/i18n-text-domain': [ | ||
'error', | ||
{ | ||
allowedTextDomain: 'woocommerce-gateway-stripe', | ||
}, | ||
], | ||
}, | ||
settings: { | ||
react: { | ||
|
@@ -82,4 +88,5 @@ module.exports = { | |
'@wordpress/data', | ||
], | ||
}, | ||
ignorePatterns: [ 'phpunit-html/**' ], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tripped over a local folder left over from testing and realised it should always be ignored for linting. |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
legacy-peer-deps=true | ||
engine-strict=true | ||
save-exact = true | ||
engine-strict = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Config copied from Guteberg There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While working on various dependencies, I noticed that this results in the default |
||
legacy-peer-deps = true | ||
prefer-dedupe = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this? Maybe something for a follow-up PR. |
||
lockfile-version = 3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16.18.0 | ||
v20.19.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
// Import the default config file and expose it in the project root. | ||
// Useful for editor integrations. | ||
module.exports = require( '@wordpress/prettier-config' ); | ||
module.exports = { | ||
...require( '@wordpress/prettier-config' ), | ||
overrides: [ | ||
{ | ||
files: [ 'changelog.txt' ], | ||
options: { parser: 'markdown' }, | ||
}, | ||
], | ||
}; | ||
Comment on lines
+3
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Config copied from Guteberg |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ function load_js_transpiling_source_maps(): array { | |
} | ||
|
||
foreach ( $file_json[ 'sources' ] as $source ) { | ||
$source = preg_replace( '%^webpack:///\./(client/.*)$%', '${1}', $source ); | ||
$source = preg_replace( '%^webpack://\./(client/.*)$%', '${1}', $source ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the Webpack 5 config, we are manually setting |
||
if ( 'webpack' !== substr( $source, 0, 7 ) ) { | ||
$mappings[ $source ][] = $file_json[ 'file' ]; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import { getBlocksConfiguration } from 'wcstripe/blocks/utils'; | |
* Construct WC AJAX endpoint URL. | ||
* | ||
* @param {string} endpoint Request endpoint URL. | ||
* @param {string} prefix Endpoint URI prefix (default: 'wc_stripe_'). | ||
* @param {string} prefix Endpoint URI prefix (default: 'wc_stripe_'). | ||
* @return {string} URL with interpolated endpoint. | ||
*/ | ||
const getAjaxUrl = ( endpoint, prefix = 'wc_stripe_' ) => { | ||
|
@@ -33,7 +33,7 @@ export const getCartDetails = () => { | |
/** | ||
* Update shipping options. | ||
* | ||
* @param {Object} address Customer address. | ||
* @param {Object} address Customer address. | ||
* @param {string} paymentRequestType Either 'apple_pay' or 'payment_request_api' depending on the type of request. | ||
*/ | ||
export const updateShippingOptions = ( address, paymentRequestType ) => { | ||
|
@@ -65,18 +65,6 @@ export const updateShippingDetails = ( shippingOption ) => { | |
} ); | ||
}; | ||
|
||
export const createOrder = ( sourceEvent, paymentRequestType ) => { | ||
let data = normalizeOrderData( sourceEvent, paymentRequestType ); | ||
data = getRequiredFieldDataFromCheckoutForm( data ); | ||
|
||
return $.ajax( { | ||
type: 'POST', | ||
data, | ||
dataType: 'json', | ||
url: getAjaxUrl( 'create_order' ), | ||
} ); | ||
}; | ||
|
||
const getRequiredFieldDataFromCheckoutForm = ( data ) => { | ||
const checkoutForm = document.querySelector( '.wc-block-checkout' ); | ||
// Return if cart page. | ||
|
@@ -109,3 +97,15 @@ const getRequiredFieldDataFromCheckoutForm = ( data ) => { | |
|
||
return data; | ||
}; | ||
|
||
export const createOrder = ( sourceEvent, paymentRequestType ) => { | ||
let data = normalizeOrderData( sourceEvent, paymentRequestType ); | ||
data = getRequiredFieldDataFromCheckoutForm( data ); | ||
|
||
return $.ajax( { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't looked to see how this gets utilized but I don't love that we return a promise with no default error state. It forces every instance of createOrder to implement an error catch since there is no fallback. |
||
type: 'POST', | ||
data, | ||
dataType: 'json', | ||
url: getAjaxUrl( 'create_order' ), | ||
} ); | ||
}; |
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.
@wordpress/i18n-text-domain
was reporting a lot of issues. I chose to specify our expected text domain, but we could also keep to the defaults.