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

Scopes to JSX#3611

Merged
wldcordeiro merged 2 commits into
firefox-devtools:masterfrom
ksaldana1:jsx-transform-Scopes
Aug 10, 2017
Merged

Scopes to JSX#3611
wldcordeiro merged 2 commits into
firefox-devtools:masterfrom
ksaldana1:jsx-transform-Scopes

Conversation

@ksaldana1
Copy link
Copy Markdown
Contributor

Associated Issue: #3506

Summary of Changes

  • Replace all React.createElement calls to JSX in Scopes.js

Test Plan

Desk testing. No snapshot test to confirm against. Are we wanting to increase our snapshot coverage going forward?

Screenshots/Videos (OPTIONAL)

screen shot 2017-08-09 at 4 20 42 pm

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 9, 2017

Codecov Report

Merging #3611 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3611      +/-   ##
==========================================
- Coverage   54.56%   54.51%   -0.05%     
==========================================
  Files         120      120              
  Lines        4750     4747       -3     
  Branches      981      982       +1     
==========================================
- Hits         2592     2588       -4     
- Misses       2158     2159       +1
Impacted Files Coverage Δ
src/actions/ast.js 76.78% <0%> (-1.79%) ⬇️
src/components/shared/SearchInput.js 92.59% <0%> (-0.75%) ⬇️
src/components/shared/ResultList.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ebb3de...de80ea0. Read the comment docs.

Comment thread src/components/SecondaryPanes/Scopes.js Outdated

function info(text) {
return dom.div({ className: "pane-info" }, text);
return (
Copy link
Copy Markdown
Contributor

@wldcordeiro wldcordeiro Aug 9, 2017

Choose a reason for hiding this comment

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

Hmm, to be more React idiomatic let's do.

function Info({ children }) { // or PaneInfo
  return (
    <div className="pane-info">
      {children}
    </div>
  );
}

Comment thread src/components/SecondaryPanes/Scopes.js Outdated
pauseInfo ? scopeInspector : info(L10N.getStr("scopes.notPaused"))
return (
<div className="pane scopes-list">
{pauseInfo ? scopeInspector : info(L10N.getStr("scopes.notPaused"))}
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.

If the above is done this line should be

{pauseInfo ? scopeInspector : <PaneInfo>{L10N.getStr("scopes.notPaused")}</PaneInfo>}

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.

Good call. Can actually do the same on ln 62 above.

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.

True you could make this block

<PaneInfo>
  {pauseInfo ? L10N.getStr("scopes.notAvailable") : L10N.getStr("scopes.notPaused")}
</PaneInfo>

Copy link
Copy Markdown
Contributor

@wldcordeiro wldcordeiro left a comment

Choose a reason for hiding this comment

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

Some minor tweaks @ksaldana1 but thanks for all the great work!

@wldcordeiro wldcordeiro force-pushed the jsx-transform-Scopes branch from c7c4d67 to de80ea0 Compare August 10, 2017 01:58
@wldcordeiro
Copy link
Copy Markdown
Contributor

Thanks a lot @ksaldana1 you've been a big help on the JSX transforms. I've made a tweak to your last commit but this looks ready! I'll wait for CI and merge.

@wldcordeiro wldcordeiro merged commit ec15ad3 into firefox-devtools:master Aug 10, 2017
Copy link
Copy Markdown
Contributor

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

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

Looks good to me.

It would be nice to get some unit tests in there though :P

@ksaldana1
Copy link
Copy Markdown
Contributor Author

ksaldana1 commented Aug 10, 2017

I agree, @jasonLaster. Are you wanting snapshot tests or more functional assertion unit tests? I guess the answer to that is probably both, ideally. I would like to become more familiar with Enzyme/Jest snapshots, so would be a good opportunity for me to swing back around on some of these more straightforward components.

Happy to help @wldcordeiro!

@jasonLaster
Copy link
Copy Markdown
Contributor

jasonLaster commented Aug 10, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants