Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
b9b71ba
Copyedit of Auth guide for sign-in, sign-up, and sign-out
hibler13 Sep 26, 2023
1a7efbd
Merge branch 'main' into src/pages/lib/auth/emailpassword/q/platform
hibler13 Sep 26, 2023
2217584
add pr version of link checker script
Sep 27, 2023
3eea134
Updated authenticator callout for react native
heatheramz Sep 27, 2023
e1e5994
convert server to use serve instead of next-start
Sep 28, 2023
ca1f516
add static server for testing
Sep 28, 2023
b69702a
update broken link for pr script
Sep 28, 2023
936e98f
update link checker script, add dev mode and pr link checker
Sep 29, 2023
51024b5
update link script
Sep 29, 2023
3bad97d
remove unused code
Sep 29, 2023
2774f49
Merge branch 'main' into update-link-script
jacoblogan Oct 3, 2023
da6f332
add axios timeout
Oct 5, 2023
3f808a7
merge main
Oct 5, 2023
7681f8f
remove unused command
Oct 5, 2023
874f474
Merge branch 'main' into update-link-script
jacoblogan Oct 6, 2023
76eb5c6
remove choose filter filtering
Oct 8, 2023
e5f5a8c
Merge branch 'update-link-script' of github.com:aws-amplify/docs into…
Oct 8, 2023
4db2f8a
update links
Oct 9, 2023
a233126
correct directory.mjs entry add react-native lib-v1 base page
Oct 9, 2023
d271e79
Merge branch 'main' into update-links
jacoblogan Oct 9, 2023
aa63907
Update overview.mdx
renebrandel Oct 9, 2023
c17f870
remove permissions
Oct 9, 2023
93f44af
Merge pull request #5985 from aws-amplify/renebrandel-patch-2
jacoblogan Oct 10, 2023
8e9b41b
Merge branch 'main' into update-links
jacoblogan Oct 10, 2023
ce998d7
Merge pull request #5984 from aws-amplify/update-links
jacoblogan Oct 10, 2023
8d5303e
Merge branch 'main' into update-link-script
jacoblogan Oct 10, 2023
01c0c71
update pathmap default
Oct 10, 2023
fd578d6
Merge branch 'update-link-script' of github.com:aws-amplify/docs into…
Oct 10, 2023
4281cc7
GH action to check bundlesize of PR (#5986)
katieklein Oct 10, 2023
1f277c7
adding needed index files
Oct 10, 2023
6ac9bc8
update-link-script
Oct 10, 2023
7f577d0
Update csp (#5987)
timngyn Oct 10, 2023
f1801bd
Merge branch 'main' into update-link-script
timngyn Oct 10, 2023
37d957d
Merge pull request #5950 from aws-amplify/update-link-script
jacoblogan Oct 10, 2023
d1395c4
update index script
Oct 10, 2023
4907da6
update write script
Oct 11, 2023
4757a54
add missing index files
Oct 11, 2023
62f74e7
revert ssg revert
Oct 11, 2023
6893c17
Merge branch 'revert-revert-ssg' into new-ssg
Oct 11, 2023
f56a526
add static generation to new js docs
Oct 11, 2023
e4f438a
add static paths to page
Oct 11, 2023
bcd27c6
remove unlinked and unbuilt pages
Oct 11, 2023
f87b72c
adding highlight for CDK support on main page
Oct 11, 2023
97cab46
Merge pull request #6001 from aws-amplify/renbran/cdk-highlight
renebrandel Oct 11, 2023
ac33e77
update pages to match filters and generate the same index files as main
Oct 11, 2023
383b840
Added What's New Banner
Oct 11, 2023
f333b57
Merge branch 'main' into renbran/home-banner
renebrandel Oct 11, 2023
f1cfefa
addressed based on Janaina's feedback
Oct 11, 2023
5bec31d
Merge pull request #6002 from aws-amplify/renbran/home-banner
renebrandel Oct 11, 2023
8d75c7b
merge main
Oct 11, 2023
4264a4a
Update data-modeling.mdx
renebrandel Oct 12, 2023
b035474
Merge pull request #6004 from aws-amplify/renebrandel-patch-2
renebrandel Oct 12, 2023
78afcf1
update table in fragment to resolve hydration issue
Oct 12, 2023
0e7bd37
render contribute getting started text in spans
Oct 13, 2023
1f74849
chore(flutter): remove null safety references (#5998)
haverchuck Oct 13, 2023
d56a530
Update versions.ts
gpanshu Oct 13, 2023
094cab6
Merge pull request #6012 from aws-amplify/update-android-version-2.14.0
gpanshu Oct 16, 2023
777d8c6
Update-project-setup (#6007)
Oct 16, 2023
bd67307
Merge branch 'main' into src/pages/lib/auth/emailpassword/q/platform
katieklein Oct 16, 2023
e00fd83
chore(deps): bump @aws-amplify/amplify-cli-core from 4.2.7 to 4.2.10 …
dependabot[bot] Oct 16, 2023
f393a22
Add custom analytics event for the "What's New" banner (#6006)
timngyn Oct 16, 2023
32c0b6a
update home page to update page context
Oct 16, 2023
fc8d54f
Merge branch 'main' into src/pages/lib/auth/emailpassword/q/platform
katieklein Oct 16, 2023
b64fab4
fix: updating @babel/traverse (#6025)
katieklein Oct 16, 2023
1c87119
update base lib, sdk, and guides pages
Oct 16, 2023
2ca08ed
update next/previous styles
Oct 17, 2023
f884da2
Merge branch 'main' into src/pages/lib/auth/emailpassword/q/platform
hibler13 Oct 17, 2023
4bb012b
Merge pull request #5939 from aws-amplify/src/pages/lib/auth/emailpas…
hibler13 Oct 17, 2023
558c85b
Amplify Android API Relational Models (#6020)
tylerjroach Oct 17, 2023
768a5d3
Update CODEOWNERS to exclude documentation team from all files (#6030)
timngyn Oct 17, 2023
f6e218d
chore: update auth docs now that cdk tokens are supported for adminRo…
alharris-at Oct 17, 2023
8434660
Update src/pages/cli/graphql/authorization-rules.mdx
renebrandel Oct 17, 2023
44bedf4
fix: update example naming
alharris-at Oct 17, 2023
b3ac743
Merge pull request #6032 from aws-amplify/update-cdk-docs
renebrandel Oct 17, 2023
2a6495f
Revert "Update CODEOWNERS to exclude documentation team from all file…
timngyn Oct 18, 2023
acb85c7
merge main
Oct 18, 2023
26855a3
update new page to include ssg required exports
Oct 18, 2023
b34fec6
update sample amplifyconfiguration json file (#5874)
phantumcode Oct 18, 2023
5218b04
Merge branch 'main' into new-ssg
jacoblogan Oct 18, 2023
3cae4eb
add choose your filter page
Oct 18, 2023
8058e56
filter out all but android (#6036)
katieklein Oct 18, 2023
34ab237
Merge branch 'main' into new-ssg
jacoblogan Oct 18, 2023
0714652
Merge pull request #5999 from aws-amplify/new-ssg
jacoblogan Oct 18, 2023
d02ca1a
Update Amplify Android Version
tylerjroach Oct 18, 2023
dabe5db
Merge pull request #6038 from aws-amplify/tylerjroach-patch-2
tylerjroach Oct 19, 2023
dbccabc
merge latest from main
hbuchel Oct 19, 2023
fc96b2f
revert InternalLink back to next-release/main, needs to be refactored…
hbuchel Oct 19, 2023
88cc195
fix versions export
hbuchel Oct 19, 2023
16cd7a1
Delete some tests for now from components that are going to be removed
hbuchel Oct 19, 2023
f727a11
Delete some tests for now from components that are going to be removed
hbuchel Oct 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
72 changes: 72 additions & 0 deletions .github/workflows/check_bundle_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Check Bundle Size
on:
pull_request:
branches: [main]
jobs:
checkBundleSizeChange:
permissions:
pull-requests: read
name: Check whether PR increases bundle size more than 5%
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 https://github.com/actions/checkout/commit/f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: main
- name: Setup Node.js 16.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 https://github.com/actions/setup-node/commit/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16.x
- name: Install dependencies
run: yarn
- name: Run build and analyze base bundle sizes
env:
CURRENT_BRANCH: ${{ github.base_ref }}
CURRENT_REPO: ${{ github.repository }}
NODE_OPTIONS: --max_old_space_size=4096
run: ANALYZE=true yarn next-build
- name: Check base bundle size of select pages
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: base-bundle-sizes
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { checkBundleSize } = require('./.github/workflows/scripts/check_bundle_size.js');
return checkBundleSize();
- name: Checkout PR branch
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 https://github.com/actions/checkout/commit/f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js 16.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v.3.8.1 https://github.com/actions/setup-node/commit/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16.x
- name: Install dependencies
run: yarn
- name: Run build and analyze head bundle sizes
env:
CURRENT_BRANCH: ${{ github.head_ref }}
CURRENT_REPO: ${{ github.repository }}
NODE_OPTIONS: --max_old_space_size=4096
run: ANALYZE=true yarn next-build
- name: Check head bundle size of select pages
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: head-bundle-sizes
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { checkBundleSize } = require('./.github/workflows/scripts/check_bundle_size.js');
return checkBundleSize();
- name: Compare bundle page bundle sizes
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: compare-bundles
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { compareBundles } = require('./.github/workflows/scripts/check_bundle_size.js');
const baseBundles = ${{ steps.base-bundle-sizes.outputs.result }}
const headBundles = ${{ steps.head-bundle-sizes.outputs.result }}
return await compareBundles(baseBundles, headBundles)
- name: Fail if bundle size growth exceeds 5% on any of the selected pages
if: ${{ steps.compare-bundles.outputs.result > 0 }}
run: exit 1
4 changes: 2 additions & 2 deletions .github/workflows/check_for_broken_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
with:
result-encoding: string
script: |
const { checkLinks } = require('./tasks/link-checker.js');
return await checkLinks();
const { checkProdLinks } = require('./tasks/link-checker.js');
return await checkProdLinks();
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check_pr_for_broken_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CheckPRLinks
on:
pull_request:
branches: [main]
types: [opened, synchronize]
jobs:
CheckPRLinks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 https://github.com/actions/checkout/commit/f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Setup Node.js 16.x
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 https://github.com/actions/setup-node/commit/e33196f7422957bea03ed53f6fbb155025ffc7b8
with:
node-version: 16.x
- name: Install Dependencies
run: yarn
- name: Run Build
run: yarn build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Run Server
run: |
node ./node_modules/.bin/serve client/www/next-build --no-request-logging &
sleep 5
- name: Run Link Checker
id: checkLinks
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
result-encoding: string
script: |
const { checkDevLinks } = require('./tasks/link-checker.js');
return await checkDevLinks();
- name: Fail if broken links have been found
if: ${{ steps.checkLinks.outputs.result }}
run: exit 1
47 changes: 47 additions & 0 deletions .github/workflows/scripts/check_bundle_size.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
checkBundleSize: () => {
const fs = require('fs');
const jsonString = fs.readFileSync('.github/analyze/bundles.json');
const data = JSON.parse(jsonString);
const pagesToCheck = [
'/',
'/cli/start/install',
'/lib/auth/getting-started/q/platform/[platform]',
'/start',
'/cli'
];
const bundleSizes = [];
data.pages.filter((page) => {
if (pagesToCheck.includes(page.label)) {
bundleSizes.push({
page: page.label,
gzipSize: page.gzipSize,
parsedSize: page.parsedSize,
statSize: page.statSize,
totalGzipSize: page.totalGzipSize,
totalParsedSize: page.totalParsedSize,
totalStatSize: page.totalStatSize
});
}
});
return bundleSizes;
},

compareBundles: (baseBundles, headBundles) => {
const fails = [];
baseBundles.forEach((basePage) => {
headBundles.forEach((headPage) => {
if (
basePage.page == headPage.page &&
basePage.parsedSize * 1.05 < headPage.parsedSize
) {
fails.push(basePage.page);
}
});
});
console.log(
`The bundle size of ${fails} increased by more than 5% with this PR`
);
return fails.length;
}
};
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,9 @@
"cloudwatchlogs",
"userids",
"xmark",
"refreshable"
"refreshable",
"querytransfers",
"generatemodelsforlazyloadandcustomselectionset"
],
"flagWords": ["hte", "full-stack", "Full-stack", "Full-Stack", "sudo"],
"patterns": [
Expand Down
2 changes: 1 addition & 1 deletion customHttp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ customHeaders:
- key: 'X-Content-Type-Options'
value: 'nosniff'
- key: 'Content-Security-Policy'
value: "upgrade-insecure-requests; default-src 'none'; prefetch-src 'self'; style-src 'self' 'unsafe-inline' *.shortbread.aws.dev; font-src 'self'; frame-src 'self' https://www.youtube-nocookie.com https://aws.demdex.net https://dpm.demdex.net; connect-src 'self' *.shortbread.aws.dev https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://d2c.aws.amazon.com https://vs.aws.amazon.com https://*.algolia.net https://*.algolianet.com *.amazonaws.com https://aws.amazon.com/ https://d2c-alpha.dse.marketing.aws.a2z.com https://aws-mktg-csds-alpha.integ.amazon.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; img-src 'self' https://img.shields.io https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; media-src 'self'; script-src 'self' *.shortbread.aws.dev https://a0.awsstatic.com/ https://aa0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://d2c.aws.amazon.com/;"
value: "upgrade-insecure-requests; default-src 'none'; style-src 'self' 'unsafe-inline' *.shortbread.aws.dev; font-src 'self'; frame-src 'self' https://www.youtube-nocookie.com https://aws.demdex.net https://dpm.demdex.net; connect-src 'self' *.shortbread.aws.dev https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://d2c.aws.amazon.com https://vs.aws.amazon.com https://*.algolia.net https://*.algolianet.com *.amazonaws.com https://aws.amazon.com/ https://d2c-alpha.dse.marketing.aws.a2z.com https://aws-mktg-csds-alpha.integ.amazon.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; img-src 'self' https://img.shields.io https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; media-src 'self'; script-src 'self' *.shortbread.aws.dev https://a0.awsstatic.com/ https://aa0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://d2c.aws.amazon.com/;"
# CSP also set in _document.tsx meta tag
30 changes: 6 additions & 24 deletions generatePathMap.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function generatePathMap(
'/lib-v1/q/platform/js': {
page: '/lib-v1/q/platform/[platform]'
},
'/lib-v1/q/platform/react-native': {
page: '/lib-v1/q/platform/[platform]'
},
'/sdk/q/platform/js': {
page: '/sdk/q/platform/[platform]'
},
Expand All @@ -79,6 +82,9 @@ function generatePathMap(
'/sdk/q/platform/flutter': {
page: '/sdk/q/platform/[platform]'
},
'/sdk/q/platform/react-native': {
page: '/sdk/q/platform/[platform]'
},
'/console': {
page: '/console'
},
Expand Down Expand Up @@ -120,19 +126,6 @@ function generatePathMap(
} else if (route.startsWith('/start')) {
filterKind = 'integration';
}

if (filterKind !== '') {
const aOrAn = 'aeiou'.includes(filterKind[0]) ? 'an' : 'a';
pathMap[route] = {
page: '/ChooseFilterPage',
query: {
address: route,
directoryPath: '/ChooseFilterPage',
filterKind: filterKind,
message: `Choose ${aOrAn} ${filterKind}:`
}
};
}
}

if (items) {
Expand Down Expand Up @@ -202,17 +195,6 @@ function generatePathMap(
page: `${route}/q/${routeType}/[${routeType}]`
};
});
const aOrAn = 'aeiou'.includes(routeType[0]) ? 'an' : 'a';
pathMap[route] = {
page: '/ChooseFilterPage',
query: {
address: route,
directoryPath: '/ChooseFilterPage',
filterKind: routeType,
filters: filters,
message: `Choose ${aOrAn} ${routeType}:`
}
};
}
return pathMap;
}
Expand Down
19 changes: 18 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default async () => {
}
});

const nextConfig = withMDX({
const shouldAnalyzeBundles = process.env.ANALYZE === 'true';

let nextConfig = withMDX({
env: {
BUILD_ENV: process.env.BUILD_ENV,
nextImageExportOptimizer_imageFolderPath: 'public',
Expand Down Expand Up @@ -75,5 +77,20 @@ export default async () => {
];
}
});

if (shouldAnalyzeBundles) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNextBundleAnalyzer = require('next-bundle-analyzer')({
format: ['json'],
reportDir: '../.github/analyze',
json: {
filter: {
pages: true
}
}
});
nextConfig = withNextBundleAnalyzer(nextConfig);
}

return nextConfig;
};
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@algolia/autocomplete-shared": "^1.5.6",
"@algolia/autocomplete-theme-classic": "^1.6.1",
"@algolia/client-search": "^4.13.0",
"@aws-amplify/amplify-cli-core": "^4.2.7",
"@aws-amplify/amplify-cli-core": "^4.2.10",
"@aws-amplify/ui-react": "^5.3.1",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.3.0",
Expand All @@ -28,6 +28,7 @@
"aws-amplify": "^5.0.5",
"classnames": "^2.3.2",
"copy-to-clipboard": "^3.2.1",
"cross-env": "^7.0.3",
"dotenv": "^16.0.0",
"emotion": "^10.0.23",
"eslint-config-next": "^13.2.4",
Expand Down Expand Up @@ -58,6 +59,7 @@
},
"devDependencies": {
"@next/mdx": "^13.5.4",
"@next/bundle-analyzer": "^13.5.3",
"@stencil/core": "^1.17.0",
"@stencil/eslint-plugin": "^0.2.1",
"@stencil/router": "^1.0.1",
Expand Down Expand Up @@ -85,9 +87,11 @@
"jest": "^26.6.3",
"jest-cli": "^26.6.3",
"prettier": "^3.0.3",
"next-bundle-analyzer": "^0.6.7",
"puppeteer": "^20.8.2",
"rollup-plugin-node-polyfills": "^0.2.1",
"sass": "^1.54.8",
"serve": "^14.2.1",
"tiny-glob": "0.2.9",
"ts-jest": "^26.0.3",
"ts-node": "^8.5.0",
Expand All @@ -96,6 +100,8 @@
},
"resolutions": {
"**/trim": "0.0.3",
"@babel/core": "^7.23.2",
"@babel/traverse": "^7.23.2",
"loader-utils": "2.0.4",
"minimatch": "3.1.2",
"json5": "2.2.2",
Expand Down Expand Up @@ -127,7 +133,11 @@
],
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
]
],
"moduleNameMapper": {
"\\.(css|less|scss)$": "<rootDir>/src/__mocks__/styleMock.js"
},
"transformIgnorePatterns": []
},
"scripts": {
"clean": "rm -rf node_modules yarn.lock",
Expand All @@ -140,6 +150,8 @@
"build:release": "yarn build && next-image-export-optimizer --exportFolderPath client/www/next-build",
"next-build": "next build",
"next-start": "next start",
"prepare": "husky install"
"amplify:submissionsLambda": "cd amplify/backend/function/submissionsLambda/src && yarn install && yarn build && yarn test",
"prepare": "husky install",
"analyze": "ANALYZE=true yarn next-build"
}
}
1 change: 1 addition & 0 deletions src/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
7 changes: 6 additions & 1 deletion src/components/Accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const Accordion: React.FC<AccordionProps> = ({
const [expandedHeight, setExpandedHeight] = useState(0);
const docsExpander = useRef<HTMLElement>(null);

let pathName = '';
if (typeof window !== 'undefined') {
pathName = window.location.pathname;
}

useEffect(() => {
const expander = docsExpander.current;

Expand Down Expand Up @@ -62,7 +67,7 @@ const Accordion: React.FC<AccordionProps> = ({

const anchor = createElement(
'a',
{ href: window.location.pathname + '#' + headingId },
{ href: pathName + '#' + headingId },
expanderTitle
);

Expand Down
Loading