Skip to content

Commit e1d0498

Browse files
committed
docs: Update README, Code of Conduct, Contributing Guide, License
1 parent 297d677 commit e1d0498

File tree

7 files changed

+149
-7
lines changed

7 files changed

+149
-7
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
For answers to common questions about this code of conduct, see
74+
https://www.contributor-covenant.org/faq

.github/CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contributing Guide
2+
3+
## 1. Setup
4+
5+
```bash
6+
git clone https://github.com/aidenybai/react-scan.git
7+
cd react-scan
8+
pnpm install
9+
```
10+
11+
## 2. Run dev build
12+
13+
```bash
14+
pnpm run dev
15+
```
16+
17+
## 3. Run test environment
18+
19+
```bash
20+
cd test
21+
pnpm run dev
22+
```
23+
24+
Go to http://localhost:5173 to see the test environment.

.github/assets/github.mp4

3.72 MB
Binary file not shown.

.github/assets/instagram.mp4

3.44 MB
Binary file not shown.

.github/assets/twitter.mp4

3.8 MB
Binary file not shown.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2024 Aiden Bai
1+
Copyright 2024 Aiden Bai, Million Software, Inc.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
React Scan detects performance issues in your React app.
44

5-
Previously, tools like [`<Profiler />`](https://react.dev/reference/react-devtools), [Why Did You Render?](https://github.com/welldone-software/why-did-you-render), and [React Devtools](https://legacy.reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html) required lots of manual code change, lacked simple visual cues, and had a high noise-to-signal ratio.
5+
Previously, tools like [`<Profiler />`](https://react.dev/reference/react-devtools), [Why Did You Render?](https://github.com/welldone-software/why-did-you-render), and [React Devtools](https://legacy.reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html) required lots of manual code change, lacked simple visual cues, and had noisy data.
66

7-
Instead, React Scan automatically detects and highlights components that cause performance issues. This filters out the noise and shows you exactly what you need to fix.
7+
Instead, React Scan automatically detects and highlights renders that cause performance issues. This shows you exactly which components you need to fix.
88

99
It's also just JavaScript, so you drop it in anywhere – script tag, npm, you name it!
1010

11-
[**Try it out! →**](https://react-scan.million.dev)
11+
### [**Try it out! →**](https://react-scan.million.dev)
1212

1313
![React Scan in action](https://raw.githubusercontent.com/aidenybai/react-scan/refs/heads/main/.github/assets/demo.gif?token=GHSAT0AAAAAAB4IOFACRC6P6E45TB2FPYFCZZV2AYA)
1414

15+
> Looking for a more advanced version? Check out [Million Lint](https://million.dev)!
16+
1517
## Install
1618

1719
Get started in 5 seconds, add this script to your app:
@@ -40,12 +42,42 @@ scan({
4042

4143
And voilà! You're ready to go.
4244

43-
> Looking for a more advanced version? Check out [Million Lint](https://million.dev)!
45+
## Why React Scan?
46+
47+
React can be tricky to optimize.
48+
49+
The issue is that component props are compared by reference, not value. This is intentional – this way rendering can be cheap to run.
50+
51+
However, this makes it easy to accidentally cause unnecessary renders, making the the app slow. Even in production apps, with hundreds of engineers, can't fully optimize their apps (see [GitHub](https://github.com/aidenybai/react-scan/blob/main/.github/assets/github.mp4), [Twitter](https://github.com/aidenybai/react-scan/blob/main/.github/assets/twitter.mp4), and [Instagram](https://github.com/aidenybai/react-scan/blob/main/.github/assets/instagram.mp4)).
52+
53+
This often comes down to props that update in reference, like callbacks or object values. For example, the `onClick` function and `style` object are re-created on every render, causing `ExpensiveComponent` to slow down the app:
54+
55+
```jsx
56+
<ExpensiveComponent onClick={() => alert('hi')} style={{ color: 'purple' }} />
57+
```
58+
59+
React Scan helps you identify these issues by automatically detecting and highlighting renders that cause performance issues. Now, instead of guessing, you can see exactly which components you need to fix.
60+
61+
> Want to automatically fix these issues? Check out [Million Lint](https://million.dev)!
4462
45-
## How does it work?
63+
## Resources & Contributing Back
4664

47-
## Future roadmap
65+
Want to try it out? Check the [our demo](https://react-scan.million.dev).
4866

67+
Looking to contribute back? Check the [Contributing Guide](https://github.com/aidenybai/react-scan/blob/main/.github/CONTRIBUTING.md) out.
68+
69+
Want to talk to the community? Hop in our [Discord](https://discord.gg/X9yFbcV2rF) and share your ideas and what you've build with React Scan.
70+
71+
Find a bug? Head over to our [issue tracker](https://github.com/aidenybai/react-scan/issues) and we'll do our best to help. We love pull requests, too!
72+
73+
We expect all contributors to abide by the terms of our [Code of Conduct](https://github.com/aidenybai/react-scan/blob/main/.github/CODE_OF_CONDUCT.md).
74+
75+
[**→ Start contributing on GitHub**](https://github.com/aidenybai/react-scan/blob/main/.github/CONTRIBUTING.md)
76+
77+
- [x] Scan only for unnecessary renders ("unstable" props)
78+
- [x] Scan API (`withScan`, `scan`)
79+
- [ ] Offscreen canvas on worker thread
80+
- [ ] React Native support
4981
- [ ] Chrome extension
5082
- [ ] Cleanup config options
5183
- [ ] Name / explain the actual problem
@@ -54,3 +86,15 @@ And voilà! You're ready to go.
5486
- [ ] Drag and select areas of the screen to scan
5587
- [ ] Mode to only show on main thread blocking
5688
- [ ] Add a funny mascot, like the ["Stop I'm Changing" dude](https://www.youtube.com/shorts/FwOZdX7bDKI?app=desktop)
89+
90+
## Acknowledgments
91+
92+
React Scan takes inspiration from the following projects:
93+
94+
- [Million Lint](https://million.dev) for scanning and linting approaches
95+
- [React Devtools](https://react.dev/learn/react-developer-tools) for the initial idea of [highlighting renders](https://medium.com/dev-proto/highlight-react-components-updates-1b2832f2ce48)
96+
- [Why Did You Render?](https://github.com/welldone-software/why-did-you-render) for the concept of hijacking internals to detect unnecessary renders caused by "unstable" props
97+
98+
## License
99+
100+
React Scan is [MIT-licensed](LICENSE) open-source software by Aiden Bai, [Million Software, Inc.](https://million.dev), and [contributors](https://github.com/aidenybai/react-scan/graphs/contributors):

0 commit comments

Comments
 (0)