Skip to content

feat: conditional build - #379

Merged
sakulstra merged 5 commits into
masterfrom
conditional-build
Mar 8, 2022
Merged

feat: conditional build#379
sakulstra merged 5 commits into
masterfrom
conditional-build

Conversation

@sakulstra

@sakulstra sakulstra commented Mar 8, 2022

Copy link
Copy Markdown
Collaborator

@github-actions

github-actions Bot commented Mar 8, 2022

Copy link
Copy Markdown

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.22 MB (🟢 -4.98 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 47.43 KB (🟡 +10 B) 1.27 MB
/faucet 19.6 KB (🟡 +38 B) 1.24 MB
/governance 74.03 KB (🟡 +494 B) 1.3 MB
/governance/proposal 112.21 KB (🟡 +457 B) 1.33 MB
/governance/proposal/[proposalId] 67.04 KB (🟡 +457 B) 1.29 MB
/markets 22.33 KB (🟡 +8 B) 1.24 MB
/reserve-overview 78.27 KB (🟡 +38 B) 1.3 MB
/staking 49.66 KB (🟡 +38 B) 1.27 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@github-actions

github-actions Bot commented Mar 8, 2022

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Mar 8, 2022

Copy link
Copy Markdown

@sakulstra
sakulstra merged commit d9ab49c into master Mar 8, 2022
@sakulstra
sakulstra deleted the conditional-build branch March 8, 2022 13:04
@github-actions

github-actions Bot commented Mar 8, 2022

Copy link
Copy Markdown

foodaka pushed a commit that referenced this pull request Mar 9, 2022
aleksejbigov pushed a commit to K613-Official/k613-Interface that referenced this pull request May 25, 2026
abjt14 added a commit that referenced this pull request Aug 4, 2026
The showcase was gated only by client-side NODE_ENV checks. Since next
build sets NODE_ENV=production, the route existed and was fetchable on
every deployed build — including Vercel previews, where it rendered blank
— while all ~29 showcase modules still shipped in the production bundle.
Unusable where it was wanted, shipped where it wasn't.

Gates it via pageExtensions instead, the same build-time mechanism already
used for the *.governance.tsx pages (PR #379, 'feat: conditional build').
Renaming the pages to *.dev.tsx means Next never sees them unless that
extension is registered: no route, no chunk, a real 404 rather than a blank
page. The now-redundant NODE_ENV guards are removed — they would have kept
the page blank on preview.

VERCEL_ENV is Vercel's documented system variable for per-environment
behaviour, so previews work with no dashboard setup. The
VERCEL_ENV !== 'production' veto is deliberate: without it the gate is
purely additive, and NEXT_PUBLIC_ENABLE_DEV_PAGES=true left scoped to all
environments would leak the showcase into production.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Staking - supporting fork

2 participants