Skip to content

refactor: split report-renderer into multiple files#1987

Merged
patrickhulce merged 4 commits intomasterfrom
split_renderers
Apr 12, 2017
Merged

refactor: split report-renderer into multiple files#1987
patrickhulce merged 4 commits intomasterfrom
split_renderers

Conversation

@patrickhulce
Copy link
Copy Markdown
Collaborator

@patrickhulce patrickhulce commented Apr 10, 2017

In preparation for introducing tags/grouped audit renderers the report-renderer.js started getting unwieldy. This splits it into 3 files DOM, DetailsRenderer, and ReportRenderer.

I know @brendankenny had Eric kill DOM but c'mon having these duplicated everywhere is bad and the class allows for easy test injection. I'll split up the test files too, but currently it conflicts with @ebidel's PR and figured I'd wait before I get too far.

@paulirish
Copy link
Copy Markdown
Member

works for me

@ebidel
Copy link
Copy Markdown
Contributor

ebidel commented Apr 11, 2017

Works for me too. You know I love that DOM.

@ebidel
Copy link
Copy Markdown
Contributor

ebidel commented Apr 12, 2017

@patrickhulce you good on this? I don't want to get too deep and have rebase nightmares.

@patrickhulce
Copy link
Copy Markdown
Collaborator Author

yep I'm ready if you are!

module.exports = DetailsRenderer;
}

/** @typedef {{type: string, text: string|undefined, header: DetailsJSON|undefined, items: Array<DetailsJSON>|undefined}} */
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.

this won't work (it's scoped to the module like regular variables). I believe you can put it on DetailsRenderer, but then it'll have to be referred to as DetailsRenderer.DetailsJSON in report-renderer.js

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.

although you can wait on that, because these are broken anyways (no non-null and I believe union types need parens when nested like this)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Contributor

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

reorg LGTM

@patrickhulce patrickhulce merged commit 605a457 into master Apr 12, 2017
@patrickhulce patrickhulce deleted the split_renderers branch April 12, 2017 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants