Sample repo to demonstrate issue where component-level data fetching functions and their dependencies are included in client-side bundles as described in the JSS repo.
- Check out commit
9e94d3b2ac9a1e224ff6da007f10a81b45c48702
. - Run the app.
- Open http://localhost:3000/_next/static/chunks/pages/[[...path]].js.
- Observe that
page-level-static-props
is absent from the client-side bundle (β expected). - Open the Next.js Bundle Analyzer report for the server at
/analyze/nodejs.html
. Switch tostat
treemap sizes. - Observe that
server-data.json
is included in the server-side bundle (β expected). - Open the Next.js Bundle Analyzer report for the client at
/.next/analyze/client.html
. Switch tostat
treemap sizes. - Observe that
server-data.json
is excluded from the client-side bundle (β expected).
- Check out commit
8e63b89d793da12bf350b187297913a58581deb3
. - Run the app.
- Open http://localhost:3000/_next/static/chunks/pages/[[...path]].js.
- Observe that
component-level-static-props
is present in the client-side bundle (β unexpected). - Open the Next.js Bundle Analyzer report for the server at
/analyze/nodejs.html
. Switch tostat
treemap sizes. - Observe that
server-data.json
is included in the server-side bundle (β expected). - Open the Next.js Bundle Analyzer report for the client at
/.next/analyze/client.html
. Switch tostat
treemap sizes. - Observe that
server-data.json
is included in the client-side bundle (β unexpected).
- Check out commit
a46bd69f535abcef94572a12afdc677f3aeac1ac
. - Run the app.
- Open http://localhost:3000/_next/static/chunks/pages/[[...path]].js.
- Observe that
component-level-static-props
is absent from the client-side bundle (β nice). - Open the Next.js Bundle Analyzer report for the server at
/analyze/nodejs.html
. Switch tostat
treemap sizes. - Observe that
server-data.json
is included in the server-side bundle (β expected). - Open the Next.js Bundle Analyzer report for the client at
/.next/analyze/client.html
. Switch tostat
treemap sizes. - Observe that
server-data.json
is excluded from the client-side bundle (β nice).