Skip to content

[Beta] Change highlight styles#4348

Merged
gaearon merged 1 commit intomainfrom
nonums
Feb 17, 2022
Merged

[Beta] Change highlight styles#4348
gaearon merged 1 commit intomainfrom
nonums

Conversation

@gaearon
Copy link
Copy Markdown
Member

@gaearon gaearon commented Feb 17, 2022

Preview


In #4328 we have restructured 1-2-3 sections into highlight in the inline text. However, the 1-2-3 labels no longer reflect any semantic ordering that we want to convey.

Screenshot 2022-02-17 at 02 31 30

This becomes more obvious if we try to use it with even slightly less structured examples:

Screenshot 2022-02-17 at 02 32 22

In code, useRef([3] 0) looks strange and distracting. There was anecdotal feedback from quite a few people that labels interfere with the flow of text.

While we could minimize their usage, it feels like maybe there's an opportunity to refine this.


This PR changes it to boxes like this:

Screenshot 2022-02-17 at 02 35 15

Screenshot 2022-02-17 at 02 38 18

It is not ideal that they appear a bit like links, but I couldn't find a clearer pattern that feels as legible without sacrificing the feature itself. Maybe if somebody has a clever idea, we can try that. But this feels like a step forward to me. It's possible we could actually add some kind of click/tap action if we wanted to.

One concern with dropping numbers may be that this decreases legibility for colorblind users. I'm not sure how helpful the numbers were in the last iteration. I ran a few tests with a simulator, and colors alone appeared distinguishable enough in all cases except Tritanomaly, where the green and blue we use appeared similar. This is inessential information so I don't think it's blocking but it would be nice if we could swap out the green color for something that isn't ambiguous with blue. I've tried a few other options but they were worse for people with more common forms.

Potential follow-ups could be

@github-actions
Copy link
Copy Markdown

Size Changes

Details

