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

Extract messages to separate file #GoodnessSquad #783

Merged
merged 9 commits into from
Jan 26, 2017

Conversation

dreisel
Copy link

@dreisel dreisel commented Jan 20, 2017

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 96.223% when pulling ac9aaac on reisel:extractMessages into 568b1af on mobxjs:master.

@dreisel dreisel changed the title Extract messages to seperate file Extract messages to separate file #GoodnessSquad Jan 20, 2017
? "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")
Copy link
Member

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];
};
Copy link
Member

Choose a reason for hiding this comment

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

Add new line

Copy link
Author

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.",

Copy link
Member

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.",

Copy link
Member

Choose a reason for hiding this comment

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

Remove empty line

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 96.223% when pulling 9f8cdab on reisel:extractMessages into 568b1af on mobxjs:master.

This reverts commit 199f914.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 96.223% when pulling 7473ad5 on reisel:extractMessages into 568b1af on mobxjs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 96.223% when pulling 6bb7674 on reisel:extractMessages into 67f8255 on mobxjs:master.

@mweststrate mweststrate merged commit af45aa0 into mobxjs:master Jan 26, 2017
@mweststrate
Copy link
Member

Merged and will be part of next release! Probably needs some follow up to leverage this new mechanism during production builds, (NODE_ENV === production like react?), and can be expanded for parameterizable actions

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.

5 participants