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

Add git hook to generate headings ids #4043

Merged
merged 3 commits into from
Nov 10, 2021
Merged

Conversation

lex111
Copy link
Member

@lex111 lex111 commented Nov 5, 2021

Let's automate the generation of custom headings ids on per commit so we don't have to do it manually.

@lex111
Copy link
Member Author

lex111 commented Nov 5, 2021

Deployment of the beta site fails apparently because Vercel does not exposed CI env var, its value must be true for husky not to run.

@gaearon
Copy link
Member

gaearon commented Nov 5, 2021

Can you remind me why we need this? I'm forgetting why this system exists.

@lex111
Copy link
Member Author

lex111 commented Nov 5, 2021

In short: having stable headings ids help for translators, check out this issue for more details -> #1608

@gaearon
Copy link
Member

gaearon commented Nov 5, 2021

Oh ok.

  1. translating one heading would mean having to search in the entire docs and change multiple files simultaneously

This makes sense that it's annoying.

Can you fix CI pls?

@lex111
Copy link
Member Author

lex111 commented Nov 5, 2021

Without your help, I can't fix this. Need to set CI env var to true in the Vercel deployment settings for the beta site. In all likelihood, this env is not set now, otherwise husky would not have installed during the build step since already is-ci check is used.

https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables

@gaearon
Copy link
Member

gaearon commented Nov 10, 2021

Can you please rebase?

@lex111
Copy link
Member Author

lex111 commented Nov 10, 2021

Sure, just updated the PR branch. Have you added CI env var to Vercel deployment settings?

@gaearon
Copy link
Member

gaearon commented Nov 10, 2021

Hmm. Vercel project has this on:

Screenshot 2021-11-10 at 17 57 27

which supposedly includes CI:

https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables

Why does this not work?

@lex111
Copy link
Member Author

lex111 commented Nov 10, 2021

Sorry, that was my mistake in new npm script, just fixed it, and everything should be ok now.

@gaearon gaearon merged commit 0b7fd7b into main Nov 10, 2021
@gaearon
Copy link
Member

gaearon commented Nov 10, 2021

Awesome. Thanks.

@github-actions
Copy link

Size Changes

