Remove the experimental flag that's used to include thunks in wp.data (https://github.com/woocommerce/woocommerce-blocks/pull/7617)

* Remove the experimental flag that's used to include thunks in wp.data

* bot: update checkstyle.xml

* Fix ts error from previous PR

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Alex Florisca 2022-11-14 09:07:49 +00:00 committed by GitHub
parent 9a7f1e17e1
commit fc44b9fc4d
5 changed files with 3 additions and 14 deletions

View File

@ -16,10 +16,6 @@ export const config = {
reducer, reducer,
selectors, selectors,
actions, actions,
// TODO: Gutenberg with Thunks was released in WP 6.0. Once 6.1 is released, remove the experimental flag here
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We pass this in case there is an older version of Gutenberg running.
__experimentalUseThunks: true,
}; };
const store = createReduxStore( STORE_KEY, config ); const store = createReduxStore( STORE_KEY, config );

View File

@ -20,10 +20,6 @@ export const config = {
actions, actions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
controls: { ...dataControls, ...sharedControls } as any, controls: { ...dataControls, ...sharedControls } as any,
// TODO: Gutenberg with Thunks was released in WP 6.0. Once 6.1 is released, remove the experimental flag here
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We pass this in case there is an older version of Gutenberg running.
__experimentalUseThunks: true,
}; };
const store = createReduxStore( STORE_KEY, config ); const store = createReduxStore( STORE_KEY, config );

View File

@ -16,10 +16,6 @@ export const config = {
reducer, reducer,
selectors, selectors,
actions, actions,
// TODO: Gutenberg with Thunks was released in WP 6.0. Once 6.1 is released, remove the experimental flag here
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We pass this in case there is an older version of Gutenberg running.
__experimentalUseThunks: true,
}; };
const store = createReduxStore( STORE_KEY, config ); const store = createReduxStore( STORE_KEY, config );

View File

@ -20,6 +20,7 @@ export interface ProductResponseItemBaseData {
value: string; value: string;
display?: string; display?: string;
hidden?: boolean; hidden?: boolean;
className?: string;
} }
export type ProductResponseItemData = ProductResponseItemBaseData & export type ProductResponseItemData = ProductResponseItemBaseData &

View File

@ -647,7 +647,7 @@
<error line="164" column="25" severity="error" message="Property &apos;SET_PRISTINE&apos; does not exist on type &apos;{ readonly SET_IDLE: &quot;SET_IDLE&quot;; readonly SET_REDIRECT_URL: &quot;SET_REDIRECT_URL&quot;; readonly SET_COMPLETE: &quot;SET_CHECKOUT_COMPLETE&quot;; readonly SET_BEFORE_PROCESSING: &quot;SET_BEFORE_PROCESSING&quot;; ... 11 more ...; readonly SET_IS_CART: &quot;SET_IS_CART&quot;; }&apos;." source="TS2339" /> <error line="164" column="25" severity="error" message="Property &apos;SET_PRISTINE&apos; does not exist on type &apos;{ readonly SET_IDLE: &quot;SET_IDLE&quot;; readonly SET_REDIRECT_URL: &quot;SET_REDIRECT_URL&quot;; readonly SET_COMPLETE: &quot;SET_CHECKOUT_COMPLETE&quot;; readonly SET_BEFORE_PROCESSING: &quot;SET_BEFORE_PROCESSING&quot;; ... 11 more ...; readonly SET_IS_CART: &quot;SET_IS_CART&quot;; }&apos;." source="TS2339" />
</file> </file>
<file name="assets/js/data/checkout/index.ts"> <file name="assets/js/data/checkout/index.ts">
<error line="25" column="44" severity="error" message="Argument of type &apos;{ reducer: (state: CheckoutState | undefined, action: actions.CheckoutAction) =&gt; CheckoutState; selectors: typeof selectors; actions: typeof actions; __experimentalUseThunks: boolean; }&apos; is not assignable to parameter of type &apos;StoreConfig&lt;CheckoutState&gt;&apos;. <error line="21" column="44" severity="error" message="Argument of type &apos;{ reducer: (state: CheckoutState | undefined, action: actions.CheckoutAction) =&gt; CheckoutState; selectors: typeof selectors; actions: typeof actions; }&apos; is not assignable to parameter of type &apos;StoreConfig&lt;CheckoutState&gt;&apos;.
Types of property &apos;actions&apos; are incompatible. Types of property &apos;actions&apos; are incompatible.
Type &apos;typeof import(&quot;/home/runner/work/woocommerce-blocks/woocommerce-blocks/assets/js/data/checkout/actions&quot;)&apos; is not assignable to type &apos;{ [k: string]: (...args: readonly any[]) =&gt; AnyAction | Generator&lt;any, any, unknown&gt;; }&apos;. Type &apos;typeof import(&quot;/home/runner/work/woocommerce-blocks/woocommerce-blocks/assets/js/data/checkout/actions&quot;)&apos; is not assignable to type &apos;{ [k: string]: (...args: readonly any[]) =&gt; AnyAction | Generator&lt;any, any, unknown&gt;; }&apos;.
Property &apos;__internalProcessCheckoutResponse&apos; is incompatible with index signature. Property &apos;__internalProcessCheckoutResponse&apos; is incompatible with index signature.
@ -700,7 +700,7 @@
<error line="162" column="27" severity="error" message="Binding element &apos;dispatch&apos; implicitly has an &apos;any&apos; type." source="TS7031" /> <error line="162" column="27" severity="error" message="Binding element &apos;dispatch&apos; implicitly has an &apos;any&apos; type." source="TS7031" />
</file> </file>
<file name="assets/js/data/payment/index.ts"> <file name="assets/js/data/payment/index.ts">
<error line="29" column="44" severity="error" message="Argument of type &apos;{ reducer: Reducer&lt;PaymentMethodDataState, AnyAction&gt;; selectors: typeof selectors; actions: typeof actions; controls: any; __experimentalUseThunks: boolean; }&apos; is not assignable to parameter of type &apos;StoreConfig&lt;PaymentMethodDataState&gt;&apos;. <error line="25" column="44" severity="error" message="Argument of type &apos;{ reducer: Reducer&lt;PaymentMethodDataState, AnyAction&gt;; selectors: typeof selectors; actions: typeof actions; controls: any; }&apos; is not assignable to parameter of type &apos;StoreConfig&lt;PaymentMethodDataState&gt;&apos;.
Types of property &apos;actions&apos; are incompatible. Types of property &apos;actions&apos; are incompatible.
Type &apos;typeof import(&quot;/home/runner/work/woocommerce-blocks/woocommerce-blocks/assets/js/data/payment/actions&quot;)&apos; is not assignable to type &apos;{ [k: string]: (...args: readonly any[]) =&gt; AnyAction | Generator&lt;any, any, unknown&gt;; }&apos;. Type &apos;typeof import(&quot;/home/runner/work/woocommerce-blocks/woocommerce-blocks/assets/js/data/payment/actions&quot;)&apos; is not assignable to type &apos;{ [k: string]: (...args: readonly any[]) =&gt; AnyAction | Generator&lt;any, any, unknown&gt;; }&apos;.
Property &apos;__internalUpdateAvailablePaymentMethods&apos; is incompatible with index signature. Property &apos;__internalUpdateAvailablePaymentMethods&apos; is incompatible with index signature.