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

Prevent nav context re-renders #4266

Merged
merged 1 commit into from
Feb 1, 2022
Merged

Prevent nav context re-renders #4266

merged 1 commit into from
Feb 1, 2022

Conversation

gaearon
Copy link
Member

@gaearon gaearon commented Feb 1, 2022

This is for #4256.

Similar issue to vercel/next.js#33861, mdx-js/mdx#1924.

Explanation in facebook/react#22692. (Works as intended.)

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@gaearon gaearon merged commit 58d6f3f into main Feb 1, 2022
@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Size Changes

📦 Next.js Bundle Analysis

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

One Hundred Eighty-five Pages Changed Size

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

Page Size (compressed) First Load
/ 217.58 KB (🟡 +10 B) 310.79 KB
/404 216.69 KB (🟡 +10 B) 309.9 KB
/blog 38.55 KB (🟡 +10 B) 131.76 KB
/blog/2013/06/02/jsfiddle-integration 227.95 KB (🟡 +10 B) 321.16 KB
/blog/2013/06/05/why-react 229.68 KB (🟡 +10 B) 322.88 KB
/blog/2013/06/12/community-roundup 229.38 KB (🟡 +10 B) 322.59 KB
/blog/2013/06/19/community-roundup-2 230.05 KB (🟡 +10 B) 323.26 KB
/blog/2013/06/21/react-v0-3-3 228.1 KB (🟡 +10 B) 321.31 KB
/blog/2013/06/27/community-roundup-3 230.41 KB (🟡 +10 B) 323.62 KB
/blog/2013/07/02/react-v0-4-autobind-by-default 228.72 KB (🟡 +10 B) 321.92 KB
/blog/2013/07/03/community-roundup-4 229.79 KB (🟡 +10 B) 322.99 KB
/blog/2013/07/11/react-v0-4-prop-validation-and-default-values 228.59 KB (🟡 +10 B) 321.8 KB
/blog/2013/07/17/react-v0-4-0 229.3 KB (🟡 +10 B) 322.5 KB
/blog/2013/07/23/community-roundup-5 230.18 KB (🟡 +10 B) 323.39 KB
/blog/2013/07/26/react-v0-4-1 228.06 KB (🟡 +10 B) 321.27 KB
/blog/2013/07/30/use-react-and-jsx-in-ruby-on-rails 228.67 KB (🟡 +10 B) 321.87 KB
/blog/2013/08/05/community-roundup-6 229.47 KB (🟡 +10 B) 322.68 KB
/blog/2013/08/19/use-react-and-jsx-in-python-applications 228.68 KB (🟡 +10 B) 321.88 KB
/blog/2013/08/26/community-roundup-7 229.64 KB (🟡 +10 B) 322.85 KB
/blog/2013/09/24/community-roundup-8 231.07 KB (🟡 +10 B) 324.28 KB
/blog/2013/10/03/community-roundup-9 230.01 KB (🟡 +10 B) 323.22 KB
/blog/2013/10/16/react-v0.5.0 229.69 KB (🟡 +10 B) 322.9 KB
/blog/2013/10/29/react-v0-5-1 228.05 KB (🟡 +10 B) 321.26 KB
/blog/2013/11/06/community-roundup-10 231.67 KB (🟡 +10 B) 324.88 KB
/blog/2013/11/18/community-roundup-11 230.75 KB (🟡 +10 B) 323.96 KB
/blog/2013/12/18/react-v0.5.2-v0.4.2 228.52 KB (🟡 +10 B) 321.73 KB
/blog/2013/12/19/react-v0.8.0 228.94 KB (🟡 +10 B) 322.15 KB
/blog/2013/12/23/community-roundup-12 230.4 KB (🟡 +10 B) 323.61 KB
/blog/2013/12/30/community-roundup-13 230.19 KB (🟡 +10 B) 323.39 KB
/blog/2014/01/02/react-chrome-developer-tools 228.44 KB (🟡 +10 B) 321.65 KB
/blog/2014/01/06/community-roundup-14 229.78 KB (🟡 +10 B) 322.99 KB
/blog/2014/02/05/community-roundup-15 231 KB (🟡 +10 B) 324.21 KB
/blog/2014/02/15/community-roundup-16 230.71 KB (🟡 +10 B) 323.92 KB
/blog/2014/02/16/react-v0.9-rc1 231.11 KB (🟡 +10 B) 324.32 KB
/blog/2014/02/20/react-v0.9 231.56 KB (🟡 +10 B) 324.77 KB
/blog/2014/02/24/community-roundup-17 230.42 KB (🟡 +10 B) 323.63 KB
/blog/2014/03/14/community-roundup-18 231.39 KB (🟡 +10 B) 324.6 KB
/blog/2014/03/19/react-v0.10-rc1 229.7 KB (🟡 +10 B) 322.9 KB
/blog/2014/03/21/react-v0.10 229.72 KB (🟡 +10 B) 322.93 KB
/blog/2014/03/28/the-road-to-1.0 229.83 KB (🟡 +10 B) 323.04 KB
/blog/2014/04/04/reactnet 228.47 KB (🟡 +10 B) 321.68 KB
/blog/2014/05/06/flux 228.6 KB (🟡 +10 B) 321.81 KB
/blog/2014/05/29/one-year-of-open-source-react 228.83 KB (🟡 +10 B) 322.03 KB
/blog/2014/06/27/community-roundup-19 230.37 KB (🟡 +10 B) 323.57 KB
/blog/2014/07/13/react-v0.11-rc1 230.75 KB (🟡 +10 B) 323.96 KB
/blog/2014/07/17/react-v0.11 232.01 KB (🟡 +10 B) 325.22 KB
/blog/2014/07/25/react-v0.11.1 228.96 KB (🟡 +10 B) 322.17 KB
/blog/2014/07/28/community-roundup-20 230.51 KB (🟡 +10 B) 323.72 KB
/blog/2014/07/30/flux-actions-and-the-dispatcher 230.14 KB (🟡 +10 B) 323.35 KB
/blog/2014/08/03/community-roundup-21 230.18 KB (🟡 +10 B) 323.39 KB
/blog/2014/09/03/introducing-the-jsx-specification 228.18 KB (🟡 +10 B) 321.39 KB
/blog/2014/09/12/community-round-up-22 230.66 KB (🟡 +10 B) 323.87 KB
/blog/2014/09/16/react-v0.11.2 228.96 KB (🟡 +10 B) 322.16 KB
/blog/2014/09/24/testing-flux-applications 232.14 KB (🟡 +10 B) 325.34 KB
/blog/2014/10/14/introducing-react-elements 231.09 KB (🟡 +10 B) 324.3 KB
/blog/2014/10/16/react-v0.12-rc1 231.05 KB (🟡 +10 B) 324.26 KB
/blog/2014/10/17/community-roundup-23 231.63 KB (🟡 +10 B) 324.84 KB
/blog/2014/10/27/react-js-conf 228.23 KB (🟡 +10 B) 321.44 KB
/blog/2014/10/28/react-v0.12 231 KB (🟡 +10 B) 324.2 KB
/blog/2014/11/24/react-js-conf-updates 228.62 KB (🟡 +10 B) 321.82 KB
/blog/2014/11/25/community-roundup-24 231.86 KB (🟡 +10 B) 325.06 KB
/blog/2014/12/18/react-v0.12.2 228.64 KB (🟡 +10 B) 321.85 KB
/blog/2014/12/19/react-js-conf-diversity-scholarship 229.04 KB (🟡 +10 B) 322.25 KB
/blog/2015/01/27/react-v0.13.0-beta-1 230.01 KB (🟡 +10 B) 323.21 KB
/blog/2015/02/18/react-conf-roundup-2015 231.99 KB (🟡 +10 B) 325.2 KB
/blog/2015/02/20/introducing-relay-and-graphql 231.14 KB (🟡 +10 B) 324.35 KB
/blog/2015/02/24/react-v0.13-rc1 230.04 KB (🟡 +10 B) 323.25 KB
/blog/2015/02/24/streamlining-react-elements 232.6 KB (🟡 +10 B) 325.8 KB
/blog/2015/03/03/react-v0.13-rc2 229.38 KB (🟡 +10 B) 322.59 KB
/blog/2015/03/04/community-roundup-25 230.34 KB (🟡 +10 B) 323.55 KB
/blog/2015/03/10/react-v0.13 230.66 KB (🟡 +10 B) 323.87 KB
/blog/2015/03/16/react-v0.13.1 228.48 KB (🟡 +10 B) 321.68 KB
/blog/2015/03/19/building-the-facebook-news-feed-with-relay 231.24 KB (🟡 +10 B) 324.44 KB
/blog/2015/03/26/introducing-react-native 228.37 KB (🟡 +10 B) 321.58 KB
/blog/2015/03/30/community-roundup-26 230.31 KB (🟡 +10 B) 323.51 KB
/blog/2015/04/17/react-native-v0.4 229.22 KB (🟡 +10 B) 322.43 KB
/blog/2015/04/18/react-v0.13.2 228.56 KB (🟡 +10 B) 321.76 KB
/blog/2015/05/01/graphql-introduction 233.05 KB (🟡 +10 B) 326.25 KB
/blog/2015/05/08/react-v0.13.3 228.45 KB (🟡 +10 B) 321.65 KB
/blog/2015/05/22/react-native-release-process 228.6 KB (🟡 +10 B) 321.8 KB
/blog/2015/06/12/deprecating-jstransform-and-react-tools 229.05 KB (🟡 +10 B) 322.25 KB
/blog/2015/07/03/react-v0.14-beta-1 230.56 KB (🟡 +10 B) 323.77 KB
/blog/2015/08/03/new-react-devtools-beta 229.16 KB (🟡 +10 B) 322.37 KB
/blog/2015/08/11/relay-technical-preview 229.22 KB (🟡 +10 B) 322.43 KB
/blog/2015/08/13/reacteurope-roundup 230.81 KB (🟡 +10 B) 324.02 KB
/blog/2015/09/02/new-react-developer-tools 228.58 KB (🟡 +10 B) 321.79 KB
/blog/2015/09/10/react-v0.14-rc1 234.21 KB (🟡 +10 B) 327.42 KB
/blog/2015/09/14/community-roundup-27 230.74 KB (🟡 +10 B) 323.94 KB
/blog/2015/10/01/react-render-and-top-level-api 229.71 KB (🟡 +10 B) 322.92 KB
/blog/2015/10/07/react-v0.14 234.69 KB (🟡 +10 B) 327.9 KB
/blog/2015/10/19/reactiflux-is-moving-to-discord 230.46 KB (🟡 +10 B) 323.67 KB
/blog/2015/10/28/react-v0.14.1 228.47 KB (🟡 +10 B) 321.68 KB
/blog/2015/11/02/react-v0.14.2 228.5 KB (🟡 +10 B) 321.71 KB
/blog/2015/11/18/react-v0.14.3 228.62 KB (🟡 +10 B) 321.83 KB
/blog/2015/12/04/react-js-conf-2016-diversity-scholarship 229.5 KB (🟡 +10 B) 322.7 KB
/blog/2015/12/16/ismounted-antipattern 229.1 KB (🟡 +10 B) 322.3 KB
/blog/2015/12/18/react-components-elements-and-instances 233.02 KB (🟡 +10 B) 326.23 KB
/blog/2015/12/29/react-v0.14.4 228.29 KB (🟡 +10 B) 321.5 KB
/blog/2016/01/08/A-implies-B-does-not-imply-B-implies-A 229.31 KB (🟡 +10 B) 322.52 KB
/blog/2016/01/12/discontinuing-ie8-support 228.12 KB (🟡 +10 B) 321.32 KB
/blog/2016/02/19/new-versioning-scheme 229.5 KB (🟡 +10 B) 322.7 KB
/blog/2016/03/07/react-v15-rc1 232.19 KB (🟡 +10 B) 325.4 KB
/blog/2016/03/16/react-v15-rc2 229.11 KB (🟡 +10 B) 322.32 KB
/blog/2016/03/29/react-v0.14.8 228.25 KB (🟡 +10 B) 321.45 KB
/blog/2016/04/07/react-v15 236.31 KB (🟡 +10 B) 329.52 KB
/blog/2016/04/08/react-v15.0.1 229 KB (🟡 +10 B) 322.21 KB
/blog/2016/07/11/introducing-reacts-error-code-system 228.72 KB (🟡 +10 B) 321.92 KB
/blog/2016/07/13/mixins-considered-harmful 236.87 KB (🟡 +10 B) 330.08 KB
/blog/2016/07/22/create-apps-with-no-configuration 232.2 KB (🟡 +10 B) 325.4 KB
/blog/2016/08/05/relay-state-of-the-state 232.24 KB (🟡 +10 B) 325.44 KB
/blog/2016/09/28/our-first-50000-stars 233.68 KB (🟡 +10 B) 326.89 KB
/blog/2016/11/16/react-v15.4.0 231.64 KB (🟡 +10 B) 324.84 KB
/blog/2017/04/07/react-v15.5.0 232.2 KB (🟡 +10 B) 325.41 KB
/blog/2017/05/18/whats-new-in-create-react-app 231.6 KB (🟡 +10 B) 324.8 KB
/blog/2017/06/13/react-v15.6.0 230.22 KB (🟡 +10 B) 323.43 KB
/blog/2017/07/26/error-handling-in-react-16 230.57 KB (🟡 +10 B) 323.78 KB
/blog/2017/09/08/dom-attributes-in-react-16 231 KB (🟡 +10 B) 324.21 KB
/blog/2017/09/25/react-v15.6.2 229.33 KB (🟡 +10 B) 322.54 KB
/blog/2017/09/26/react-v16.0 234.46 KB (🟡 +10 B) 327.67 KB
/blog/2017/11/28/react-v16.2.0-fragment-support 232.38 KB (🟡 +10 B) 325.58 KB
/blog/2017/12/07/introducing-the-react-rfc-process 228.92 KB (🟡 +10 B) 322.12 KB
/blog/2017/12/15/improving-the-repository-infrastructure 244.71 KB (🟡 +10 B) 337.91 KB
/blog/2018/03/01/sneak-peek-beyond-react-16 228.87 KB (🟡 +10 B) 322.08 KB
/blog/2018/03/27/update-on-async-rendering 234.11 KB (🟡 +10 B) 327.32 KB
/blog/2018/03/29/react-v-16-3 230.93 KB (🟡 +10 B) 324.14 KB
/blog/2018/05/23/react-v-16-4 231.07 KB (🟡 +10 B) 324.28 KB
/blog/2018/06/07/you-probably-dont-need-derived-state 234.73 KB (🟡 +10 B) 327.94 KB
/blog/2018/08/01/react-v-16-4-2 229.73 KB (🟡 +10 B) 322.93 KB
/blog/2018/09/10/introducing-the-react-profiler 231.33 KB (🟡 +10 B) 324.54 KB
/blog/2018/10/01/create-react-app-v2 231.81 KB (🟡 +10 B) 325.02 KB
/blog/2018/10/23/react-v-16-6 231.01 KB (🟡 +10 B) 324.22 KB
/blog/2018/11/13/react-conf-recap 228.72 KB (🟡 +10 B) 321.93 KB
/blog/2018/11/27/react-16-roadmap 234.92 KB (🟡 +10 B) 328.12 KB
/blog/2018/12/19/react-v-16-7 229.85 KB (🟡 +10 B) 323.05 KB
/blog/2019/02/06/react-v16.8.0 232.11 KB (🟡 +10 B) 325.32 KB
/blog/2019/02/23/is-react-translated-yet 231.68 KB (🟡 +10 B) 324.88 KB
/blog/2019/08/08/react-v16.9.0 234.61 KB (🟡 +10 B) 327.82 KB
/blog/2019/08/15/new-react-devtools 229.22 KB (🟡 +10 B) 322.42 KB
/blog/2019/10/22/react-release-channels 231.02 KB (🟡 +10 B) 324.23 KB
/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense 235.73 KB (🟡 +10 B) 328.94 KB
/blog/2020/02/26/react-v16.13.0 231.96 KB (🟡 +10 B) 325.16 KB
/blog/2020/08/10/react-v17-rc 238.23 KB (🟡 +10 B) 331.44 KB
/blog/all 54.67 KB (🟡 +10 B) 147.88 KB
/community 217.28 KB (🟡 +10 B) 310.48 KB
/community/acknowledgements 218.47 KB (🟡 +10 B) 311.68 KB
/community/meet-the-team 218.99 KB (🟡 +10 B) 312.2 KB
/learn 221.77 KB (🟡 +10 B) 314.98 KB
/learn/add-react-to-a-website 222.1 KB (🟡 +10 B) 315.31 KB
/learn/adding-interactivity 223.91 KB (🟡 +10 B) 317.12 KB
/learn/choosing-the-state-structure 229.65 KB (🟡 +10 B) 322.85 KB
/learn/conditional-rendering 221.88 KB (🟡 +10 B) 315.08 KB
/learn/describing-the-ui 221.1 KB (🟡 +10 B) 314.3 KB
/learn/editor-setup 218.37 KB (🟡 +10 B) 311.57 KB
/learn/escape-hatches 216.61 KB (🟡 +10 B) 309.81 KB
/learn/extracting-state-logic-into-a-reducer 227.25 KB (🟡 +10 B) 320.46 KB
/learn/importing-and-exporting-components 220.28 KB (🟡 +10 B) 313.48 KB
/learn/installation 217.94 KB (🟡 +10 B) 311.14 KB
/learn/javascript-in-jsx-with-curly-braces 220.35 KB (🟡 +10 B) 313.56 KB
/learn/keeping-components-pure 224.49 KB (🟡 +10 B) 317.69 KB
/learn/managing-state 223.21 KB (🟡 +10 B) 316.42 KB
/learn/manipulating-the-dom-with-refs 225.12 KB (🟡 +10 B) 318.33 KB
/learn/passing-data-deeply-with-context 224.63 KB (🟡 +10 B) 317.84 KB
/learn/passing-props-to-a-component 224.06 KB (🟡 +10 B) 317.26 KB
/learn/preserving-and-resetting-state 226.87 KB (🟡 +10 B) 320.08 KB
/learn/queueing-a-series-of-state-updates 221.85 KB (🟡 +10 B) 315.06 KB
/learn/react-developer-tools 217.8 KB (🟡 +10 B) 311.01 KB
/learn/reacting-to-input-with-state 226.33 KB (🟡 +10 B) 319.53 KB
/learn/referencing-values-with-refs 223.37 KB (🟡 +10 B) 316.57 KB
/learn/render-and-commit 220.34 KB (🟡 +10 B) 313.55 KB
/learn/rendering-lists 224.4 KB (🟡 +10 B) 317.61 KB
/learn/responding-to-events 223.4 KB (🟡 +10 B) 316.61 KB
/learn/scaling-up-with-reducer-and-context 221.43 KB (🟡 +10 B) 314.63 KB
/learn/sharing-state-between-components 222.13 KB (🟡 +10 B) 315.34 KB
/learn/start-a-new-react-project 218.78 KB (🟡 +10 B) 311.98 KB
/learn/state-a-components-memory 227.57 KB (🟡 +10 B) 320.78 KB
/learn/state-as-a-snapshot 221.39 KB (🟡 +10 B) 314.6 KB
/learn/thinking-in-react 223.21 KB (🟡 +10 B) 316.42 KB
/learn/updating-arrays-in-state 225.46 KB (🟡 +10 B) 318.66 KB
/learn/updating-objects-in-state 225.18 KB (🟡 +10 B) 318.38 KB
/learn/writing-markup-with-jsx 220.28 KB (🟡 +10 B) 313.48 KB
/learn/your-first-component 221.18 KB (🟡 +10 B) 314.38 KB
/reference 217.23 KB (🟡 +10 B) 310.44 KB
/reference/reactdom 217.38 KB (🟡 +10 B) 310.58 KB
/reference/render 218.72 KB (🟡 +10 B) 311.93 KB
/reference/usestate 221.77 KB (🟡 +10 B) 314.98 KB
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 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@rickhanlonii rickhanlonii deleted the context-fix branch April 29, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants