Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
166efb7
chore: update react and related dependencies to latest versions
TusharThakur04 Mar 6, 2026
bd2f357
add eslint rule to suppress mdx lint error
TusharThakur04 Mar 6, 2026
cb29aed
remove deprecation rule for mdx and change doc to follow latest react…
TusharThakur04 Mar 6, 2026
935eaf8
remove manual context extraction
TusharThakur04 Mar 6, 2026
732e066
fix: resolve SSR hydration mismatch between server.jsx and index.jsx
TusharThakur04 Mar 6, 2026
2f161ff
fix all hydration errors
TusharThakur04 Mar 6, 2026
b302e53
migrate tests from react-test-renderer to @testing-library/react
TusharThakur04 Mar 6, 2026
3ada0a6
resolve React 19 SSR hydration mismatch in Page content
TusharThakur04 Mar 7, 2026
ce35aea
resolve React 19 SSR hydration mismatch for dynamic page content
TusharThakur04 Mar 7, 2026
a98823f
fix: add null check for _container in SidebarMobile click handler
TusharThakur04 Mar 7, 2026
22ddf07
fix: wait for page content before asserting scrollTo in pr_4435 test
TusharThakur04 Mar 7, 2026
7e0b0cf
fix: wait for md-content to load before asserting scrollTo in pr_4435…
TusharThakur04 Mar 7, 2026
1fb4ebb
fix: reslove routing b/w content pages
TusharThakur04 Mar 7, 2026
1a7be70
chore: remove react dependencies from dependabot ignore list
TusharThakur04 Mar 7, 2026
f8077c6
fix: resolve direct setState in useEffect
TusharThakur04 Mar 7, 2026
1f1732d
fix scroll assertion
TusharThakur04 Mar 8, 2026
3ecdc24
resolve code-block cypress test
TusharThakur04 Mar 8, 2026
38730a0
fix delay in content loading
TusharThakur04 Mar 8, 2026
9bc4f19
fix eslint suppression and imports
TusharThakur04 Mar 8, 2026
ffb204f
restore OfflineBanner test
TusharThakur04 Mar 8, 2026
1b7fead
remove suppressHydrationWarning
TusharThakur04 Mar 8, 2026
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
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ updates:
- dependencies
versioning-strategy: widen
ignore:
- dependency-name: "react"
- dependency-name: "react-dom"
- dependency-name: "react-router-dom"
- dependency-name: "@docsearch/react"
- dependency-name: "tailwindcss"
groups:
dependencies:
Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/code-block-with-copy.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ describe("CodeBlockWithCopy", () => {
it("copies non-diff code blocks without altering content", () => {
visitWithClipboardSpy("/concepts/");

// Wait for Suspense content to load before querying code blocks
cy.get("button.copy-button").should("exist");

// Select the first webpack.config.js example and its copy wrapper.
getFirstWebpackConfigBlock("standardCodeBlock");

Expand All @@ -73,6 +76,7 @@ describe("CodeBlockWithCopy", () => {
.find("code")
.invoke("text")
.as("expectedCopiedText");
cy.get("@standardCodeBlock").find("button.copy-button").should("exist");
cy.get("@standardCodeBlock").find("button.copy-button").click();

// Assert copied output is unchanged for regular code blocks.
Expand Down
12 changes: 7 additions & 5 deletions cypress/e2e/pr_4435.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ describe("Open page in new tab", { scrollBehavior: false }, () => {
cy.stub(win, "scrollTo");
},
});
// wait for page content to load before asserting scroll
cy.get('.sidebar-item__title[href="/concepts/plugins/"]').should("exist");
// there's one call in Page.jsx when componentDidMount
cy.window().then((win) => {
cy.window().should((win) => {
expect(win.scrollTo).to.be.calledOnce;
});

const selector = '.sidebar-item__title[href="/concepts/plugins/"]';

// we click the menu
cy.get(selector).click();
cy.window().then((win) => {
cy.window().should((win) => {
// we don't know whether user has scrolled the page or not although no pathname changed
expect(win.scrollTo).to.be.calledTwice;
});
Expand All @@ -28,7 +30,7 @@ describe("Open page in new tab", { scrollBehavior: false }, () => {
metaKey: true,
});
// no scrollTo should be called
cy.window().then((win) => {
cy.window().should((win) => {
expect(win.scrollTo).to.be.calledTwice;
});
} else if (Cypress.platform === "win32" || Cypress.platform === "linux") {
Expand All @@ -37,14 +39,14 @@ describe("Open page in new tab", { scrollBehavior: false }, () => {
ctrlKey: true,
});
// no scrollTo should be called
cy.window().then((win) => {
cy.window().should((win) => {
expect(win.scrollTo).to.be.calledTwice;
});
}

// we click the menu again, scroll to top again
cy.get(selector).click();
cy.window().then((win) => {
cy.window().should((win) => {
expect(win.scrollTo).to.be.calledThrice;
});
});
Expand Down
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default defineConfig([
".github/**/*.md",
"**/README.md",
"src/mdx-components.mjs",
"**/setupTests.js",
]),
{
extends: [configs.recommended],
Expand Down
1 change: 1 addition & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default {
verbose: true,
testEnvironment: "node",
setupFiles: ["./src/setupTests.js"],
transform: {
"^.+\\.jsx?$": "babel-jest",
},
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,33 @@
"eval": "^0.1.5"
},
"dependencies": {
"@docsearch/react": "^3.9.0",
"@docsearch/react": "^4.6.0",
"@react-spring/web": "^10.0.3",
"path-browserify": "^1.0.1",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet-async": "^2.0.5",
"react-router-dom": "^6.28.0",
"react-tiny-popover": "5",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-helmet-async": "^3.0.0",
"react-router": "^7.13.1",
"react-router-dom": "^7.13.1",
"react-tiny-popover": "^8.1.6",
"react-use": "^17.6.0",
"react-visibility-sensor": "^5.0.2",
"webpack-pwa-manifest": "^4.3.0",
"workbox-window": "^7.4.0"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.29.0",
"@babel/preset-react": "^7.27.6",
"@babel/preset-react": "^7.28.5",
"@mdx-js/loader": "^3.1.1",
"@mdx-js/react": "^3.1.1",
"@octokit/auth-action": "^6.0.2",
"@octokit/rest": "^22.0.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
"@svgr/webpack": "^8.1.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.2",
"autoprefixer": "^10.4.24",
"babel-loader": "^10.0.0",
"copy-webpack-plugin": "^13.0.1",
Expand Down Expand Up @@ -134,7 +136,6 @@
"postcss-loader": "^8.2.0",
"prettier": "^3.8.1",
"react-refresh": "^0.18.0",
"react-test-renderer": "^17.0.2",
"redirect-webpack-plugin": "^1.0.0",
"remark": "^15.0.1",
"remark-autolink-headings": "7.0.1",
Expand Down
106 changes: 0 additions & 106 deletions src/AnalyticsRouter.jsx

This file was deleted.

10 changes: 7 additions & 3 deletions src/components/Badge/Badge.test.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/**
* @jest-environment jsdom
*/
// eslint-disable-next-line import/no-extraneous-dependencies
import { describe, expect, it } from "@jest/globals";
import renderer from "react-test-renderer";

import { render } from "@testing-library/react";
import Badge from "./Badge.jsx";

describe("Badge", () => {
it("renders correctly with text prop", () => {
const tree = renderer.create(<Badge text="webpack" />).toJSON();
expect(tree).toMatchSnapshot();
const { container } = render(<Badge text="webpack" />);
expect(container.firstChild).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion src/components/Badge/__snapshots__/Badge.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`Badge renders correctly with text prop 1`] = `
<span
className="badge"
class="badge"
>
webpack
</span>
Expand Down
34 changes: 17 additions & 17 deletions src/components/Container/Container.test.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/**
* @jest-environment jsdom
*/
// eslint-disable-next-line import/no-extraneous-dependencies
import { describe, expect, it } from "@jest/globals";
import renderer from "react-test-renderer";

import { render } from "@testing-library/react";
import Container from "./Container.jsx";

describe("Container", () => {
it("renders correctly with children and className", () => {
const tree = renderer
.create(
<Container className="test-class">
<p>Child content</p>
</Container>,
)
.toJSON();
expect(tree).toMatchSnapshot();
const { container } = render(
<Container className="test-class">
<p>Child content</p>
</Container>,
);
expect(container.firstChild).toMatchSnapshot();
});

it("renders correctly without className", () => {
const tree = renderer
.create(
<Container>
<span>Simple child</span>
</Container>,
)
.toJSON();
expect(tree).toMatchSnapshot();
const { container } = render(
<Container>
<span>Simple child</span>
</Container>,
);
expect(container.firstChild).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`Container renders correctly with children and className 1`] = `
<div
className="container test-class"
class="container test-class"
>
<p>
Child content
Expand All @@ -12,7 +12,7 @@ exports[`Container renders correctly with children and className 1`] = `

exports[`Container renders correctly without className 1`] = `
<div
className="container "
class="container "
>
<span>
Simple child
Expand Down
Loading
Loading