woocommerce/plugins/woocommerce-admin/client/profile-wizard/index.js

381 lines
9.8 KiB
JavaScript
Raw Normal View History

/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { applyFilters } from '@wordpress/hooks';
import { Component, createElement } from '@wordpress/element';
import { compose } from '@wordpress/compose';
Use Route based code splitting to optimize bundle size (https://github.com/woocommerce/woocommerce-admin/pull/4094) * Use lazy loading to split up the size of the js downloaded * Use lazy loading to split up the size of the js downloaded * Add Moment Timezone plugin to reduce size of data file. * Lazy load header panels and use Dashicons for faster loading * Load assets from the correct publicPath * Load assets from the correct publicPath * PHP cs fixes * Fix missing quotes on string literal. * Fix PropType warning for lazy loaded component. * Separate the task list and dashboard chunks. * Lazy load dashboard sections. * Restore original icons and reduce size by importing only the icons needed * Lazy load alerts to save more Kb on initial load * Minify built JS in production mode. * Add preload tags for WC Admin assets. (https://github.com/woocommerce/woocommerce-admin/pull/4162) * Fix linting errors. * Add modified UnminifiedWebpackPlugin. * Produce minified and unminified bundles for all builds. * Remove unused variable from webpack config. * Run unminify after sourcemap generation. * Only hook after optimization if we're using a devtool. * Add minification suffix in Loader::get_url(). * Lazy load OBW on new home screen. * Move OBW style up a level to layout. * Hydrate ProfileWizard independently of withSelect and withDispatch * Fix order of composition and fallback function when using hydration. Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-04-29 18:01:27 +00:00
import { identity, pick } from 'lodash';
import { withDispatch, withSelect } from '@wordpress/data';
Added skip profiler functionality (https://github.com/woocommerce/woocommerce-admin/pull/4721) * Added skip profiler functionality This commit adds the skip profiler functionality, leaving the Home screen `Store details` as incomplete. # Conflicts: # client/task-list/tasks.js * Unit tests repaiared * Added OBW page This commit makes the necessary changes to add an OBW page # Conflicts: # client/profile-wizard/index.js * Event name changed This commit renames the event name we were recording since it was wrong. * Redirection modified This commit modifies the way we do redirection # Conflicts: # client/profile-wizard/index.js * Removed `profiler` feature flag * Removed `profiler` feature flag This commit removes the `profiler` feature flag * Added error handling for `updateProfileItems` This commit adds error handling for the method `updateProfileItems` * Update client/profile-wizard/index.js Co-authored-by: Matt Sherman <matt.sherman@automattic.com> * Removed "throw" from "then" * Update client/dashboard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Update client/profile-wizard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Modified redirection URL This commit modifies the redirection URL. # Conflicts: # client/task-list/tasks.js # Conflicts: # client/profile-wizard/index.js * Removed the variable "lastStep" and the related logic. * Removed change of state for variable "skipped" * Added error trowing to onboarding actions This commit adds error trowing to onboarding actions * Removed response handling for `updateProfileItems` * Added default value for "profileItems" in Homescreen and Dashboard * Removed `step` from OnboardingProfile and test This commit removes the `step` from OnboardingProfile.php and from tests Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com> Co-authored-by: Matt Sherman <matt.sherman@automattic.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2020-07-16 15:17:10 +00:00
import {
getHistory,
getNewPath,
updateQueryString,
} from '@woocommerce/navigation';
import {
NOTES_STORE_NAME,
ONBOARDING_STORE_NAME,
OPTIONS_STORE_NAME,
PLUGINS_STORE_NAME,
withPluginsHydration,
QUERY_DEFAULTS,
} from '@woocommerce/data';
import { recordEvent } from '@woocommerce/tracks';
import { getAdminLink, getSetting } from '@woocommerce/settings';
/**
* Internal dependencies
*/
import { BusinessDetailsStep } from './steps/business-details';
import Industry from './steps/industry';
import ProductTypes from './steps/product-types';
import ProfileWizardHeader from './header';
import StoreDetails from './steps/store-details';
import Theme from './steps/theme';
import { getAdminSetting } from '~/utils/admin-settings';
import './style.scss';
const STEPS_FILTER = 'woocommerce_admin_profile_wizard_steps';
class ProfileWizard extends Component {
constructor( props ) {
super( props );
this.cachedActivePlugins = props.activePlugins;
this.goToNextStep = this.goToNextStep.bind( this );
this.trackStepValueChanges = this.trackStepValueChanges.bind( this );
this.updateCurrentStepValues = this.updateCurrentStepValues.bind(
this
);
this.stepValueChanges = {};
}
componentDidUpdate( prevProps ) {
const { step: prevStep } = prevProps.query;
const { step } = this.props.query;
const {
isError,
isGetProfileItemsRequesting,
createNotice,
} = this.props;
const isRequestError =
! isGetProfileItemsRequesting && prevProps.isRequesting && isError;
if ( isRequestError ) {
createNotice(
'error',
__(
'There was a problem finishing the setup wizard',
'woocommerce'
)
);
}
if ( prevStep !== step ) {
window.document.documentElement.scrollTop = 0;
recordEvent( 'storeprofiler_step_view', {
step: this.getCurrentStep().key,
wc_version: getSetting( 'wcVersion' ),
} );
}
}
componentDidMount() {
document.body.classList.remove( 'woocommerce-admin-is-loading' );
document.body.classList.add( 'woocommerce-profile-wizard__body' );
document.body.classList.add( 'woocommerce-admin-full-screen' );
document.body.classList.add( 'is-wp-toolbar-disabled' );
recordEvent( 'storeprofiler_step_view', {
step: this.getCurrentStep().key,
wc_version: getSetting( 'wcVersion' ),
} );
}
componentWillUnmount() {
document.body.classList.remove( 'woocommerce-profile-wizard__body' );
document.body.classList.remove( 'woocommerce-admin-full-screen' );
document.body.classList.remove( 'is-wp-toolbar-disabled' );
}
/**
* Set the initial and current values of a step to track the state of the step.
* This is used to determine if the step has been changes or not.
*
* @param {string} step key of the step
* @param {*} initialValues the initial values of the step
* @param {*} currentValues the current values of the step
* @param {Function} onSave a function to call when the step is saved
*/
trackStepValueChanges( step, initialValues, currentValues, onSave ) {
this.stepValueChanges[ step ] = {
initialValues,
currentValues,
onSave,
};
}
/**
* Update currentValues of the given step.
*
* @param {string} step key of the step
* @param {*} currentValues the current values of the step
*/
updateCurrentStepValues( step, currentValues ) {
if ( ! this.stepValueChanges[ step ] ) {
return;
}
this.stepValueChanges[ step ].currentValues = currentValues;
}
getSteps() {
const { profileItems } = this.props;
const steps = [];
steps.push( {
key: 'store-details',
container: StoreDetails,
label: __( 'Store Details', 'woocommerce' ),
isComplete:
profileItems.hasOwnProperty( 'setup_client' ) &&
profileItems.setup_client !== null,
} );
steps.push( {
key: 'industry',
container: Industry,
label: __( 'Industry', 'woocommerce' ),
isComplete:
profileItems.hasOwnProperty( 'industry' ) &&
profileItems.industry !== null,
} );
steps.push( {
key: 'product-types',
container: ProductTypes,
label: __( 'Product Types', 'woocommerce' ),
isComplete:
profileItems.hasOwnProperty( 'product_types' ) &&
profileItems.product_types !== null,
} );
steps.push( {
key: 'business-details',
container: BusinessDetailsStep,
label: __( 'Business Details', 'woocommerce' ),
isComplete:
profileItems.hasOwnProperty( 'product_count' ) &&
profileItems.product_count !== null,
} );
steps.push( {
key: 'theme',
container: Theme,
label: __( 'Theme', 'woocommerce' ),
isComplete:
profileItems.hasOwnProperty( 'theme' ) &&
profileItems.theme !== null,
} );
/**
* Filter for Onboarding steps configuration.
*
* @filter woocommerce_admin_profile_wizard_steps
* @param {Array.<Object>} steps Array of steps for Onboarding Wizard.
*/
return applyFilters( STEPS_FILTER, steps );
}
getCurrentStep() {
const { step } = this.props.query;
const currentStep = this.getSteps().find( ( s ) => s.key === step );
if ( ! currentStep ) {
return this.getSteps()[ 0 ];
}
return currentStep;
}
/**
* @param {Object} tracksArgs optional track arguments for the storeprofiler_step_complete track.
*/
async goToNextStep( tracksArgs = {} ) {
const { activePlugins } = this.props;
const currentStep = this.getCurrentStep();
const currentStepIndex = this.getSteps().findIndex(
( s ) => s.key === currentStep.key
);
Merge Version/1.0 to master (https://github.com/woocommerce/woocommerce-admin/pull/3740) * Try: Moving Customers to main Woo Menu (https://github.com/woocommerce/woocommerce-admin/pull/3632) * Only add onboarding settings on wc-admin pages when task list should be shown. (https://github.com/woocommerce/woocommerce-admin/pull/3722) * Use cron for unsnoozing admin notes (https://github.com/woocommerce/woocommerce-admin/pull/3662) * Use wp-cron for admin note snoozing. * Remove "unsnooze" scheduled action. * Use correct version. * Avoid using deprecated method for unscheduling actions. * Onboarding: Fix toggle tracking events (https://github.com/woocommerce/woocommerce-admin/pull/3645) * Fix errant wcadmin prefix on event name * Track the onboarding toggle on the option in case enable_onboarding isn't used * Move toggle actions to separate function * Move onboarding actions * Move onboarding filters * Move help tab updates to add_toggle_actions * Only run onboarding actions when enabled * Onboarding: Add tracks events when profiler steps are completed (https://github.com/woocommerce/woocommerce-admin/pull/3726) * Add tracks for store profiler step completion * Record event when profiler is completed * Ensure continue setup loads the onboarding profiler (https://github.com/woocommerce/woocommerce-admin/pull/3646) * 'All that include' option removed when input field is empty (https://github.com/woocommerce/woocommerce-admin/pull/3700) * 'All that include' option removed when input field is empty Added a control to check that when the input field 'Search by customer name' is empty, the 'All that include' option is not appearing. * Const name improved The constant name hasValues was changed to optionsHaveValues (more descriptive) * Fix select text alignment (https://github.com/woocommerce/woocommerce-admin/pull/3723) Co-authored-by: Timmy Crawford <timmyc@users.noreply.github.com> Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> Co-authored-by: Fernando <ultimoround@gmail.com> Co-authored-by: edmundcwm <edmundcwm@gmail.com>
2020-02-20 11:59:02 +00:00
recordEvent( 'storeprofiler_step_complete', {
step: currentStep.key,
wc_version: getSetting( 'wcVersion' ),
...tracksArgs,
Merge Version/1.0 to master (https://github.com/woocommerce/woocommerce-admin/pull/3740) * Try: Moving Customers to main Woo Menu (https://github.com/woocommerce/woocommerce-admin/pull/3632) * Only add onboarding settings on wc-admin pages when task list should be shown. (https://github.com/woocommerce/woocommerce-admin/pull/3722) * Use cron for unsnoozing admin notes (https://github.com/woocommerce/woocommerce-admin/pull/3662) * Use wp-cron for admin note snoozing. * Remove "unsnooze" scheduled action. * Use correct version. * Avoid using deprecated method for unscheduling actions. * Onboarding: Fix toggle tracking events (https://github.com/woocommerce/woocommerce-admin/pull/3645) * Fix errant wcadmin prefix on event name * Track the onboarding toggle on the option in case enable_onboarding isn't used * Move toggle actions to separate function * Move onboarding actions * Move onboarding filters * Move help tab updates to add_toggle_actions * Only run onboarding actions when enabled * Onboarding: Add tracks events when profiler steps are completed (https://github.com/woocommerce/woocommerce-admin/pull/3726) * Add tracks for store profiler step completion * Record event when profiler is completed * Ensure continue setup loads the onboarding profiler (https://github.com/woocommerce/woocommerce-admin/pull/3646) * 'All that include' option removed when input field is empty (https://github.com/woocommerce/woocommerce-admin/pull/3700) * 'All that include' option removed when input field is empty Added a control to check that when the input field 'Search by customer name' is empty, the 'All that include' option is not appearing. * Const name improved The constant name hasValues was changed to optionsHaveValues (more descriptive) * Fix select text alignment (https://github.com/woocommerce/woocommerce-admin/pull/3723) Co-authored-by: Timmy Crawford <timmyc@users.noreply.github.com> Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> Co-authored-by: Fernando <ultimoround@gmail.com> Co-authored-by: edmundcwm <edmundcwm@gmail.com>
2020-02-20 11:59:02 +00:00
} );
// Update the activePlugins cache in case plugins were installed
// in the current step that affect the visibility of the next step.
this.cachedActivePlugins = activePlugins;
const nextStep = this.getSteps()[ currentStepIndex + 1 ];
if ( typeof nextStep === 'undefined' ) {
this.completeProfiler();
return;
}
return updateQueryString( { step: nextStep.key } );
}
completeProfiler() {
const {
activePlugins,
isJetpackConnected,
notes,
updateNote,
updateProfileItems,
connectToJetpack,
} = this.props;
Merge Version/1.0 to master (https://github.com/woocommerce/woocommerce-admin/pull/3740) * Try: Moving Customers to main Woo Menu (https://github.com/woocommerce/woocommerce-admin/pull/3632) * Only add onboarding settings on wc-admin pages when task list should be shown. (https://github.com/woocommerce/woocommerce-admin/pull/3722) * Use cron for unsnoozing admin notes (https://github.com/woocommerce/woocommerce-admin/pull/3662) * Use wp-cron for admin note snoozing. * Remove "unsnooze" scheduled action. * Use correct version. * Avoid using deprecated method for unscheduling actions. * Onboarding: Fix toggle tracking events (https://github.com/woocommerce/woocommerce-admin/pull/3645) * Fix errant wcadmin prefix on event name * Track the onboarding toggle on the option in case enable_onboarding isn't used * Move toggle actions to separate function * Move onboarding actions * Move onboarding filters * Move help tab updates to add_toggle_actions * Only run onboarding actions when enabled * Onboarding: Add tracks events when profiler steps are completed (https://github.com/woocommerce/woocommerce-admin/pull/3726) * Add tracks for store profiler step completion * Record event when profiler is completed * Ensure continue setup loads the onboarding profiler (https://github.com/woocommerce/woocommerce-admin/pull/3646) * 'All that include' option removed when input field is empty (https://github.com/woocommerce/woocommerce-admin/pull/3700) * 'All that include' option removed when input field is empty Added a control to check that when the input field 'Search by customer name' is empty, the 'All that include' option is not appearing. * Const name improved The constant name hasValues was changed to optionsHaveValues (more descriptive) * Fix select text alignment (https://github.com/woocommerce/woocommerce-admin/pull/3723) Co-authored-by: Timmy Crawford <timmyc@users.noreply.github.com> Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> Co-authored-by: Fernando <ultimoround@gmail.com> Co-authored-by: edmundcwm <edmundcwm@gmail.com>
2020-02-20 11:59:02 +00:00
recordEvent( 'storeprofiler_complete' );
const shouldConnectJetpack =
activePlugins.includes( 'jetpack' ) && ! isJetpackConnected;
const profilerNote = notes.find(
( note ) => note.name === 'wc-admin-onboarding-profiler-reminder'
);
if ( profilerNote ) {
updateNote( profilerNote.id, { status: 'actioned' } );
}
updateProfileItems( { completed: true } ).then( () => {
const homescreenUrl = new URL(
getNewPath( {}, '/', {} ),
window.location.href
).href;
if ( shouldConnectJetpack ) {
document.body.classList.add( 'woocommerce-admin-is-loading' );
connectToJetpack( () => {
return homescreenUrl;
} );
} else {
window.location.href = homescreenUrl;
}
} );
}
Added skip profiler functionality (https://github.com/woocommerce/woocommerce-admin/pull/4721) * Added skip profiler functionality This commit adds the skip profiler functionality, leaving the Home screen `Store details` as incomplete. # Conflicts: # client/task-list/tasks.js * Unit tests repaiared * Added OBW page This commit makes the necessary changes to add an OBW page # Conflicts: # client/profile-wizard/index.js * Event name changed This commit renames the event name we were recording since it was wrong. * Redirection modified This commit modifies the way we do redirection # Conflicts: # client/profile-wizard/index.js * Removed `profiler` feature flag * Removed `profiler` feature flag This commit removes the `profiler` feature flag * Added error handling for `updateProfileItems` This commit adds error handling for the method `updateProfileItems` * Update client/profile-wizard/index.js Co-authored-by: Matt Sherman <matt.sherman@automattic.com> * Removed "throw" from "then" * Update client/dashboard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Update client/profile-wizard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Modified redirection URL This commit modifies the redirection URL. # Conflicts: # client/task-list/tasks.js # Conflicts: # client/profile-wizard/index.js * Removed the variable "lastStep" and the related logic. * Removed change of state for variable "skipped" * Added error trowing to onboarding actions This commit adds error trowing to onboarding actions * Removed response handling for `updateProfileItems` * Added default value for "profileItems" in Homescreen and Dashboard * Removed `step` from OnboardingProfile and test This commit removes the `step` from OnboardingProfile.php and from tests Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com> Co-authored-by: Matt Sherman <matt.sherman@automattic.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2020-07-16 15:17:10 +00:00
skipProfiler() {
const { createNotice, updateProfileItems } = this.props;
Added skip profiler functionality (https://github.com/woocommerce/woocommerce-admin/pull/4721) * Added skip profiler functionality This commit adds the skip profiler functionality, leaving the Home screen `Store details` as incomplete. # Conflicts: # client/task-list/tasks.js * Unit tests repaiared * Added OBW page This commit makes the necessary changes to add an OBW page # Conflicts: # client/profile-wizard/index.js * Event name changed This commit renames the event name we were recording since it was wrong. * Redirection modified This commit modifies the way we do redirection # Conflicts: # client/profile-wizard/index.js * Removed `profiler` feature flag * Removed `profiler` feature flag This commit removes the `profiler` feature flag * Added error handling for `updateProfileItems` This commit adds error handling for the method `updateProfileItems` * Update client/profile-wizard/index.js Co-authored-by: Matt Sherman <matt.sherman@automattic.com> * Removed "throw" from "then" * Update client/dashboard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Update client/profile-wizard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Modified redirection URL This commit modifies the redirection URL. # Conflicts: # client/task-list/tasks.js # Conflicts: # client/profile-wizard/index.js * Removed the variable "lastStep" and the related logic. * Removed change of state for variable "skipped" * Added error trowing to onboarding actions This commit adds error trowing to onboarding actions * Removed response handling for `updateProfileItems` * Added default value for "profileItems" in Homescreen and Dashboard * Removed `step` from OnboardingProfile and test This commit removes the `step` from OnboardingProfile.php and from tests Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com> Co-authored-by: Matt Sherman <matt.sherman@automattic.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2020-07-16 15:17:10 +00:00
updateProfileItems( { skipped: true } )
.then( () => {
recordEvent( 'storeprofiler_store_details_skip' );
getHistory().push( getNewPath( {}, '/', {} ) );
} )
.catch( () => {
createNotice(
'error',
__(
'There was a problem skipping the setup wizard',
'woocommerce'
Added skip profiler functionality (https://github.com/woocommerce/woocommerce-admin/pull/4721) * Added skip profiler functionality This commit adds the skip profiler functionality, leaving the Home screen `Store details` as incomplete. # Conflicts: # client/task-list/tasks.js * Unit tests repaiared * Added OBW page This commit makes the necessary changes to add an OBW page # Conflicts: # client/profile-wizard/index.js * Event name changed This commit renames the event name we were recording since it was wrong. * Redirection modified This commit modifies the way we do redirection # Conflicts: # client/profile-wizard/index.js * Removed `profiler` feature flag * Removed `profiler` feature flag This commit removes the `profiler` feature flag * Added error handling for `updateProfileItems` This commit adds error handling for the method `updateProfileItems` * Update client/profile-wizard/index.js Co-authored-by: Matt Sherman <matt.sherman@automattic.com> * Removed "throw" from "then" * Update client/dashboard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Update client/profile-wizard/index.js Co-authored-by: Joshua T Flowers <joshuatf@gmail.com> * Modified redirection URL This commit modifies the redirection URL. # Conflicts: # client/task-list/tasks.js # Conflicts: # client/profile-wizard/index.js * Removed the variable "lastStep" and the related logic. * Removed change of state for variable "skipped" * Added error trowing to onboarding actions This commit adds error trowing to onboarding actions * Removed response handling for `updateProfileItems` * Added default value for "profileItems" in Homescreen and Dashboard * Removed `step` from OnboardingProfile and test This commit removes the `step` from OnboardingProfile.php and from tests Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com> Co-authored-by: Matt Sherman <matt.sherman@automattic.com> Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2020-07-16 15:17:10 +00:00
)
);
} );
}
render() {
const { query } = this.props;
const step = this.getCurrentStep();
const stepKey = step.key;
const container = createElement( step.container, {
query,
step,
goToNextStep: this.goToNextStep,
skipProfiler: () => {
this.skipProfiler();
},
trackStepValueChanges: this.trackStepValueChanges,
updateCurrentStepValues: this.updateCurrentStepValues,
} );
const steps = this.getSteps().map( ( _step ) =>
pick( _step, [ 'key', 'label', 'isComplete' ] )
);
const classNames = `woocommerce-profile-wizard__container ${ stepKey }`;
return (
<>
<ProfileWizardHeader
currentStep={ stepKey }
steps={ steps }
stepValueChanges={ this.stepValueChanges }
/>
<div className={ classNames }>{ container }</div>
</>
);
}
}
export default compose(
withSelect( ( select ) => {
const { getNotes } = select( NOTES_STORE_NAME );
const { getProfileItems, getOnboardingError } = select(
ONBOARDING_STORE_NAME
);
const {
getActivePlugins,
getPluginsError,
isJetpackConnected,
} = select( PLUGINS_STORE_NAME );
const profileItems = getProfileItems();
const notesQuery = {
page: 1,
per_page: QUERY_DEFAULTS.pageSize,
type: 'update',
status: 'unactioned',
};
const notes = getNotes( notesQuery );
const activePlugins = getActivePlugins();
return {
getPluginsError,
isError: Boolean( getOnboardingError( 'updateProfileItems' ) ),
isJetpackConnected: isJetpackConnected(),
notes,
profileItems,
activePlugins,
};
} ),
withDispatch( ( dispatch ) => {
const {
connectToJetpackWithFailureRedirect,
createErrorNotice,
} = dispatch( PLUGINS_STORE_NAME );
const { updateNote } = dispatch( NOTES_STORE_NAME );
const { updateOptions } = dispatch( OPTIONS_STORE_NAME );
const { updateProfileItems } = dispatch( ONBOARDING_STORE_NAME );
const { createNotice } = dispatch( 'core/notices' );
const connectToJetpack = ( failureRedirect ) => {
connectToJetpackWithFailureRedirect(
failureRedirect,
createErrorNotice,
getAdminLink
);
};
return {
connectToJetpack,
createNotice,
updateNote,
updateOptions,
updateProfileItems,
};
Use Route based code splitting to optimize bundle size (https://github.com/woocommerce/woocommerce-admin/pull/4094) * Use lazy loading to split up the size of the js downloaded * Use lazy loading to split up the size of the js downloaded * Add Moment Timezone plugin to reduce size of data file. * Lazy load header panels and use Dashicons for faster loading * Load assets from the correct publicPath * Load assets from the correct publicPath * PHP cs fixes * Fix missing quotes on string literal. * Fix PropType warning for lazy loaded component. * Separate the task list and dashboard chunks. * Lazy load dashboard sections. * Restore original icons and reduce size by importing only the icons needed * Lazy load alerts to save more Kb on initial load * Minify built JS in production mode. * Add preload tags for WC Admin assets. (https://github.com/woocommerce/woocommerce-admin/pull/4162) * Fix linting errors. * Add modified UnminifiedWebpackPlugin. * Produce minified and unminified bundles for all builds. * Remove unused variable from webpack config. * Run unminify after sourcemap generation. * Only hook after optimization if we're using a devtool. * Add minification suffix in Loader::get_url(). * Lazy load OBW on new home screen. * Move OBW style up a level to layout. * Hydrate ProfileWizard independently of withSelect and withDispatch * Fix order of composition and fallback function when using hydration. Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-04-29 18:01:27 +00:00
} ),
getAdminSetting( 'plugins' )
Use Route based code splitting to optimize bundle size (https://github.com/woocommerce/woocommerce-admin/pull/4094) * Use lazy loading to split up the size of the js downloaded * Use lazy loading to split up the size of the js downloaded * Add Moment Timezone plugin to reduce size of data file. * Lazy load header panels and use Dashicons for faster loading * Load assets from the correct publicPath * Load assets from the correct publicPath * PHP cs fixes * Fix missing quotes on string literal. * Fix PropType warning for lazy loaded component. * Separate the task list and dashboard chunks. * Lazy load dashboard sections. * Restore original icons and reduce size by importing only the icons needed * Lazy load alerts to save more Kb on initial load * Minify built JS in production mode. * Add preload tags for WC Admin assets. (https://github.com/woocommerce/woocommerce-admin/pull/4162) * Fix linting errors. * Add modified UnminifiedWebpackPlugin. * Produce minified and unminified bundles for all builds. * Remove unused variable from webpack config. * Run unminify after sourcemap generation. * Only hook after optimization if we're using a devtool. * Add minification suffix in Loader::get_url(). * Lazy load OBW on new home screen. * Move OBW style up a level to layout. * Hydrate ProfileWizard independently of withSelect and withDispatch * Fix order of composition and fallback function when using hydration. Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-04-29 18:01:27 +00:00
? withPluginsHydration( {
...getAdminSetting( 'plugins' ),
jetpackStatus: getAdminSetting( 'dataEndpoints', {} )
.jetpackStatus,
Use Route based code splitting to optimize bundle size (https://github.com/woocommerce/woocommerce-admin/pull/4094) * Use lazy loading to split up the size of the js downloaded * Use lazy loading to split up the size of the js downloaded * Add Moment Timezone plugin to reduce size of data file. * Lazy load header panels and use Dashicons for faster loading * Load assets from the correct publicPath * Load assets from the correct publicPath * PHP cs fixes * Fix missing quotes on string literal. * Fix PropType warning for lazy loaded component. * Separate the task list and dashboard chunks. * Lazy load dashboard sections. * Restore original icons and reduce size by importing only the icons needed * Lazy load alerts to save more Kb on initial load * Minify built JS in production mode. * Add preload tags for WC Admin assets. (https://github.com/woocommerce/woocommerce-admin/pull/4162) * Fix linting errors. * Add modified UnminifiedWebpackPlugin. * Produce minified and unminified bundles for all builds. * Remove unused variable from webpack config. * Run unminify after sourcemap generation. * Only hook after optimization if we're using a devtool. * Add minification suffix in Loader::get_url(). * Lazy load OBW on new home screen. * Move OBW style up a level to layout. * Hydrate ProfileWizard independently of withSelect and withDispatch * Fix order of composition and fallback function when using hydration. Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com> Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-04-29 18:01:27 +00:00
} )
: identity
)( ProfileWizard );