-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Extract messages to separate file #GoodnessSquad #783
Conversation
# Conflicts: # src/api/extendobservable.ts # src/api/whyrun.ts
? "It is not allowed to create or change state outside an `action` when MobX is in strict mode. Wrap the current method in `action` if this state change is intended" | ||
: "It is not allowed to change the state when a computed value or transformer is being evaluated. Use 'autorun' to create reactive functions with side-effects." | ||
? getMessage("m030") | ||
:getMessage("m031") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space after :
|
||
export function getMessage(id : string) { | ||
return messages[id]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where?
"m036" : "It is not possible to get index atoms from arrays" , | ||
"m037" : "\nHi there! I'm sorry you have just run into an exception.\n\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\n However, more interesting is the actual stack trace of the error itself.\n Hopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\n See \`error.stack\` property, or press the very subtle \"(...)\" link you see near the console.error message that probably brought you here.\n That stack is more interesting than the stack of this console.error itself.\n\n If the exception you see is an exception you created yourself, make sure to use \`throw new Error(\"Oops\")\` instead of \`throw \"Oops\"\`,\n because the javascript environment will only preserve the original stack trace in the first form.\n\n You can also make sure the debugger pauses the next time this very same exception is thrown by enabling \"Pause on caught exception\".\n (Note that it might pause on many other, unrelated exception as well).\n\n If that all doesn't help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n", | ||
"m038" : "Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line
"m036" : "It is not possible to get index atoms from arrays" , | ||
"m037" : "\nHi there! I'm sorry you have just run into an exception.\n\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\n However, more interesting is the actual stack trace of the error itself.\n Hopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\n See \`error.stack\` property, or press the very subtle \"(...)\" link you see near the console.error message that probably brought you here.\n That stack is more interesting than the stack of this console.error itself.\n\n If the exception you see is an exception you created yourself, make sure to use \`throw new Error(\"Oops\")\` instead of \`throw \"Oops\"\`,\n because the javascript environment will only preserve the original stack trace in the first form.\n\n You can also make sure the debugger pauses the next time this very same exception is thrown by enabling \"Pause on caught exception\".\n (Note that it might pause on many other, unrelated exception as well).\n\n If that all doesn't help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n", | ||
"m038" : "Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line
This reverts commit 199f914.
Merged and will be part of next release! Probably needs some follow up to leverage this new mechanism during production builds, ( |
First stage of issue: #653
I've extracted messages to a separate file in order to substitute them in the production build.
extracted 5.8kb of data.