📦 Next.js Bundle Analysis

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

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 92.92 KB (🟢 -128 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-three Pages Changed Size

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

Page Size (compressed) First Load
/ 60.68 KB (🟢 -49 B) 153.6 KB
/404 59.79 KB (🟢 -49 B) 152.71 KB
/apis 60.34 KB (🟢 -49 B) 153.26 KB
/apis/reactdom 60.49 KB (🟢 -49 B) 153.41 KB
/apis/render 62.55 KB (🟢 -49 B) 155.47 KB
/apis/usestate 71.5 KB (🟢 -49 B) 164.42 KB
/blog/2013/06/02/jsfiddle-integration 71.06 KB (🟢 -49 B) 163.98 KB
/blog/2013/06/05/why-react 72.78 KB (🟢 -49 B) 165.7 KB
/blog/2013/06/12/community-roundup 72.49 KB (🟢 -49 B) 165.41 KB
/blog/2013/06/19/community-roundup-2 73.16 KB (🟢 -49 B) 166.08 KB
/blog/2013/06/21/react-v0-3-3 71.21 KB (🟢 -49 B) 164.13 KB
/blog/2013/06/27/community-roundup-3 73.52 KB (🟢 -49 B) 166.44 KB
/blog/2013/07/02/react-v0-4-autobind-by-default 71.82 KB (🟢 -49 B) 164.74 KB
/blog/2013/07/03/community-roundup-4 72.89 KB (🟢 -49 B) 165.81 KB
/blog/2013/07/11/react-v0-4-prop-validation-and-default-values 71.69 KB (🟢 -49 B) 164.61 KB
/blog/2013/07/17/react-v0-4-0 72.41 KB (🟢 -49 B) 165.33 KB
/blog/2013/07/23/community-roundup-5 73.29 KB (🟢 -49 B) 166.21 KB
/blog/2013/07/26/react-v0-4-1 71.17 KB (🟢 -49 B) 164.09 KB
/blog/2013/07/30/use-react-and-jsx-in-ruby-on-rails 71.77 KB (🟢 -49 B) 164.69 KB
/blog/2013/08/05/community-roundup-6 72.58 KB (🟢 -49 B) 165.5 KB
/blog/2013/08/19/use-react-and-jsx-in-python-applications 71.78 KB (🟢 -49 B) 164.7 KB
/blog/2013/08/26/community-roundup-7 72.75 KB (🟢 -49 B) 165.67 KB
/blog/2013/09/24/community-roundup-8 74.18 KB (🟢 -49 B) 167.1 KB
/blog/2013/10/03/community-roundup-9 73.12 KB (🟢 -49 B) 166.04 KB
/blog/2013/10/16/react-v0.5.0 72.8 KB (🟢 -49 B) 165.72 KB
/blog/2013/10/29/react-v0-5-1 71.16 KB (🟢 -49 B) 164.08 KB
/blog/2013/11/06/community-roundup-10 74.78 KB (🟢 -49 B) 167.7 KB
/blog/2013/11/18/community-roundup-11 73.86 KB (🟢 -49 B) 166.78 KB
/blog/2013/12/18/react-v0.5.2-v0.4.2 71.63 KB (🟢 -49 B) 164.55 KB
/blog/2013/12/19/react-v0.8.0 72.05 KB (🟢 -49 B) 164.97 KB
/blog/2013/12/23/community-roundup-12 73.51 KB (🟢 -49 B) 166.43 KB
/blog/2013/12/30/community-roundup-13 73.29 KB (🟢 -49 B) 166.21 KB
/blog/2014/01/02/react-chrome-developer-tools 71.55 KB (🟢 -49 B) 164.47 KB
/blog/2014/01/06/community-roundup-14 72.89 KB (🟢 -49 B) 165.81 KB
/blog/2014/02/05/community-roundup-15 74.11 KB (🟢 -49 B) 167.03 KB
/blog/2014/02/15/community-roundup-16 73.82 KB (🟢 -49 B) 166.74 KB
/blog/2014/02/16/react-v0.9-rc1 74.22 KB (🟢 -49 B) 167.14 KB
/blog/2014/02/20/react-v0.9 74.67 KB (🟢 -49 B) 167.59 KB
/blog/2014/02/24/community-roundup-17 73.53 KB (🟢 -49 B) 166.45 KB
/blog/2014/03/14/community-roundup-18 74.5 KB (🟢 -49 B) 167.42 KB
/blog/2014/03/19/react-v0.10-rc1 72.8 KB (🟢 -49 B) 165.72 KB
/blog/2014/03/21/react-v0.10 72.83 KB (🟢 -49 B) 165.75 KB
/blog/2014/03/28/the-road-to-1.0 72.94 KB (🟢 -49 B) 165.86 KB
/blog/2014/04/04/reactnet 71.58 KB (🟢 -49 B) 164.5 KB
/blog/2014/05/06/flux 71.71 KB (🟢 -49 B) 164.63 KB
/blog/2014/05/29/one-year-of-open-source-react 71.93 KB (🟢 -49 B) 164.85 KB
/blog/2014/06/27/community-roundup-19 73.47 KB (🟢 -49 B) 166.39 KB
/blog/2014/07/13/react-v0.11-rc1 73.86 KB (🟢 -49 B) 166.78 KB
/blog/2014/07/17/react-v0.11 75.12 KB (🟢 -49 B) 168.04 KB
/blog/2014/07/25/react-v0.11.1 72.07 KB (🟢 -49 B) 164.99 KB
/blog/2014/07/28/community-roundup-20 73.62 KB (🟢 -49 B) 166.54 KB
/blog/2014/07/30/flux-actions-and-the-dispatcher 73.25 KB (🟢 -49 B) 166.17 KB
/blog/2014/08/03/community-roundup-21 73.29 KB (🟢 -49 B) 166.21 KB
/blog/2014/09/03/introducing-the-jsx-specification 71.29 KB (🟢 -49 B) 164.21 KB
/blog/2014/09/12/community-round-up-22 73.77 KB (🟢 -49 B) 166.69 KB
/blog/2014/09/16/react-v0.11.2 72.06 KB (🟢 -49 B) 164.98 KB
/blog/2014/09/24/testing-flux-applications 75.24 KB (🟢 -49 B) 168.16 KB
/blog/2014/10/14/introducing-react-elements 74.2 KB (🟢 -49 B) 167.12 KB
/blog/2014/10/16/react-v0.12-rc1 74.16 KB (🟢 -49 B) 167.08 KB
/blog/2014/10/17/community-roundup-23 74.74 KB (🟢 -49 B) 167.66 KB
/blog/2014/10/27/react-js-conf 71.34 KB (🟢 -49 B) 164.26 KB
/blog/2014/10/28/react-v0.12 74.1 KB (🟢 -49 B) 167.02 KB
/blog/2014/11/24/react-js-conf-updates 71.72 KB (🟢 -49 B) 164.64 KB
/blog/2014/11/25/community-roundup-24 74.96 KB (🟢 -49 B) 167.88 KB
/blog/2014/12/18/react-v0.12.2 71.75 KB (🟢 -49 B) 164.67 KB
/blog/2014/12/19/react-js-conf-diversity-scholarship 72.15 KB (🟢 -49 B) 165.07 KB
/blog/2015/01/27/react-v0.13.0-beta-1 73.11 KB (🟢 -49 B) 166.03 KB
/blog/2015/02/18/react-conf-roundup-2015 75.1 KB (🟢 -49 B) 168.02 KB
/blog/2015/02/20/introducing-relay-and-graphql 74.25 KB (🟢 -49 B) 167.17 KB
/blog/2015/02/24/react-v0.13-rc1 73.15 KB (🟢 -49 B) 166.07 KB
/blog/2015/02/24/streamlining-react-elements 75.7 KB (🟢 -49 B) 168.62 KB
/blog/2015/03/03/react-v0.13-rc2 72.49 KB (🟢 -49 B) 165.41 KB
/blog/2015/03/04/community-roundup-25 73.45 KB (🟢 -49 B) 166.37 KB
/blog/2015/03/10/react-v0.13 73.77 KB (🟢 -49 B) 166.69 KB
/blog/2015/03/16/react-v0.13.1 71.58 KB (🟢 -49 B) 164.5 KB
/blog/2015/03/19/building-the-facebook-news-feed-with-relay 74.34 KB (🟢 -49 B) 167.26 KB
/blog/2015/03/26/introducing-react-native 71.48 KB (🟢 -49 B) 164.4 KB
/blog/2015/03/30/community-roundup-26 73.42 KB (🟢 -49 B) 166.33 KB
/blog/2015/04/17/react-native-v0.4 72.33 KB (🟢 -49 B) 165.25 KB
/blog/2015/04/18/react-v0.13.2 71.66 KB (🟢 -49 B) 164.58 KB
/blog/2015/05/01/graphql-introduction 76.15 KB (🟢 -49 B) 169.07 KB
/blog/2015/05/08/react-v0.13.3 71.55 KB (🟢 -49 B) 164.47 KB
/blog/2015/05/22/react-native-release-process 71.7 KB (🟢 -49 B) 164.62 KB
/blog/2015/06/12/deprecating-jstransform-and-react-tools 72.16 KB (🟢 -49 B) 165.08 KB
/blog/2015/07/03/react-v0.14-beta-1 73.67 KB (🟢 -49 B) 166.59 KB
/blog/2015/08/03/new-react-devtools-beta 72.27 KB (🟢 -49 B) 165.19 KB
/blog/2015/08/11/relay-technical-preview 72.33 KB (🟢 -49 B) 165.25 KB
/blog/2015/08/13/reacteurope-roundup 73.92 KB (🟢 -49 B) 166.84 KB
/blog/2015/09/02/new-react-developer-tools 71.69 KB (🟢 -49 B) 164.61 KB
/blog/2015/09/10/react-v0.14-rc1 77.37 KB (🟢 -49 B) 170.29 KB
/blog/2015/09/14/community-roundup-27 73.85 KB (🟢 -49 B) 166.77 KB
/blog/2015/10/01/react-render-and-top-level-api 72.82 KB (🟢 -49 B) 165.74 KB
/blog/2015/10/07/react-v0.14 77.85 KB (🟢 -49 B) 170.77 KB
/blog/2015/10/19/reactiflux-is-moving-to-discord 73.57 KB (🟢 -49 B) 166.49 KB
/blog/2015/10/28/react-v0.14.1 71.58 KB (🟢 -49 B) 164.5 KB
/blog/2015/11/02/react-v0.14.2 71.61 KB (🟢 -49 B) 164.53 KB
/blog/2015/11/18/react-v0.14.3 71.73 KB (🟢 -49 B) 164.65 KB
/blog/2015/12/04/react-js-conf-2016-diversity-scholarship 72.6 KB (🟢 -49 B) 165.52 KB
/blog/2015/12/16/ismounted-antipattern 72.21 KB (🟢 -49 B) 165.13 KB
/blog/2015/12/18/react-components-elements-and-instances 76.13 KB (🟢 -49 B) 169.04 KB
/blog/2015/12/29/react-v0.14.4 71.4 KB (🟢 -49 B) 164.32 KB
/blog/2016/01/08/A-implies-B-does-not-imply-B-implies-A 72.42 KB (🟢 -49 B) 165.34 KB
/blog/2016/01/12/discontinuing-ie8-support 71.22 KB (🟢 -49 B) 164.14 KB
/blog/2016/02/19/new-versioning-scheme 72.61 KB (🟢 -49 B) 165.53 KB
/blog/2016/03/07/react-v15-rc1 75.36 KB (🟢 -49 B) 168.28 KB
/blog/2016/03/16/react-v15-rc2 72.22 KB (🟢 -49 B) 165.14 KB
/blog/2016/03/29/react-v0.14.8 71.35 KB (🟢 -49 B) 164.27 KB
/blog/2016/04/07/react-v15 79.54 KB (🟢 -49 B) 172.46 KB
/blog/2016/04/08/react-v15.0.1 72.11 KB (🟢 -49 B) 165.03 KB
/blog/2016/07/11/introducing-reacts-error-code-system 71.82 KB (🟢 -49 B) 164.74 KB
/blog/2016/07/13/mixins-considered-harmful 79.98 KB (🟢 -49 B) 172.9 KB
/blog/2016/07/22/create-apps-with-no-configuration 75.3 KB (🟢 -49 B) 168.22 KB
/blog/2016/08/05/relay-state-of-the-state 75.34 KB (🟢 -49 B) 168.26 KB
/blog/2016/09/28/our-first-50000-stars 76.79 KB (🟢 -49 B) 169.71 KB
/blog/2016/11/16/react-v15.4.0 74.74 KB (🟢 -49 B) 167.66 KB
/blog/2017/04/07/react-v15.5.0 75.31 KB (🟢 -49 B) 168.23 KB
/blog/2017/05/18/whats-new-in-create-react-app 74.71 KB (🟢 -49 B) 167.63 KB
/blog/2017/06/13/react-v15.6.0 73.33 KB (🟢 -49 B) 166.25 KB
/blog/2017/07/26/error-handling-in-react-16 73.67 KB (🟢 -49 B) 166.59 KB
/blog/2017/09/08/dom-attributes-in-react-16 74.11 KB (🟢 -49 B) 167.03 KB
/blog/2017/09/25/react-v15.6.2 72.44 KB (🟢 -49 B) 165.36 KB
/blog/2017/09/26/react-v16.0 77.57 KB (🟢 -49 B) 170.49 KB
/blog/2017/11/28/react-v16.2.0-fragment-support 75.5 KB (🟢 -49 B) 168.42 KB
/blog/2017/12/07/introducing-the-react-rfc-process 72.02 KB (🟢 -49 B) 164.94 KB
/blog/2017/12/15/improving-the-repository-infrastructure 87.81 KB (🟢 -49 B) 180.73 KB
/blog/2018/03/01/sneak-peek-beyond-react-16 71.98 KB (🟢 -49 B) 164.9 KB
/blog/2018/03/27/update-on-async-rendering 77.22 KB (🟢 -49 B) 170.14 KB
/blog/2018/03/29/react-v-16-3 74.04 KB (🟢 -49 B) 166.96 KB
/blog/2018/05/23/react-v-16-4 74.18 KB (🟢 -49 B) 167.1 KB
/blog/2018/06/07/you-probably-dont-need-derived-state 77.84 KB (🟢 -49 B) 170.76 KB
/blog/2018/08/01/react-v-16-4-2 72.83 KB (🟢 -49 B) 165.75 KB
/blog/2018/09/10/introducing-the-react-profiler 74.44 KB (🟢 -49 B) 167.36 KB
/blog/2018/10/01/create-react-app-v2 74.92 KB (🟢 -49 B) 167.84 KB
/blog/2018/10/23/react-v-16-6 74.12 KB (🟢 -49 B) 167.04 KB
/blog/2018/11/13/react-conf-recap 71.83 KB (🟢 -49 B) 164.75 KB
/blog/2018/11/27/react-16-roadmap 78.02 KB (🟢 -49 B) 170.94 KB
/blog/2018/12/19/react-v-16-7 72.96 KB (🟢 -49 B) 165.88 KB
/blog/2019/02/06/react-v16.8.0 75.22 KB (🟢 -49 B) 168.14 KB
/blog/2019/02/23/is-react-translated-yet 74.78 KB (🟢 -49 B) 167.7 KB
/blog/2019/08/08/react-v16.9.0 77.72 KB (🟢 -49 B) 170.64 KB
/blog/2019/08/15/new-react-devtools 72.32 KB (🟢 -49 B) 165.24 KB
/blog/2019/10/22/react-release-channels 74.13 KB (🟢 -49 B) 167.05 KB
/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense 78.84 KB (🟢 -49 B) 171.76 KB
/blog/2020/02/26/react-v16.13.0 75.06 KB (🟢 -49 B) 167.98 KB
/blog/2020/08/10/react-v17-rc 81.34 KB (🟢 -49 B) 174.26 KB
/community 60.37 KB (🟢 -49 B) 153.29 KB
/community/acknowledgements 61.57 KB (🟢 -49 B) 154.49 KB
/community/meet-the-team 62.08 KB (🟢 -49 B) 155 KB
/learn 64.87 KB (🟢 -49 B) 157.79 KB
/learn/add-react-to-a-website 65.2 KB (🟢 -49 B) 158.12 KB
/learn/adding-interactivity 67.01 KB (🟢 -49 B) 159.93 KB
/learn/choosing-the-state-structure 72.74 KB (🟢 -49 B) 165.66 KB
/learn/conditional-rendering 64.97 KB (🟢 -49 B) 157.89 KB
/learn/describing-the-ui 64.19 KB (🟢 -49 B) 157.11 KB
/learn/editor-setup 61.46 KB (🟢 -49 B) 154.38 KB
/learn/escape-hatches 59.71 KB (🟢 -49 B) 152.63 KB
/learn/extracting-state-logic-into-a-reducer 70.37 KB (🟢 -49 B) 163.29 KB
/learn/importing-and-exporting-components 63.37 KB (🟢 -49 B) 156.29 KB
/learn/installation 61.03 KB (🟢 -49 B) 153.95 KB
/learn/javascript-in-jsx-with-curly-braces 63.45 KB (🟢 -49 B) 156.37 KB
/learn/keeping-components-pure 67.58 KB (🟢 -49 B) 160.5 KB
/learn/managing-state 66.3 KB (🟢 -49 B) 159.22 KB
/learn/manipulating-the-dom-with-refs 68.21 KB (🟢 -49 B) 161.13 KB
/learn/passing-data-deeply-with-context 67.72 KB (🟢 -49 B) 160.64 KB
/learn/passing-props-to-a-component 67.15 KB (🟢 -49 B) 160.07 KB
/learn/preserving-and-resetting-state 69.96 KB (🟢 -49 B) 162.88 KB
/learn/queueing-a-series-of-state-updates 64.94 KB (🟢 -49 B) 157.86 KB
/learn/react-developer-tools 60.9 KB (🟢 -49 B) 153.82 KB
/learn/reacting-to-input-with-state 69.42 KB (🟢 -49 B) 162.34 KB
/learn/referencing-values-with-refs 66.47 KB (🟢 -49 B) 159.39 KB
/learn/render-and-commit 63.44 KB (🟢 -49 B) 156.36 KB
/learn/rendering-lists 67.5 KB (🟢 -49 B) 160.42 KB
/learn/responding-to-events 66.49 KB (🟢 -49 B) 159.41 KB
/learn/scaling-up-with-reducer-and-context 64.52 KB (🟢 -49 B) 157.44 KB
/learn/sharing-state-between-components 65.23 KB (🟢 -49 B) 158.15 KB
/learn/start-a-new-react-project 61.87 KB (🟢 -49 B) 154.79 KB
/learn/state-a-components-memory 70.67 KB (🟢 -49 B) 163.59 KB
/learn/state-as-a-snapshot 64.49 KB (🟢 -49 B) 157.41 KB
/learn/thinking-in-react 66.31 KB (🟢 -49 B) 159.23 KB
/learn/updating-arrays-in-state 68.55 KB (🟢 -49 B) 161.47 KB
/learn/updating-objects-in-state 68.27 KB (🟢 -49 B) 161.19 KB
/learn/writing-markup-with-jsx 63.37 KB (🟢 -49 B) 156.29 KB
/learn/your-first-component 64.28 KB (🟢 -49 B) 157.2 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.

@gaearon gaearon merged commit 4ed4fb7 into main Feb 17, 2022
@rickhanlonii rickhanlonii deleted the nonums branch April 29, 2024 02:55
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.

2 participants