-
Notifications
You must be signed in to change notification settings - Fork 973
Stop beach balling with this one simple trick #10305
Conversation
REVIEWERS HATE HIM Whoops- just noticed this is still a WIP; sorry for assigning folks (I had just picked the recommended reviewers 😄 ) |
0ff3668
to
225dd54
Compare
Fix #10094 The problem is with toJS being called to convert the immutable app state Instead we just keep everything in Immutable
before:
after:
|
@@ -610,7 +610,7 @@ const tabState = { | |||
state = tabState.removeTabField(state, 'messageBoxDetail') | |||
state = tabState.removeTabField(state, 'frame') | |||
state = state.delete('tabsInternal') | |||
return state.delete('tabs') | |||
return state.set('tabs', Immutable.List()) |
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.
why the change from delete
to an empty list?
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.
because we used to set default app state in 2 places but now just one place. Via Object.assign after a clean, but I'd of had to have 2 different methods for that, one for immutable and one for not.
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.
I think that might be a problem because at some point in the near future we won't be deleting the tabs and so this won't be equivalent to a default state
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.
that would be perfectly fine to not delete the state. It's just that if you put undefined for 'tabs' in state here then it won't get filled later.
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.
++
merged to master, but this is going to take me a while to rebase for other branches. |
assert.deepEqual(immutableUtil.deleteImmutablePaths(data, ['a', 'b']).toJS(), {c: 3}) | ||
}) | ||
it('removes properties with array string paths', function () { | ||
const data = Immutable.fromJS({a: {a1: 4, a2: 8}, c: 'Cezar learnt directly from master ken', d: 5}) |
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.
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.
👌
}) | ||
describe('deleteImmutablePaths', function () { | ||
it('removes properties with simple strings', function () { | ||
const data = Immutable.fromJS({a: 'Cezar is a black belt in ameri-do-te', b: 2, c: 3}) |
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.
watch out master ken
Stop beach balling with this one simple trick
Stop beach balling with this one simple trick
Stop beach balling with this one simple trick
Merged to 0.20.x, 0.19.x, and 0.18.x. |
@bbondy should we do QA on each release until 0.21 to see if the rebase was successful? |
Bug possibly caused by this: #10371 |
Also, #10376 |
Fix #10094
The problem is with toJS being called to convert the immutable app state
Instead we just keep everything in Immutable
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests