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

fix(utils): add description for the RESET symbol. #2307

Merged
merged 4 commits into from Dec 28, 2023

Conversation

MiroslavPetrik
Copy link
Contributor

This improves debugging as the symbol no longer appears anonymous in logs.

Related Issues or Discussions

#2306
Fixes #

Summary

image

Check List

  • yarn run prettier for formatting code and docs

Copy link

vercel bot commented Dec 22, 2023

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

Name Status Preview Comments Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 28, 2023 3:09pm

Copy link

codesandbox-ci bot commented Dec 22, 2023

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 0afa305:

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

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks for the suggestion.
Does this work for you?

src/vanilla/utils/constants.ts Outdated Show resolved Hide resolved
MiroslavPetrik and others added 3 commits December 28, 2023 15:45
This improves debugging as the symbol no longer appears anonymous in logs.
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution and hope this helps you to develop Jotai libraries!

@dai-shi dai-shi added this to the v2.6.1 milestone Dec 28, 2023
@dai-shi dai-shi merged commit 63de5b0 into pmndrs:main Dec 28, 2023
33 checks passed
@MiroslavPetrik MiroslavPetrik deleted the reset-symbol-description branch December 28, 2023 17:26
@hckhanh
Copy link

hckhanh commented Jan 7, 2024

Hi @dai-shi,
I believe after this PR, my production app cannot upgrade to newer version of jotai anymore. Here are some information about the error

Error: src/components/trip/utils.tsx(30,17): error TS2339: Property 'disabled' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'disabled' does not exist on type 'unique symbol'.
Error: src/components/trip/utils.tsx(56,17): error TS2339: Property 'data' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'data' does not exist on type 'unique symbol'.
Error: src/components/trip/utils.tsx(57,17): error TS2339: Property 'formData' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'formData' does not exist on type 'unique symbol'.
Error: src/components/trip/utils.tsx(58,17): error TS2339: Property 'formData' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'formData' does not exist on type 'unique symbol'.
Error: src/forms/withForm.tsx(26,11): error TS2345: Argument of type '(draft: WritableDraft<FormState>) => void' is not assignable to parameter of type 'unique symbol | FormState | ((draft: unique symbol | WritableDraft<FormState>) => void)'.
  Type '(draft: WritableDraft<FormState>) => void' is not assignable to type '(draft: unique symbol | WritableDraft<FormState>) => void'.
    Types of parameters 'draft' and 'draft' are incompatible.
      Type 'unique symbol | WritableDraft<FormState>' is not assignable to type 'WritableDraft<FormState>'.
        Type 'typeof import("/home/runner/work/saladin-admin/saladin-admin/node_modules/.pnpm/jotai@2.6.1_@types+react@18.2.40_react@18.2.0/node_modules/jotai/esm/vanilla/utils/constants").RESET' is not assignable to type 'WritableDraft<FormState>'.
