Skip to content
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

Demo v2 - Full rework of the demo examples #52

Merged
merged 74 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
7aa48e6
Move examples to /examples + add page templates for SSG/SSR + start r…
Vadorequest May 19, 2020
b8c8438
Merge branch 'v1-hyb-mst-aptd-gcms-lcz-sty' into examples-v2
Vadorequest May 20, 2020
6f7454c
Add SSG doc (skeleton)
Vadorequest May 20, 2020
b026bc9
Disable react/no-unescaped-entities eslint rule (too much noise compa…
Vadorequest May 21, 2020
0b6e694
Add more doc + refactor components
Vadorequest May 21, 2020
44c59e4
Improve cards buttons
Vadorequest May 21, 2020
3cca48d
Add <Code> component to display source code
Vadorequest May 21, 2020
3feb1c0
Add css-in-js examples
Vadorequest May 21, 2020
7842b6b
Add analytics examples
Vadorequest May 21, 2020
370b567
Add testing doc
Vadorequest May 21, 2020
10c5e52
Add icons example
Vadorequest May 21, 2020
9420c22
Add animations example + fix AnimatedLoader animation
Vadorequest May 21, 2020
f94b808
Add UI components example
Vadorequest May 21, 2020
30b8cea
Add ExternalFeaturesSection with NRN-Admin
Vadorequest May 21, 2020
cc03105
Rename all example page component (forgot) + add example with I18nLin…
Vadorequest May 21, 2020
2179f36
Add examples with hooks utilities
Vadorequest May 21, 2020
e61aa4d
Add examples with API utilities
Vadorequest May 21, 2020
70402c6
Add more utilities examples
Vadorequest May 23, 2020
fdafad1
Add simple, yet responsive Sidebar component
Vadorequest May 23, 2020
78ba681
Refactor SidebarToggle as a reusable component
Vadorequest May 23, 2020
67648bf
Refactor PageContainer (=> DefaultPageContainer) as a reusable component
Vadorequest May 23, 2020
1fc9d7c
Add SidebarFooter for easier navigation
Vadorequest May 23, 2020
9d04190
Reorder examples pages between sections (different folders) + add sid…
Vadorequest May 23, 2020
50d6b4a
Improve mobile support (readability)
Vadorequest May 23, 2020
7babe75
Refactor sidebars + improve links/titles for examples pages
Vadorequest May 23, 2020
977118f
Add dropdown menu with all links to all examples
Vadorequest May 23, 2020
ce929bb
Fix typo
Vadorequest May 23, 2020
0f9ad1f
Fix CI
Vadorequest May 23, 2020
103f6d4
Tsconfig ignore non-code folders (maybe increase compilation perfs?)
Vadorequest May 25, 2020
e8c4bb5
Add TS doc bloc
Vadorequest May 25, 2020
9325a88
Add CI/CD examples
Vadorequest May 25, 2020
1ba5b92
Add a "max cards per row" option for Cards component
Vadorequest May 25, 2020
a56f1b4
Add Stages and Secrets doc
Vadorequest May 25, 2020
86a8980
Improve display on small devices
Vadorequest May 25, 2020
b914e60
Add Vercel hosting doc
Vadorequest May 25, 2020
62c54b1
Add MST doc
Vadorequest May 25, 2020
2901f95
Misc doc
Vadorequest May 25, 2020
65448b7
Add /docs folder to provide a built-in docs site easily, based on NRN…
Vadorequest May 25, 2020
52d861a
Ignore .idea codeStyles (avoids conflicts)
Vadorequest May 25, 2020
797d96b
Add docs site doc + reorder doc items
Vadorequest May 25, 2020
94f3e57
Add HOCs doc
Vadorequest May 25, 2020
692a4ba
Replace @ts-ignore directive by recently added (TS v3.9) @ts-expect-e…
Vadorequest May 25, 2020
03e90ab
Fix TS errors
Vadorequest May 25, 2020
d4f0e4b
Fix headings for all examples + add errors handling examples
Vadorequest May 25, 2020
9846e2e
Attempt to make Vercel build a page that's meant to fail
Vadorequest May 25, 2020
6b62fd1
Another attempt to make Vercel build a page that's meant to fail
Vadorequest May 25, 2020
8db24cf
Improve error handling examples
Vadorequest May 25, 2020
582d633
Make Page error example crash page on btn click
Vadorequest May 25, 2020
53b0f85
Improve interactive error page
Vadorequest May 25, 2020
b54f416
WDYR (why-did-you-render) helps locate unnecessary re-renders and fix…
Vadorequest May 26, 2020
70717fd
WYDR - Use better defaults
Vadorequest May 26, 2020
80182c0
Fix useless re-render (thanks to WDYR)
Vadorequest May 26, 2020
c08feb8
Add "Tracking useless re-renders" doc
Vadorequest May 26, 2020
a105fd6
Add ssg/r examples
Vadorequest May 27, 2020
03b1c18
Misc wording
Vadorequest May 27, 2020
4cc03c4
Cleanup GQL queries and SSG/SSR examples
Vadorequest May 27, 2020
47049c2
Improve StaticPathsOutput type to better match Next.js expectations
Vadorequest May 27, 2020
fd95ce9
Fix E2E tests
Vadorequest May 27, 2020
5460665
Misc doc rewrite
Vadorequest May 27, 2020
d5e23bd
Attempt at SSG wit fallback example (not sure if it works in non-dev …
Vadorequest May 27, 2020
32ee575
Clenaup logs
Vadorequest May 27, 2020
8176ad3
Attempt to make errors display properly in browser console
Vadorequest May 27, 2020
5f8bf63
Add more debug logs
Vadorequest May 27, 2020
8245fcd
Disable rewrite for _next base path
Vadorequest May 27, 2020
4ba9bb8
Attempt to improve handling of top-level unrecoverable fatal errors
Vadorequest May 27, 2020
d5a27ec
Remove jsonplaceholder (too slow) and simulate an API call
Vadorequest May 27, 2020
34fe273
Add isSSGFallbackInitialBuild prop for all pages and properly handle …
Vadorequest May 27, 2020
08a2209
Improve fallback testing explanations
Vadorequest May 27, 2020
d20d464
Refactor I18nLink to make it easier to use with dynamic params
Vadorequest May 27, 2020
75cb28b
Rename example pages and related vars
Vadorequest May 27, 2020
ac88497
Rename example pages and related vars (oops)
Vadorequest May 27, 2020
783bd44
Add revalidate example
Vadorequest May 27, 2020
0d61148
Add NativeFeaturesSidebar
Vadorequest May 27, 2020
e878bef
Use real link to force refresh revalidate page (may work better)
Vadorequest May 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more debug logs
  • Loading branch information
Vadorequest committed May 27, 2020
commit 5f8bf63f5e47df341da8000da126d506b36f5b19
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ export const getStaticProps: GetStaticProps<SSGPageProps, StaticParams> = async
Sentry.captureException(error);
});

return deepmerge(commonStaticProps, {
const staticProps: StaticPropsOutput = deepmerge(commonStaticProps, {
props: {
album,
albumId,
},
});

console.debug('getStaticProps.staticProps', staticProps);

return staticProps;
};

/**
Expand All @@ -67,10 +71,14 @@ export const getStaticPaths: GetStaticPaths<StaticParams> = async (): Promise<St
});
});

return {
const staticPaths: StaticPathsOutput = {
...commonStaticPaths,
fallback: true,
};

console.debug('getStaticPaths.staticPaths', getStaticPaths);

return staticPaths;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import deepmerge from 'deepmerge';
import map from 'lodash.map';
import size from 'lodash.size';
import { GetStaticPaths, GetStaticProps, NextPage } from 'next';
import { NextRouter, useRouter } from 'next/router';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-unused-vars
import React from 'react';
import { Alert, Container } from 'reactstrap';
Expand Down Expand Up @@ -105,7 +104,6 @@ type Props = {

const ProductsWithSSGPage: NextPage<Props> = (props): JSX.Element => {
const { products } = props;
const router: NextRouter = useRouter();

return (
<DefaultLayout
Expand Down