Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

New redux action in editor#4457

Closed
amelzer wants to merge 8 commits into
firefox-devtools:masterfrom
amelzer:new-redux-action-in-editor
Closed

New redux action in editor#4457
amelzer wants to merge 8 commits into
firefox-devtools:masterfrom
amelzer:new-redux-action-in-editor

Conversation

@amelzer

@amelzer amelzer commented Oct 21, 2017

Copy link
Copy Markdown
Contributor

Associated Issue: #4435

Here's the Pull Request Doc
https://devtools-html.github.io/debugger.html/CONTRIBUTING.html#pull-requests

Summary of Changes

  • Improve flow type definitions
  • use new action for traversing

Comment thread src/components/Editor/index.js Outdated
addOrToggleDisabledBreakpoint: line =>
dispatch(addOrToggleDisabledBreakpoint(line)),
traverseResults: (rev, editor) => dispatch(traverseResults(rev, editor))
};

@jasonLaster jasonLaster Oct 21, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ooh, I like this style, but let's discuss adopting it in a separate PR.

I honk we can land his fix without I and see what style for actions is most used in the community. I would Perper something as explicit, but more terse. It might not exist :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can roll back the style changes. Let's have the discussion here: #4454

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just so this doesn't get lost, we can avoid the function entirely like this.

@jasonLaster jasonLaster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Comment thread src/components/Editor/index.js Outdated
};

class Editor extends PureComponent<Props, State> {
props: Props;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don think we need this

toggleBreakpoint: number => void,
addOrToggleDisabledBreakpoint: number => void,
jumpToMappedLocation: any => void,
traverseResults: (boolean, Object) => void

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yay

}

if (conditionalPanelLine) {
return closeConditionalPanel();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, I'd like to check elsewhere but I believe in functions with multiple actions we destructure for brevity

Comment thread src/components/Editor/index.js Outdated
};
};

const mapDispatchToProps = dispatch => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉

@amelzer

amelzer commented Oct 22, 2017

Copy link
Copy Markdown
Contributor Author

I rolled back the redux changes in this PR, so that it can be merged @jasonLaster @wldcordeiro

@codehag codehag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work so far. a couple of comments


const direction = e.shiftKey ? "prev" : "next";
traverseResults(e, ctx, query, direction, searchModifiers.toJS());
this.props.traverseResults(e.shiftKey, this.state.editor);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

onGutterClick = (cm, line, gutter, ev) => {
const {
selectedSource,
toggleBreakpoint,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are we removing these? they seem to still be used the same way as before

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, forgot to roll that back. Will take care of it. Sorry for the confusion.

};

openMenu(event) {
const { setContextMenu } = this.props;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we probably don't need this change

continueToHere: Function,
setContextMenu: Function

// Actions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice idea with the comment!

getHitCountForSource,
getCoverageEnabled,
getConditionalPanelLine,
getFileSearchModifiers,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@jasonLaster

Copy link
Copy Markdown
Contributor

Hey @amelzer is this good to go or are there other changes?

@amelzer

amelzer commented Oct 26, 2017

Copy link
Copy Markdown
Contributor Author

@jasonLaster Pushed another reroll, good to go now

@jasonLaster jasonLaster force-pushed the new-redux-action-in-editor branch from 98bcdc3 to 2ef82fb Compare October 26, 2017 15:56
@jasonLaster

Copy link
Copy Markdown
Contributor

just did a quick rebase. should be good

@jasonLaster

Copy link
Copy Markdown
Contributor

@amelzer looks like there are some failing tests.. that need to be sorted out :/

@amelzer

amelzer commented Oct 31, 2017

Copy link
Copy Markdown
Contributor Author

@jasonLaster Tadaa

@jasonLaster

Copy link
Copy Markdown
Contributor

@amelzer i see another conflict... sorry :/

@amelzer

amelzer commented Nov 1, 2017

Copy link
Copy Markdown
Contributor Author

That's it, I'm calling it quits in this PR.
Opened a new one over here:
#4552

@amelzer amelzer closed this Nov 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants