-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add runtime type-checker for bigint #366
base: master
Are you sure you want to change the base?
Conversation
✔️ Deploy Preview for mobx-keystone ready! 🔨 Explore the source changes: c67c4e6 🔍 Inspect the deploy log: https://app.netlify.com/sites/mobx-keystone/deploys/6215521a7162960008b67fbf 😎 Browse the preview: https://deploy-preview-366--mobx-keystone.netlify.app |
Codecov Report
@@ Coverage Diff @@
## master #366 +/- ##
==========================================
- Coverage 90.93% 90.91% -0.02%
==========================================
Files 179 179
Lines 6387 6395 +8
Branches 1157 1160 +3
==========================================
+ Hits 5808 5814 +6
- Misses 542 544 +2
Partials 37 37
Continue to review full report at Codecov.
|
Hmm, the problem with that types.bigint implementation is that it is not serializable to json, so it would result on unseralizable snapshots/patches when JSON.parse/JSON.stringify is used. The other option would be to define |
Yes, you're right. Your observation is related to #369, something I stumbled over while working on those BigInt features. |
That being said, if there's a |
Something like |
As an additional benefit, types with built-in transforms would be awesome when used in objects/arrays and nested fields: tProp(types.object(() => ({
int: types.bigint,
date: types.date("timestamp"),
}))) Currently, it would be hard to do that with the |
I tried it, even had a whole branch dedicated to that idea, but in the end I got bitten by some of the same typing problems than MST (problems with recursive types mostly)... |
Hm, do you still have that branch and would you share it? |
I will need to check if it's still alive (it was on the laptop that broke and not pushed anywhere) |
No description provided.