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

#3506 WhyPaused to JSX#3579

Merged
jasonLaster merged 2 commits into
firefox-devtools:masterfrom
ksaldana1:jsx-conversion-WhyPaused
Aug 9, 2017
Merged

#3506 WhyPaused to JSX#3579
jasonLaster merged 2 commits into
firefox-devtools:masterfrom
ksaldana1:jsx-conversion-WhyPaused

Conversation

@ksaldana1
Copy link
Copy Markdown
Contributor

Associated Issue: #3506

Summary of Changes

  • Replace all React.createElement calls to JSX.

Test Plan

Previous snapshot test passes.

@ksaldana1 ksaldana1 closed this Aug 5, 2017
@wldcordeiro
Copy link
Copy Markdown
Contributor

@ksaldana1 any reason why this was closed? That component hasn't been converted to JSX yet.

@jasonLaster jasonLaster reopened this Aug 7, 2017
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 7, 2017

Codecov Report

Merging #3579 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3579      +/-   ##
==========================================
- Coverage   52.59%   52.57%   -0.03%     
==========================================
  Files         119      119              
  Lines        4649     4649              
  Branches      958      958              
==========================================
- Hits         2445     2444       -1     
- Misses       2204     2205       +1
Impacted Files Coverage Δ
src/components/SecondaryPanes/Frames/WhyPaused.js 90.47% <100%> (ø) ⬆️
src/actions/ast.js 76.78% <0%> (-1.79%) ⬇️

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 c5759ea...1e693f0. Read the comment docs.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 7, 2017

Codecov Report

Merging #3579 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3579      +/-   ##
==========================================
- Coverage   52.59%   52.57%   -0.03%     
==========================================
  Files         119      119              
  Lines        4649     4649              
  Branches      958      958              
==========================================
- Hits         2445     2444       -1     
- Misses       2204     2205       +1
Impacted Files Coverage Δ
src/components/SecondaryPanes/Frames/WhyPaused.js 90.47% <100%> (ø) ⬆️
src/actions/ast.js 76.78% <0%> (-1.79%) ⬇️

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 c5759ea...533aef9. Read the comment docs.

@jasonLaster
Copy link
Copy Markdown
Contributor

opening (just incase)

@ksaldana1
Copy link
Copy Markdown
Contributor Author

ksaldana1 commented Aug 8, 2017

The tests failed two linting rules that did not get caught in my editor first time around. I closed the PR until I could get back around to fixing them. Will update this PR in a bit to fix the lint rules below.

  22:1   error  Component definition is missing display name  react/display-name
  48:16  error  Component definition is missing display name  react/display-name

I'm actually a little confused by the error tbh. It's trivially fixed with

function renderMessage(pauseInfo: Pause) {
  if (!pauseInfo) {
    return null;
  }

  const message = get(pauseInfo, 'why.message');
  if (message) {
    return (
      <div className={'message'}>
        {message}
      </div>
    );
  }

  const exception = get(pauseInfo, 'why.exception');
  if (exception) {
    return (
      <div className={'message warning'}>
        {renderExceptionSummary(exception)}
      </div>
    );
  }

  return null;
}
renderMessage.displayName = 'whyMessage';

export default function renderWhyPaused({ pause }: { pause: Pause }) {
  const reason = getPauseReason(pause);

  if (!reason) {
    return null;
  }

  return (
    <div className={'pane why-paused'}>
      <div>
        {L10N.getStr(reason)}
      </div>
      {renderMessage(pause)}
    </div>
  );
}
renderWhyPaused.displayName = 'whyPaused';

That felt a little naive, but that's mostly because I didn't fully grok the necessity of the displayName when reading the ESLint rule. If that's an acceptable solution, I'll go ahead and push it up.

@jasonLaster
Copy link
Copy Markdown
Contributor

jasonLaster commented Aug 8, 2017 via email

@jasonLaster
Copy link
Copy Markdown
Contributor

jasonLaster commented Aug 8, 2017

yeah - that's a good solution. I think its the only one too

sorry, i missed your comment earlier

@jasonLaster jasonLaster merged commit 5d4c714 into firefox-devtools:master Aug 9, 2017
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