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

feat(vanilla): prefer using this for atom config #2186

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Oct 16, 2023

It was intentional to avoid this so that it's never confusing when copying atom config objects.
(btw, this was the reason we avoided using class syntax suggested by @Thisen. so, it might be reconsiderable. Though, I'm not sure the final decision because of bundle size / little performance trade-off.)

As it turns out, not using this blocks some extended patterns. jotaijs/jotai-scope#4
(And, I ended up with a suboptimal solution jotaijs/jotai-scope#2.)

Let's see how it can change the situation.

@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview Oct 16, 2023 2:16am

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f4168f9:

Sandbox Source
React Configuration
React TypeScript Configuration
React Browserify Configuration
React Snowpack Configuration
Next.js Configuration
Next.js with custom Babel config Configuration
React with custom Babel config Configuration

@github-actions
Copy link

Size Change: +284 B (0%)

Total Size: 68.6 kB

Filename Size Change
dist/system/vanilla.development.js 4.01 kB +10 B (0%)
dist/system/vanilla.production.js 2 kB +7 B (0%)
dist/system/vanilla/utils.development.js 4.55 kB +21 B (0%)
dist/system/vanilla/utils.production.js 2.79 kB +18 B (+1%)
dist/umd/vanilla.development.js 4.8 kB -1 B (0%)
dist/umd/vanilla.production.js 2.18 kB +3 B (0%)
dist/umd/vanilla/utils.development.js 5.33 kB +82 B (+2%)
dist/umd/vanilla/utils.production.js 3.3 kB +59 B (+2%)
dist/vanilla/utils.js 5.2 kB +85 B (+2%)
ℹ️ View Unchanged
Filename Size
dist/babel/plugin-debug-label.js 907 B
dist/babel/plugin-react-refresh.js 1.14 kB
dist/babel/preset.js 1.38 kB
dist/index.js 242 B
dist/react.js 1.05 kB
dist/react/utils.js 1.26 kB
dist/system/babel/plugin-debug-label.development.js 1.09 kB
dist/system/babel/plugin-debug-label.production.js 757 B
dist/system/babel/plugin-react-refresh.development.js 1.29 kB
dist/system/babel/plugin-react-refresh.production.js 929 B
dist/system/babel/preset.development.js 1.56 kB
dist/system/babel/preset.production.js 1.13 kB
dist/system/index.development.js 236 B
dist/system/index.production.js 167 B
dist/system/react.development.js 1.17 kB
dist/system/react.production.js 701 B
dist/system/react/utils.development.js 713 B
dist/system/react/utils.production.js 451 B
dist/system/utils.development.js 241 B
dist/system/utils.production.js 175 B
dist/umd/babel/plugin-debug-label.development.js 1.06 kB
dist/umd/babel/plugin-debug-label.production.js 845 B
dist/umd/babel/plugin-react-refresh.development.js 1.28 kB
dist/umd/babel/plugin-react-refresh.production.js 1.01 kB
dist/umd/babel/preset.development.js 1.53 kB
dist/umd/babel/preset.production.js 1.24 kB
dist/umd/index.development.js 381 B
dist/umd/index.production.js 329 B
dist/umd/react.development.js 1.18 kB
dist/umd/react.production.js 785 B
dist/umd/react/utils.development.js 1.42 kB
dist/umd/react/utils.production.js 1.03 kB
dist/umd/utils.development.js 398 B
dist/umd/utils.production.js 343 B
dist/utils.js 246 B
dist/vanilla.js 4.72 kB

compressed-size-action

@yf-yang
Copy link
Contributor

yf-yang commented Oct 16, 2023

Can you please give a short example to explain the difference when patching atom before/after this change?

@dai-shi
Copy link
Member Author

dai-shi commented Oct 16, 2023

jotaijs/jotai-scope#5 is open.
It simply doesn't work without this change.

@dai-shi
Copy link
Member Author

dai-shi commented Oct 17, 2023

jotaijs/jotai-scope#5 seems to work well. Let's do this.

@dai-shi dai-shi marked this pull request as ready for review October 17, 2023 01:21
@dai-shi dai-shi added this to the v2.5.0 milestone Oct 23, 2023
@dai-shi dai-shi merged commit 6c9e030 into main Oct 23, 2023
@dai-shi dai-shi deleted the feat/use-this-in-atom-config branch October 23, 2023 12:55
yf-yang added a commit to yf-yang/jotai that referenced this pull request Jan 22, 2024
yf-yang added a commit to yf-yang/jotai that referenced this pull request Jan 23, 2024
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.

2 participants