-
Notifications
You must be signed in to change notification settings - Fork 641
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
improved redux dev tools integration, add allParentIds to middleware events #1035
Conversation
@bourquep care to test it and let me know how it works for you? Make sure to add
as third argument of |
Is there a way to test this, other than cloning the repo down locally? |
The way I do it:
|
@xaviergonz In my But it makes the Redux devtools perform quite poorly with this PR, as it seems to interpret every single |
@bourquep care to test it using |
@xaviergonz That is how I have been testing it |
hmm, care to create a small piece of code to reproduce what refreshAllConfigs is doing? |
I might also create an option like "showSubactions: boolean" so that inner actions are not reported |
Hmm, I can give it a shot later today |
Thanks! |
@bourquep I just added:
so you may want to try it with logChildActions to false (the default) and maybe logIdempotentActionSteps to false (if that still crashes try true instead) hopefully the |
Yes sorry I did not have time to test this any further but I will soon.
… Le 16 oct. 2018 à 05:24, Javier Gonzalez ***@***.***> a écrit :
Waiting for feedback from @bourquep I guess
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
With the default values ( If I set {
type: '[root/configStore/configs/5b6db24ef5814e0013ec12e7/contents/5bc48cc6ff0b1f0010727e0f].toggleState (0)',
targetTypePath: 'RootStore/SchoolYearConfigurationStore/map<string, late(function () { return __WEBPACK_IMPORTED_MODULE_4__Models_SchoolYearConfiguration__["a" /* SchoolYearConfigurationModel */]; })>/SchoolYearConfigurationModel/map<string, late(function () { return __WEBPACK_IMPORTED_MODULE_5__ContentDefinition__["a" /* ContentDefinitionModel */]; })>/ContentDefinition',
args: {}
} For context: export const SchoolYearConfigurationModel = types
.model('SchoolYearConfigurationModel', {
id: types.identifier,
// A bunch of attributes omitted
})
// Other data related to a config
.props({
contents: types.map(types.late(() => ContentDefinitionModel))
});
export const ContentDefinitionModel = types
.model('ContentDefinition', {
id: t.identifier,
// A bunch of attributes omitted
})
.actions(self => {
const _actions = {
toggleState() {
if (self.state === ContentState.CANCELLED) {
return;
}
let newState = self.state === ContentState.ACTIVE ? ContentState.COMPLETED : ContentState.ACTIVE;
self.state = newState;
}
};
return _actions;
}); In short:
But at this point, I don't really mind leaving |
Small request: when the action name is long, such as |
sadly redux-dev-tools eats ¡\n' for breakfast or adding a space before the dot so it shows on the next line if there's not enough space
any preference? I'll try to use your sample to see if I can mimic your missing action btw |
@xaviergonz Slight preference for the second option, adding a space before the dot so it shows on the next line. But really, both would work for me. Thanks for looking into the missing action. Let me know if you need more context. |
@bourquep is state volatile by any chance, or just a string in the props? |
I tried this unit test
and it properly generated this
Am I missing something? |
State is an enum, expressed as a custom type:
|
still looking good to me |
by any chance, maybe you are calling the action when it is in a cancelled state and therefore not generating a change in the model and that's why it is not being logged when logIdempotentActions is set to false? |
Added
so it will show either way they can still be accessed from "args" inside the action info |
No I notice in your test case that the keys used in the map don't correspond to the object's identifier. Probably has nothing to do with the issue at hand, but mentionning it just in case... I'll try to see if I can adapt the test case to make it behave like what I am observing. |
thanks, it would be great if you could get the unit test to fail |
I am unable to make the test fail. I'll have to dig deeper into my codebase, it might very well be the case that we are doing something not quite right in this action. I suggest this PR should be merged and deployed as-is. |
thanks for trying, up to @mweststrate now then :) |
parentId: currentActionContext ? currentActionContext.id : 0, | ||
allParentIds: currentActionContext | ||
? [...currentActionContext.allParentIds, currentActionContext.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.
NIT: EMPTY_ARRAY
to avoid needles array allocations
@xaviergonz looking good, not merged yet due to conflicts |
thanks, will fix them later today. I was thinking of cutting a release after this merge. should it be minor I guess? |
Yep I think so. But released the typescript stuff already 😏
Op do 18 okt. 2018 15:55 schreef Javier Gonzalez <[email protected]>:
… thanks, will fix them later today. I was thinking of cutting a release
after this merge. should it be minor I guess?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1035 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhFz5HcLw_Uiz13IHYCuENoPS8JS2ks5umIhggaJpZM4XMAyl>
.
|
Closes #750
This PR:
[root].someAsyncAction (0)
(code run until the first yield)[root].someActionAction (1)
(code run from first yield to second yield)[root].someActionAction (2)
(code run from second yield to third yield, etc...)[root].someAction -error thrown-
[root].someAction >>> [root/child].someSubAction
[root/myArray/0].someAction
)args: { "0": arg0, "1": arg1... }
andtargetTypePath: "MyModel/ChildModel"
(or in the case of subactionsMyModel >>> MyModel/ChildModel
)The connectReduxDevtools function now supports a third argument with options:
logIdempotentActionSteps
:true
by default due to possible performance penalty because of the internal usage of onPatch. When set tofalse
it will skip reporting of actions and flow action "steps" that do not end up in an actual change in the model (except when an error is thrown), thus reducing the amount of noise in the logs.logChildActions
:false
by default. When set totrue
it will report actions that are executed inside a root actions. When set tofalse
it will not.Not compatible with PR #1032