Comments (8)
Hey @nithinssabu - thanks for your interest! That's great!
I'm gonna go ahead and assign this issue to you for now.
To begin, do you want to read through the issue, take a look at the original PR, and comment back with your understanding of the problem/how you want to approach it?
From there, we can get you started on a PR.
If you're feeling particularly industrious, I'd also be happy to start with a PR that has some test cases to demo your intended solution.
Let me know any way I can be helpful. I'm gonna be a little busy until Friday, but will try to be available for set up questions.
from mobx-state-tree.
Hey @nithinssabu - just about right, although after thinking about this a bit more, I think we should make this change backwards compatible by:
- Keeping the existing test case intact and passing - for production specific environments
- Adding a new test that throws an exception only when not in production. Here is an example where we test that specific environmental behavior.
If we do that, we should be able to include this in the next minor release, rather than waiting for a breaking change. I think very strictly speaking, this will break MST in some development builds, but keeping the new exception out of production will support MST v5 overall.
from mobx-state-tree.
If anyone is interested in grabbing this, I would be happy to discuss different approaches, help you get set up in the repo, or whatever else would make this feel accessible for first time contributors.
from mobx-state-tree.
I am using Mobx daily at work, but not MST. I am an experienced developer but have not used Typescript yet.
I am interested in picking this up if my experience level mentioned above is not a blocker.
from mobx-state-tree.
I'm gonna go ahead and assign this issue to you for now.
Thank you for assigning me. I'm so excited about this.
So, here's my understanding of the problem:
Currently when we provide an invalid name value, the model will be created with the name AnonymousModel
and the properties will be empty (even if provided). This can cause confusing behaviour, especially to non-TS users.
We want to throw an exception in this case instead of creating a valid model.
I would approach it this way:
- Modify this test case to assert that an exception is thrown
- Fix the behaviour to match this assertion
from mobx-state-tree.
Hi @coolsoftwaretyler Please check the linked PR and see if it meets the requirements. Also, please suggest a better error message if the one I used is not good enough.
from mobx-state-tree.
Thanks, @nithinssabu! I will take a look today or this weekend. Appreciate your time!
from mobx-state-tree.
@coolsoftwaretyler Thanks for the review and merging the PR. It would be great if you can assign to me similar smaller issues that are not urgent. I would like to actively contribute.
from mobx-state-tree.
Related Issues (20)
- RootStore type becomes "any" the moment we call a RootStore model action using yield on a child model action HOT 3
- detach can corrupt the identifierCache HOT 2
- Add tests and documentation for debug names in complex types
- Add tests and documentation for new parent argument to `types.optional` HOT 1
- Document how MST lazily creates objects HOT 1
- Use getTime() to check for Date equality HOT 8
- Remove Lerna config and lift MST sub-package up
- When observe() a MST node's primitive property, TypeScript get the wrong type of oldValue & newValue HOT 1
- Add safeMap utility (or something like it)
- Broken Map type in 5.3.0 HOT 8
- TypeError: 0, _mobx.defineProperty is not a function (it is undefined) HOT 4
- applySnapshot is slow HOT 1
- Unexpected error "Сannot finalize the creation of a node that is already dead" while applying snapshot HOT 16
- Linters do not recognize `fail` as a required import in library code HOT 4
- REST - create data with server side ID HOT 2
- Better documentation on action/view definitions and their impact on IDE introspection, navigation and refactoring HOT 2
- Missing docs for `types.lazy` HOT 2
- getMembers does not work as expected, behaviour change between 5.1.0 and 5.4.1 HOT 11
- Model constructor modifies descriptor object HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobx-state-tree.