Skip to content

Commit

Permalink
Fix regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest committed May 12, 2021
1 parent dc1b1b9 commit cbf5250
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/layouts/core/coreLayoutSSG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const getCoreStaticProps: GetStaticProps<SSGPageProps, CommonServerSidePa
props: {
bestCountryCodes,
serializedDataset: serializeSafe(dataset),
customer,
customerRef,
i18nTranslations,
hasLocaleFromUrl,
Expand Down
2 changes: 0 additions & 2 deletions src/layouts/core/types/MultiversalPageProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Customer } from '@/modules/core/data/types/Customer';
import { I18nextResources } from '@/modules/core/i18n/i18nextLocize';

/**
Expand All @@ -11,7 +10,6 @@ import { I18nextResources } from '@/modules/core/i18n/i18nextLocize';
export type MultiversalPageProps<E extends {} = {}> = {
bestCountryCodes: string[];
serializedDataset: string; // Transferred from server to browser as JSON (using Flatten.stringify), then parsed on the browser/server within the MultiversalAppBootstrap
customer: Customer;
customerRef: string;
error?: Error; // Only defined if there was an error
hasLocaleFromUrl: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/layouts/demo/demoLayoutSSG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const getDemoStaticProps: GetStaticProps<SSGPageProps, CommonServerSidePa
props: {
bestCountryCodes,
serializedDataset: serializeSafe(dataset),
customer,
customerRef,
i18nTranslations,
hasLocaleFromUrl,
Expand Down
4 changes: 0 additions & 4 deletions src/layouts/public/publicLayoutSSG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { StaticPath } from '@/app/types/StaticPath';
import { StaticPathsOutput } from '@/app/types/StaticPathsOutput';
import { StaticPropsInput } from '@/app/types/StaticPropsInput';
import { SSGPageProps } from '@/layouts/core/types/SSGPageProps';
import { APOLLO_STATE_PROP_NAME } from '@/modules/core/apollo/apolloClient';
import { Customer } from '@/modules/core/data/types/Customer';
import { DEFAULT_LOCALE } from '@/modules/core/i18n/i18n';
import { supportedLocales } from '@/modules/core/i18n/i18nConfig';
Expand Down Expand Up @@ -86,15 +85,12 @@ export const getPublicLayoutStaticProps: GetStaticProps<SSGPageProps, CommonServ
return {
// Props returned here will be available as page properties (pageProps)
props: {
[APOLLO_STATE_PROP_NAME]: {}, // Empty Apollo cache
bestCountryCodes: [], // We don't need any because we're not calling a GraphQL endpoint using this layout
serializedDataset: serializeSafe({
customer,
}),
customer,
customerRef,
i18nTranslations,
gcmsLocales: null,
hasLocaleFromUrl,
isReadyToRender: true,
isStaticRendering: true,
Expand Down
1 change: 1 addition & 0 deletions src/modules/core/amplitude/amplitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export enum AMPLITUDE_ACTIONS {
*/
export enum AMPLITUDE_PAGES {
DEMO_HOME_PAGE = 'demo',
PREVIEW_PRODUCT_PAGE = 'demo/preview-product',
TERMS_PAGE = 'demo/terms',
PRIVACY_PAGE = 'demo/privacy',
TEMPLATE_SSG_PAGE = 'template-ssg',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Head, { HeadProps } from '@/layouts/core/components/Head';
import Head, { HeadProps } from '@/layouts/demo/components/DemoHead';
import { SoftPageProps } from '@/layouts/core/types/SoftPageProps';
import { GenericObject } from '@/modules/core/data/types/GenericObject';
import { createLogger } from '@/modules/core/logging/logger';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[locale]/demo/built-in-features/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DemoPage from '@/layouts/demo/components/DemoPage';
import {
getDemoStaticPaths,
getDemoStaticProps,
} from '@/layouts/demo/demoSSG';
} from '@/layouts/demo/demoLayoutSSG';
import { createLogger } from '@/modules/core/logging/logger';
import {
GetStaticPaths,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[locale]/demo/built-in-features/md-as-jsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DemoPage from '@/layouts/demo/components/DemoPage';
import {
getDemoStaticPaths,
getDemoStaticProps,
} from '@/layouts/demo/demoSSG';
} from '@/layouts/demo/demoLayoutSSG';
import I18nLink from '@/modules/core/i18n/components/I18nLink';
import { createLogger } from '@/modules/core/logging/logger';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DemoPage from '@/layouts/demo/components/DemoPage';
import {
getDemoStaticPaths,
getDemoStaticProps,
} from '@/layouts/demo/demoSSG';
} from '@/layouts/demo/demoLayoutSSG';
import AirtableAsset from '@/modules/core/airtable/components/AirtableAsset';
import useCustomer from '@/modules/core/data/hooks/useCustomer';
import { AirtableRecord } from '@/modules/core/data/types/AirtableRecord';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[locale]/demo/built-in-utilities/hocs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import DemoPage from '@/layouts/demo/components/DemoPage';
import {
getDemoStaticPaths,
getDemoStaticProps,
} from '@/layouts/demo/demoSSG';
} from '@/layouts/demo/demoLayoutSSG';
import { createLogger } from '@/modules/core/logging/logger';
import { css } from '@emotion/react';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[locale]/demo/quick-preview/preview-product.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ProductRow from '@/components/dataDisplay/ProductRow';
import { OnlyBrowserPageProps } from '@/layouts/core/types/OnlyBrowserPageProps';
import { SSGPageProps } from '@/layouts/core/types/SSGPageProps';
import { SSRPageProps } from '@/layouts/core/types/SSRPageProps';
import { getDemoServerSideProps } from '@/layouts/demo/demoSSR';
import { getDemoServerSideProps } from '@/layouts/demo/demoLayoutSSR';
import { AMPLITUDE_PAGES } from '@/modules/core/amplitude/amplitude';
import useCustomer from '@/modules/core/data/hooks/useCustomer';
import { AirtableRecord } from '@/modules/core/data/types/AirtableRecord';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[locale]/demo/terms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const getStaticPaths: GetStaticPaths<CommonServerSideParams> = getDemoSta
* @see https://github.com/vercel/next.js/discussions/10949#discussioncomment-6884
* @see https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation
*/
export const getStaticProps: GetStaticProps<SSGPageProps, CommonServerSideParams> = getDefaultStaticProps;
export const getStaticProps: GetStaticProps<SSGPageProps, CommonServerSideParams> = getDemoStaticProps;

/**
* SSG pages are first rendered by the server (during static bundling)
Expand Down

1 comment on commit cbf5250

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.