📦 Next.js Bundle Analysis

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

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 91.18 KB (🟡 +12 B)
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!

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
/ 203.69 KB (🟡 +555 B) 294.88 KB
/404 202.79 KB (🟡 +558 B) 293.98 KB
/blog 37.33 KB (🟢 -586 B) 128.52 KB
/blog/2013/06/02/jsfiddle-integration 213.82 KB (-21 B) 305 KB
/blog/2013/06/05/why-react 215.55 KB (-21 B) 306.74 KB
/blog/2013/06/12/community-roundup 215.25 KB (-21 B) 306.44 KB
/blog/2013/06/19/community-roundup-2 215.92 KB (-21 B) 307.11 KB
/blog/2013/06/21/react-v0-3-3 213.97 KB (-21 B) 305.15 KB
/blog/2013/06/27/community-roundup-3 216.28 KB (🟢 -24 B) 307.47 KB
/blog/2013/07/02/react-v0-4-autobind-by-default 214.59 KB (-18 B) 305.77 KB
/blog/2013/07/03/community-roundup-4 215.66 KB (-21 B) 306.84 KB
/blog/2013/07/11/react-v0-4-prop-validation-and-default-values 214.46 KB (🟢 -22 B) 305.64 KB
/blog/2013/07/17/react-v0-4-0 215.17 KB (-20 B) 306.35 KB
/blog/2013/07/23/community-roundup-5 216.05 KB (-19 B) 307.24 KB
/blog/2013/07/26/react-v0-4-1 213.93 KB (-21 B) 305.12 KB
/blog/2013/07/30/use-react-and-jsx-in-ruby-on-rails 214.54 KB (-21 B) 305.72 KB
/blog/2013/08/05/community-roundup-6 215.35 KB (-20 B) 306.53 KB
/blog/2013/08/19/use-react-and-jsx-in-python-applications 214.55 KB (-21 B) 305.73 KB
/blog/2013/08/26/community-roundup-7 215.51 KB (-21 B) 306.7 KB
/blog/2013/09/24/community-roundup-8 216.95 KB (-21 B) 308.13 KB
/blog/2013/10/03/community-roundup-9 215.88 KB (-21 B) 307.07 KB
/blog/2013/10/16/react-v0.5.0 215.56 KB (-21 B) 306.75 KB
/blog/2013/10/29/react-v0-5-1 213.92 KB (🟢 -22 B) 305.11 KB
/blog/2013/11/06/community-roundup-10 217.54 KB (-21 B) 308.73 KB
/blog/2013/11/18/community-roundup-11 216.62 KB (-21 B) 307.8 KB
/blog/2013/12/18/react-v0.5.2-v0.4.2 214.39 KB (-21 B) 305.58 KB
/blog/2013/12/19/react-v0.8.0 214.81 KB (-21 B) 306 KB
/blog/2013/12/23/community-roundup-12 216.28 KB (-20 B) 307.46 KB
/blog/2013/12/30/community-roundup-13 216.06 KB (-22 B) 307.24 KB
/blog/2014/01/02/react-chrome-developer-tools 214.31 KB (-21 B) 305.5 KB
/blog/2014/01/06/community-roundup-14 215.65 KB (-21 B) 306.84 KB
/blog/2014/02/05/community-roundup-15 216.87 KB (-21 B) 308.05 KB
/blog/2014/02/15/community-roundup-16 216.58 KB (-21 B) 307.77 KB
/blog/2014/02/16/react-v0.9-rc1 216.99 KB (-19 B) 308.17 KB
/blog/2014/02/20/react-v0.9 217.43 KB (🟢 -23 B) 308.62 KB
/blog/2014/02/24/community-roundup-17 216.3 KB (-19 B) 307.48 KB
/blog/2014/03/14/community-roundup-18 217.26 KB (-21 B) 308.44 KB
/blog/2014/03/19/react-v0.10-rc1 215.57 KB (-21 B) 306.75 KB
/blog/2014/03/21/react-v0.10 215.59 KB (-21 B) 306.78 KB
/blog/2014/03/28/the-road-to-1.0 215.7 KB (-21 B) 306.89 KB
/blog/2014/04/04/reactnet 214.35 KB (-21 B) 305.53 KB
/blog/2014/05/06/flux 214.47 KB (-21 B) 305.65 KB
/blog/2014/05/29/one-year-of-open-source-react 214.69 KB (-21 B) 305.88 KB
/blog/2014/06/27/community-roundup-19 216.25 KB (-19 B) 307.43 KB
/blog/2014/07/13/react-v0.11-rc1 216.62 KB (-21 B) 307.81 KB
/blog/2014/07/17/react-v0.11 217.88 KB (-21 B) 309.07 KB
/blog/2014/07/25/react-v0.11.1 214.83 KB (-21 B) 306.02 KB
/blog/2014/07/28/community-roundup-20 216.38 KB (-20 B) 307.57 KB
/blog/2014/07/30/flux-actions-and-the-dispatcher 216.02 KB (-21 B) 307.2 KB
/blog/2014/08/03/community-roundup-21 216.05 KB (-21 B) 307.24 KB
/blog/2014/09/03/introducing-the-jsx-specification 214.05 KB (-21 B) 305.24 KB
/blog/2014/09/12/community-round-up-22 216.53 KB (-20 B) 307.71 KB
/blog/2014/09/16/react-v0.11.2 214.83 KB (-21 B) 306.01 KB
/blog/2014/09/24/testing-flux-applications 218.01 KB (-21 B) 309.19 KB
/blog/2014/10/14/introducing-react-elements 216.97 KB (-18 B) 308.15 KB
/blog/2014/10/16/react-v0.12-rc1 216.93 KB (-21 B) 308.11 KB
/blog/2014/10/17/community-roundup-23 217.5 KB (-21 B) 308.68 KB
/blog/2014/10/27/react-js-conf 214.1 KB (🟢 -22 B) 305.28 KB
/blog/2014/10/28/react-v0.12 216.86 KB (🟢 -23 B) 308.05 KB
/blog/2014/11/24/react-js-conf-updates 214.49 KB (-20 B) 305.67 KB
/blog/2014/11/25/community-roundup-24 217.73 KB (-21 B) 308.91 KB
/blog/2014/12/18/react-v0.12.2 214.51 KB (-21 B) 305.7 KB
/blog/2014/12/19/react-js-conf-diversity-scholarship 214.91 KB (-21 B) 306.09 KB
/blog/2015/01/27/react-v0.13.0-beta-1 215.88 KB (-21 B) 307.06 KB
/blog/2015/02/18/react-conf-roundup-2015 217.86 KB (-21 B) 309.05 KB
/blog/2015/02/20/introducing-relay-and-graphql 217.01 KB (-21 B) 308.2 KB
/blog/2015/02/24/react-v0.13-rc1 215.92 KB (-21 B) 307.1 KB
/blog/2015/02/24/streamlining-react-elements 218.47 KB (-20 B) 309.66 KB
/blog/2015/03/03/react-v0.13-rc2 215.25 KB (-21 B) 306.44 KB
/blog/2015/03/04/community-roundup-25 216.22 KB (-22 B) 307.4 KB
/blog/2015/03/10/react-v0.13 216.53 KB (-21 B) 307.72 KB
/blog/2015/03/16/react-v0.13.1 214.35 KB (-20 B) 305.53 KB
/blog/2015/03/19/building-the-facebook-news-feed-with-relay 217.11 KB (-21 B) 308.29 KB
/blog/2015/03/26/introducing-react-native 214.25 KB (-21 B) 305.43 KB
/blog/2015/03/30/community-roundup-26 216.18 KB (-21 B) 307.37 KB
/blog/2015/04/17/react-native-v0.4 215.09 KB (-21 B) 306.28 KB
/blog/2015/04/18/react-v0.13.2 214.43 KB (-21 B) 305.61 KB
/blog/2015/05/01/graphql-introduction 218.92 KB (-21 B) 310.1 KB
/blog/2015/05/08/react-v0.13.3 214.31 KB (-21 B) 305.5 KB
/blog/2015/05/22/react-native-release-process 214.47 KB (-21 B) 305.65 KB
/blog/2015/06/12/deprecating-jstransform-and-react-tools 214.92 KB (-20 B) 306.11 KB
/blog/2015/07/03/react-v0.14-beta-1 216.43 KB (-22 B) 307.62 KB
/blog/2015/08/03/new-react-devtools-beta 215.03 KB (-21 B) 306.22 KB
/blog/2015/08/11/relay-technical-preview 215.09 KB (-21 B) 306.28 KB
/blog/2015/08/13/reacteurope-roundup 216.68 KB (-21 B) 307.87 KB
/blog/2015/09/02/new-react-developer-tools 214.45 KB (-20 B) 305.63 KB
/blog/2015/09/10/react-v0.14-rc1 220.14 KB (-20 B) 311.32 KB
/blog/2015/09/14/community-roundup-27 216.61 KB (-22 B) 307.79 KB
/blog/2015/10/01/react-render-and-top-level-api 215.58 KB (-21 B) 306.76 KB
/blog/2015/10/07/react-v0.14 220.62 KB (-21 B) 311.81 KB
/blog/2015/10/19/reactiflux-is-moving-to-discord 216.33 KB (-20 B) 307.51 KB
/blog/2015/10/28/react-v0.14.1 214.34 KB (🟢 -22 B) 305.52 KB
/blog/2015/11/02/react-v0.14.2 214.37 KB (-20 B) 305.55 KB
/blog/2015/11/18/react-v0.14.3 214.49 KB (-21 B) 305.68 KB
/blog/2015/12/04/react-js-conf-2016-diversity-scholarship 215.37 KB (-18 B) 306.55 KB
/blog/2015/12/16/ismounted-antipattern 214.97 KB (-20 B) 306.15 KB
/blog/2015/12/18/react-components-elements-and-instances 218.89 KB (-22 B) 310.07 KB
/blog/2015/12/29/react-v0.14.4 214.16 KB (🟢 -22 B) 305.34 KB
/blog/2016/01/08/A-implies-B-does-not-imply-B-implies-A 215.18 KB (-22 B) 306.36 KB
/blog/2016/01/12/discontinuing-ie8-support 213.99 KB (🟢 -22 B) 305.17 KB
/blog/2016/02/19/new-versioning-scheme 215.37 KB (-21 B) 306.55 KB
/blog/2016/03/07/react-v15-rc1 218.12 KB (-21 B) 309.31 KB
/blog/2016/03/16/react-v15-rc2 214.98 KB (-20 B) 306.17 KB
/blog/2016/03/29/react-v0.14.8 214.12 KB (🟢 -22 B) 305.3 KB
/blog/2016/04/07/react-v15 222.32 KB (-21 B) 313.5 KB
/blog/2016/04/08/react-v15.0.1 214.87 KB (-21 B) 306.05 KB
/blog/2016/07/11/introducing-reacts-error-code-system 214.59 KB (-21 B) 305.77 KB
/blog/2016/07/13/mixins-considered-harmful 222.74 KB (-22 B) 313.93 KB
/blog/2016/07/22/create-apps-with-no-configuration 218.07 KB (-22 B) 309.26 KB
/blog/2016/08/05/relay-state-of-the-state 218.11 KB (-21 B) 309.29 KB
/blog/2016/09/28/our-first-50000-stars 219.56 KB (-21 B) 310.74 KB
/blog/2016/11/16/react-v15.4.0 217.51 KB (-19 B) 308.7 KB
/blog/2017/04/07/react-v15.5.0 218.07 KB (-21 B) 309.26 KB
/blog/2017/05/18/whats-new-in-create-react-app 217.48 KB (-21 B) 308.66 KB
/blog/2017/06/13/react-v15.6.0 216.09 KB (-21 B) 307.27 KB
/blog/2017/07/26/error-handling-in-react-16 216.44 KB (-20 B) 307.62 KB
/blog/2017/09/08/dom-attributes-in-react-16 216.88 KB (-20 B) 308.06 KB
/blog/2017/09/25/react-v15.6.2 215.21 KB (-21 B) 306.39 KB
/blog/2017/09/26/react-v16.0 220.34 KB (-21 B) 311.52 KB
/blog/2017/11/28/react-v16.2.0-fragment-support 218.25 KB (-21 B) 309.44 KB
/blog/2017/12/07/introducing-the-react-rfc-process 214.79 KB (-21 B) 305.97 KB
/blog/2017/12/15/improving-the-repository-infrastructure 230.58 KB (-22 B) 321.77 KB
/blog/2018/03/01/sneak-peek-beyond-react-16 214.74 KB (-21 B) 305.93 KB
/blog/2018/03/27/update-on-async-rendering 219.99 KB (-21 B) 311.17 KB
/blog/2018/03/29/react-v-16-3 216.8 KB (-21 B) 307.99 KB
/blog/2018/05/23/react-v-16-4 216.95 KB (-20 B) 308.13 KB
/blog/2018/06/07/you-probably-dont-need-derived-state 220.61 KB (-21 B) 311.79 KB
/blog/2018/08/01/react-v-16-4-2 215.6 KB (-21 B) 306.78 KB
/blog/2018/09/10/introducing-the-react-profiler 217.21 KB (-21 B) 308.4 KB
/blog/2018/10/01/create-react-app-v2 217.68 KB (-21 B) 308.86 KB
/blog/2018/10/23/react-v-16-6 216.88 KB (-21 B) 308.06 KB
/blog/2018/11/13/react-conf-recap 214.59 KB (🟢 -22 B) 305.78 KB
/blog/2018/11/27/react-16-roadmap 220.79 KB (-22 B) 311.98 KB
/blog/2018/12/19/react-v-16-7 215.72 KB (-21 B) 306.9 KB
/blog/2019/02/06/react-v16.8.0 217.98 KB (-21 B) 309.17 KB
/blog/2019/02/23/is-react-translated-yet 217.55 KB (-20 B) 308.74 KB
/blog/2019/08/08/react-v16.9.0 220.49 KB (-21 B) 311.67 KB
/blog/2019/08/15/new-react-devtools 215.09 KB (-21 B) 306.27 KB
/blog/2019/10/22/react-release-channels 216.9 KB (-20 B) 308.08 KB
/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense 221.6 KB (-22 B) 312.78 KB
/blog/2020/02/26/react-v16.13.0 217.83 KB (-21 B) 309.01 KB
/blog/2020/08/10/react-v17-rc 224.11 KB (-21 B) 315.29 KB
/blog/all 53.44 KB (🟢 -589 B) 144.62 KB
/community 203.39 KB (🟡 +559 B) 294.57 KB
/community/acknowledgements 204.58 KB (🟡 +559 B) 295.76 KB
/community/meet-the-team 205.12 KB (🟡 +570 B) 296.3 KB
/learn 212.09 KB (🟡 +563 B) 303.27 KB
/learn/add-react-to-a-website 208.22 KB (🟡 +569 B) 299.4 KB
/learn/adding-interactivity 210.01 KB (🟡 +564 B) 301.2 KB
/learn/choosing-the-state-structure 215.76 KB (🟡 +563 B) 306.94 KB
/learn/conditional-rendering 207.99 KB (🟡 +569 B) 299.17 KB
/learn/describing-the-ui 207.2 KB (🟡 +563 B) 298.38 KB
/learn/editor-setup 204.48 KB (🟡 +565 B) 295.66 KB
/learn/escape-hatches 202.71 KB (🟡 +564 B) 293.9 KB
/learn/extracting-state-logic-into-a-reducer 213.36 KB (🟡 +568 B) 304.54 KB
/learn/importing-and-exporting-components 206.38 KB (🟡 +560 B) 297.57 KB
/learn/installation 204.04 KB (🟡 +564 B) 295.22 KB
/learn/javascript-in-jsx-with-curly-braces 206.46 KB (🟡 +566 B) 297.65 KB
/learn/keeping-components-pure 210.62 KB (🟡 +583 B) 301.8 KB
/learn/managing-state 209.31 KB (🟡 +559 B) 300.49 KB
/learn/manipulating-the-dom-with-refs 211.23 KB (🟡 +563 B) 302.41 KB
/learn/passing-data-deeply-with-context 210.74 KB (🟡 +564 B) 301.92 KB
/learn/passing-props-to-a-component 210.17 KB (🟡 +567 B) 301.35 KB
/learn/preserving-and-resetting-state 212.98 KB (🟡 +565 B) 304.16 KB
/learn/queueing-a-series-of-state-updates 207.95 KB (🟡 +559 B) 299.14 KB
/learn/react-developer-tools 203.92 KB (🟡 +564 B) 295.1 KB
/learn/reacting-to-input-with-state 212.44 KB (🟡 +574 B) 303.62 KB
/learn/referencing-values-with-refs 209.48 KB (🟡 +565 B) 300.66 KB
/learn/render-and-commit 206.45 KB (🟡 +563 B) 297.63 KB
/learn/rendering-lists 210.52 KB (🟡 +565 B) 301.7 KB
/learn/responding-to-events 209.51 KB (🟡 +563 B) 300.7 KB
/learn/scaling-up-with-reducer-and-context 207.54 KB (🟡 +564 B) 298.72 KB
/learn/sharing-state-between-components 208.24 KB (🟡 +561 B) 299.42 KB
/learn/start-a-new-react-project 204.89 KB (🟡 +569 B) 296.07 KB
/learn/state-a-components-memory 213.69 KB (🟡 +565 B) 304.87 KB
/learn/state-as-a-snapshot 207.5 KB (🟡 +565 B) 298.69 KB
/learn/thinking-in-react 209.39 KB (🟡 +562 B) 300.57 KB
/learn/updating-arrays-in-state 211.58 KB (🟡 +563 B) 302.76 KB
/learn/updating-objects-in-state 211.29 KB (🟡 +567 B) 302.48 KB
/learn/writing-markup-with-jsx 206.39 KB (🟡 +565 B) 297.57 KB
/learn/your-first-component 207.29 KB (🟡 +565 B) 298.47 KB
/reference 203.35 KB (🟡 +557 B) 294.53 KB
/reference/reactdom 203.49 KB (🟡 +558 B) 294.67 KB
/reference/render 204.83 KB (🟡 +559 B) 296.02 KB
/reference/usestate 211.31 KB (🟡 +559 B) 302.5 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.

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