Error: src/forms/withForm.tsx(28,21): error TS2339: Property 'data' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'data' does not exist on type 'unique symbol'.
Error: src/forms/withForm.tsx(29,21): error TS2339: Property 'formData' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'formData' does not exist on type 'unique symbol'.
Error: src/routes/offline/OfflineOrder.tsx(179,12): error TS2339: Property 'edit' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'edit' does not exist on type 'unique symbol'.
Error: src/routes/offline/OfflineOrder.tsx(180,12): error TS2339: Property 'open' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'open' does not exist on type 'unique symbol'.
Error: src/routes/trip/TripClaim.tsx([134](https://github.com/tenxtenx/saladin-admin/actions/runs/7437390375/job/20234961320?pr=1123#step:8:135),12): error TS2339: Property 'edit' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'edit' does not exist on type 'unique symbol'.
Error: src/routes/trip/TripClaim.tsx([135](https://github.com/tenxtenx/saladin-admin/actions/runs/7437390375/job/20234961320?pr=1123#step:8:136),12): error TS2339: Property 'open' does not exist on type 'unique symbol | WritableDraft<FormState>'.
  Property 'open' does not exist on type 'unique symbol'.
Error: Process completed with exit code 2.

@dai-shi
Copy link
Member

dai-shi commented Jan 8, 2024

Are you sure if this is the cause? I wonder if it's #2304.

In any case, creating a reproduction with https://www.typescriptlang.org/play would be very helpful.

davydkov pushed a commit to likec4/likec4 that referenced this pull request Feb 7, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jotai](https://togithub.com/pmndrs/jotai) | [`^2.6.0` ->
`^2.6.4`](https://renovatebot.com/diffs/npm/jotai/2.6.0/2.6.4) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/jotai/2.6.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/jotai/2.6.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/jotai/2.6.0/2.6.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/jotai/2.6.0/2.6.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pmndrs/jotai (jotai)</summary>

### [`v2.6.4`](https://togithub.com/pmndrs/jotai/releases/tag/v2.6.4)

[Compare
Source](https://togithub.com/pmndrs/jotai/compare/v2.6.3...v2.6.4)

Performance improvement! Check it out!

##### What's Changed

- refactor: refactoring store and options type by
[@&#8203;ssi02014](https://togithub.com/ssi02014) in
[pmndrs/jotai#2360
- refactor: modified Args type by
[@&#8203;ssi02014](https://togithub.com/ssi02014) in
[pmndrs/jotai#2367
- Improve performance of recomputeDependents by
[@&#8203;samkline](https://togithub.com/samkline) in
[pmndrs/jotai#2363
- fix(vanilla): fix unexpected cache in jotai-scope by
[@&#8203;yf-yang](https://togithub.com/yf-yang) in
[pmndrs/jotai#2371

##### New Contributors

- [@&#8203;ssi02014](https://togithub.com/ssi02014) made their first
contribution in
[pmndrs/jotai#2360
- [@&#8203;samkline](https://togithub.com/samkline) made their first
contribution in
[pmndrs/jotai#2363
- [@&#8203;yf-yang](https://togithub.com/yf-yang) made their first
contribution in
[pmndrs/jotai#2371

**Full Changelog**:
pmndrs/jotai@v2.6.3...v2.6.4

### [`v2.6.3`](https://togithub.com/pmndrs/jotai/releases/tag/v2.6.3)

[Compare
Source](https://togithub.com/pmndrs/jotai/compare/v2.6.2...v2.6.3)

Some improvements in core and utils 👏

#### What's Changed

- fix: atoms should not remount on recalculations (with async
dependencies) by [@&#8203;dmaskasky](https://togithub.com/dmaskasky) in
[pmndrs/jotai#2347
- fix(utils): atomWithReducer for jotai-scope by
[@&#8203;dai-shi](https://togithub.com/dai-shi) in
[pmndrs/jotai#2351
- fix(utils/atomWithStorage): defaultStorage with disabled local storage
crashes on mount by
[@&#8203;benediktschlager](https://togithub.com/benediktschlager) in
[pmndrs/jotai#2354
- feat(vanilla): customizable atom.unstable_is by
[@&#8203;dai-shi](https://togithub.com/dai-shi) in
[pmndrs/jotai#2356

#### New Contributors

- [@&#8203;SpringHgui](https://togithub.com/SpringHgui) made their first
contribution in
[pmndrs/jotai#2320
- [@&#8203;sakurawen](https://togithub.com/sakurawen) made their first
contribution in
[pmndrs/jotai#2358
- [@&#8203;JoltCode](https://togithub.com/JoltCode) made their first
contribution in
[pmndrs/jotai#2357
- [@&#8203;benediktschlager](https://togithub.com/benediktschlager) made
their first contribution in
[pmndrs/jotai#2354

**Full Changelog**:
pmndrs/jotai@v2.6.2...v2.6.3

### [`v2.6.2`](https://togithub.com/pmndrs/jotai/releases/tag/v2.6.2)

[Compare
Source](https://togithub.com/pmndrs/jotai/compare/v2.6.1...v2.6.2)

Some improvements for atomWithStorage. Feedback is welcome.

#### What's Changed

- fix(vanilla): should mount once with atom creator atom by
[@&#8203;nogaten](https://togithub.com/nogaten) in
[pmndrs/jotai#2319
- feat(utils): createJSONStrage options by
[@&#8203;dai-shi](https://togithub.com/dai-shi) in
[pmndrs/jotai#2324
- feat(utils): add withStorageValidator by
[@&#8203;dai-shi](https://togithub.com/dai-shi) in
[pmndrs/jotai#2336

#### New Contributors

- [@&#8203;L-Qun](https://togithub.com/L-Qun) made their first
contribution in
[pmndrs/jotai#2318
- [@&#8203;ahme-dev](https://togithub.com/ahme-dev) made their first
contribution in
[pmndrs/jotai#2332
- [@&#8203;nogaten](https://togithub.com/nogaten) made their first
contribution in
[pmndrs/jotai#2319

**Full Changelog**:
pmndrs/jotai@v2.6.1...v2.6.2

### [`v2.6.1`](https://togithub.com/pmndrs/jotai/releases/tag/v2.6.1)

[Compare
Source](https://togithub.com/pmndrs/jotai/compare/v2.6.0...v2.6.1)

This version has two minor improvements for library authors. It's
wonderful to see Jotai ecosystem growing. No major bugs have been
reported lately. It's fairly okay to say the current version is pretty
stable.

#### What's Changed

- fix(utils): add init property to the return type of atomWithReset by
[@&#8203;jaesoekjjang](https://togithub.com/jaesoekjjang) in
[pmndrs/jotai#2304
- fix(utils): add description for the RESET symbol. by
[@&#8203;MiroslavPetrik](https://togithub.com/MiroslavPetrik) in
[pmndrs/jotai#2307

#### New Contributors

- [@&#8203;wherehows](https://togithub.com/wherehows) made their first
contribution in
[pmndrs/jotai#2270
- [@&#8203;benson00077](https://togithub.com/benson00077) made their
first contribution in
[pmndrs/jotai#2284
- [@&#8203;ioExpander](https://togithub.com/ioExpander) made their first
contribution in
[pmndrs/jotai#2280
- [@&#8203;jaesoekjjang](https://togithub.com/jaesoekjjang) made their
first contribution in
[pmndrs/jotai#2304

**Full Changelog**:
pmndrs/jotai@v2.6.0...v2.6.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/likec4/likec4).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

None yet

3 participants