From 85dc89a763198e27ff81efd8a95b06b3c769f97a Mon Sep 17 00:00:00 2001 From: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com> Date: Tue, 5 Jul 2022 19:53:16 +0300 Subject: [PATCH] Remove deprecated features (#1088) * Remove deprecated features * update * update --- packages/sitecore-jss-angular/src/public_api.ts | 2 -- packages/sitecore-jss-nextjs/src/index.ts | 11 ++--------- packages/sitecore-jss-nextjs/src/utils.ts | 10 ---------- packages/sitecore-jss-react-native/src/index.ts | 7 +------ .../src/enhancers/withEditorChromes.tsx | 5 ----- packages/sitecore-jss-react/src/index.ts | 9 ++------- packages/sitecore-jss-vue/src/index.ts | 2 -- packages/sitecore-jss/src/utils/editing.ts | 13 ------------- packages/sitecore-jss/src/utils/index.ts | 2 -- 9 files changed, 5 insertions(+), 56 deletions(-) diff --git a/packages/sitecore-jss-angular/src/public_api.ts b/packages/sitecore-jss-angular/src/public_api.ts index e54a76b4fe..45ea7d2d74 100644 --- a/packages/sitecore-jss-angular/src/public_api.ts +++ b/packages/sitecore-jss-angular/src/public_api.ts @@ -43,8 +43,6 @@ export { export { constants, HttpDataFetcher, HttpResponse, enableDebug } from '@sitecore-jss/sitecore-jss'; export { isServer, - isExperienceEditorActive, - resetExperienceEditorChromes, isEditorActive, resetEditorChromes, handleEditorAnchors, diff --git a/packages/sitecore-jss-nextjs/src/index.ts b/packages/sitecore-jss-nextjs/src/index.ts index 2ea9ab5111..2c3d1cccc0 100644 --- a/packages/sitecore-jss-nextjs/src/index.ts +++ b/packages/sitecore-jss-nextjs/src/index.ts @@ -9,13 +9,7 @@ export { NativeDataFetcherConfig, enableDebug, } from '@sitecore-jss/sitecore-jss'; -export { - isEditorActive, - resetEditorChromes, - isExperienceEditorActive, - resetExperienceEditorChromes, - resolveUrl, -} from '@sitecore-jss/sitecore-jss/utils'; +export { isEditorActive, resetEditorChromes, resolveUrl } from '@sitecore-jss/sitecore-jss/utils'; export { LayoutService, LayoutServiceData, @@ -100,7 +94,7 @@ export { useComponentProps, } from './components/ComponentPropsContext'; -export { handleEditorFastRefresh, handleExperienceEditorFastRefresh, getPublicUrl } from './utils'; +export { handleEditorFastRefresh, getPublicUrl } from './utils'; export { EditingData, EditingPreviewData, isEditingData } from './sharedTypes/editing-data'; export { @@ -137,7 +131,6 @@ export { withSitecoreContext, useSitecoreContext, withEditorChromes, - withExperienceEditorChromes, withPlaceholder, withDatasourceCheck, ImageSizeParameters, diff --git a/packages/sitecore-jss-nextjs/src/utils.ts b/packages/sitecore-jss-nextjs/src/utils.ts index 254a9805d9..cb76cb3916 100644 --- a/packages/sitecore-jss-nextjs/src/utils.ts +++ b/packages/sitecore-jss-nextjs/src/utils.ts @@ -68,16 +68,6 @@ export const handleEditorFastRefresh = (forceReload = false): void => { }; }; -/** - * Since Sitecore editors do not support Fast Refresh: - * 1. Subscribe on events provided by webpack. - * 2. Reset editor chromes when build is finished - * @deprecated Will be removed in a future release. Please use handleEditorFastRefresh instead. - * @param {boolean} [forceReload] force page reload instead of reset chromes - * @default forceReload false - */ -export const handleExperienceEditorFastRefresh = handleEditorFastRefresh; - export const getJssEditingSecret = (): string => { const secret = process.env.JSS_EDITING_SECRET; if (!secret || secret.length === 0) { diff --git a/packages/sitecore-jss-react-native/src/index.ts b/packages/sitecore-jss-react-native/src/index.ts index c139fcecfe..02c298308a 100644 --- a/packages/sitecore-jss-react-native/src/index.ts +++ b/packages/sitecore-jss-react-native/src/index.ts @@ -1,9 +1,4 @@ -export { - isEditorActive, - resetEditorChromes, - isExperienceEditorActive, - resetExperienceEditorChromes, -} from '@sitecore-jss/sitecore-jss/utils'; +export { isEditorActive, resetEditorChromes } from '@sitecore-jss/sitecore-jss/utils'; export { mediaApi } from '@sitecore-jss/sitecore-jss/media'; export { RestLayoutService, diff --git a/packages/sitecore-jss-react/src/enhancers/withEditorChromes.tsx b/packages/sitecore-jss-react/src/enhancers/withEditorChromes.tsx index 62babf81f1..aae36d5478 100644 --- a/packages/sitecore-jss-react/src/enhancers/withEditorChromes.tsx +++ b/packages/sitecore-jss-react/src/enhancers/withEditorChromes.tsx @@ -19,8 +19,3 @@ export const withEditorChromes = ( return Enhancer as React.ComponentClass; }; - -/** - * @deprecated Will be removed in a future release. Please use withEditorChromes instead. - */ -export const withExperienceEditorChromes = withEditorChromes; diff --git a/packages/sitecore-jss-react/src/index.ts b/packages/sitecore-jss-react/src/index.ts index 8ac75239e8..5f28056fd4 100644 --- a/packages/sitecore-jss-react/src/index.ts +++ b/packages/sitecore-jss-react/src/index.ts @@ -1,10 +1,5 @@ export { constants, enableDebug } from '@sitecore-jss/sitecore-jss'; -export { - isExperienceEditorActive, - resetExperienceEditorChromes, - isEditorActive, - resetEditorChromes, -} from '@sitecore-jss/sitecore-jss/utils'; +export { isEditorActive, resetEditorChromes } from '@sitecore-jss/sitecore-jss/utils'; export { LayoutService, LayoutServiceData, @@ -69,6 +64,6 @@ export { WithSitecoreContextProps, WithSitecoreContextHocProps, } from './enhancers/withSitecoreContext'; -export { withEditorChromes, withExperienceEditorChromes } from './enhancers/withEditorChromes'; +export { withEditorChromes } from './enhancers/withEditorChromes'; export { withPlaceholder } from './enhancers/withPlaceholder'; export { withDatasourceCheck } from './enhancers/withDatasourceCheck'; diff --git a/packages/sitecore-jss-vue/src/index.ts b/packages/sitecore-jss-vue/src/index.ts index 2100052d7c..b9de9db833 100644 --- a/packages/sitecore-jss-vue/src/index.ts +++ b/packages/sitecore-jss-vue/src/index.ts @@ -1,8 +1,6 @@ export { isEditorActive, resetEditorChromes, - isExperienceEditorActive, - resetExperienceEditorChromes, handleEditorAnchors, } from '@sitecore-jss/sitecore-jss/utils'; export { constants, enableDebug } from '@sitecore-jss/sitecore-jss'; diff --git a/packages/sitecore-jss/src/utils/editing.ts b/packages/sitecore-jss/src/utils/editing.ts index 7f2f43921f..f0723dcc73 100644 --- a/packages/sitecore-jss/src/utils/editing.ts +++ b/packages/sitecore-jss/src/utils/editing.ts @@ -128,16 +128,3 @@ export const handleEditorAnchors = () => { observer.observe(targetNode, observerOptions); } }; - -/** - * Determines whether the current execution context is within the Sitecore Experience Editor - * @deprecated Will be removed in a future release. Please use isEditorActive instead. - * @returns true if executing within the Sitecore Experience Editor - */ -export const isExperienceEditorActive = isEditorActive; - -/** - * Resets Sitecore Experience Editor "chromes" - * @deprecated Will be removed in a future release. Please use resetEditorChromes instead. - */ -export const resetExperienceEditorChromes = resetEditorChromes; diff --git a/packages/sitecore-jss/src/utils/index.ts b/packages/sitecore-jss/src/utils/index.ts index f4e10c261c..7539a87eb7 100644 --- a/packages/sitecore-jss/src/utils/index.ts +++ b/packages/sitecore-jss/src/utils/index.ts @@ -5,7 +5,5 @@ export { HorizonEditor, isEditorActive, resetEditorChromes, - isExperienceEditorActive, - resetExperienceEditorChromes, handleEditorAnchors, } from './editing';