Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

followup for issues in #2000 #2100

Merged
merged 1 commit into from
Apr 29, 2017
Merged

followup for issues in #2000 #2100

merged 1 commit into from
Apr 29, 2017

Conversation

brendankenny
Copy link
Member

also update closure for mid-month release

@paulirish this will hopefully make #2099 a bit smoother

also update closure for mid-month release
'report/v2/renderer/*.js',
])

// Ignore `module.exports` and `self.ClassName = ClassName` statements.
.pipe(replace(/^\s\smodule\.exports = \w+;$/gm, ';'))
.pipe(replace(/^\s\sself\.(\w+) = \1;$/gm, ';'))

// Remove node-specific code from file-namer so it can be included in report.
Copy link
Member Author

Choose a reason for hiding this comment

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

kind of dumb to do such a custom solution for just this file, but since this is the only file that's completely intended to live in both node and the browser (all the other renderer files are only used in node for testing), I went with it. If/when we have more files that need to live in both worlds we can add a more general solution.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

fine by me

@@ -64,7 +64,7 @@ class ReportUIFeatures {
* Fires a custom DOM event on target.
* @param {string} name Name of the event.
* @param {!Node=} target DOM node to fire the event on.
* @param {Object<{detail: Object<string, *>}>=} detail Custom data to include.
* @param {*=} detail Custom data to include.
Copy link
Collaborator

@patrickhulce patrickhulce Apr 29, 2017

Choose a reason for hiding this comment

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

😱

(just kidding)

Copy link
Member Author

Choose a reason for hiding this comment

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

hehe, that's what it really is! https://dom.spec.whatwg.org/#dictdef-customeventinit

dictionary CustomEventInit : EventInit {
  any detail = null;
};

'report/v2/renderer/*.js',
])

// Ignore `module.exports` and `self.ClassName = ClassName` statements.
.pipe(replace(/^\s\smodule\.exports = \w+;$/gm, ';'))
.pipe(replace(/^\s\sself\.(\w+) = \1;$/gm, ';'))

// Remove node-specific code from file-namer so it can be included in report.
.pipe(replace(/^\s\smodule\.exports = {\w+};$/gm, ';'))
Copy link
Member

Choose a reason for hiding this comment

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

happens to not match the module.exports line in the renderer files:

module.exports = ReportRenderer;

but yah this seems to be the right solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

that should be caught by the existing.pipe(replace(/^\s\smodule\.exports = \w+;$/gm, ';')) above.

I also turned module.exports to write-only, so anything that ends up tricking the regexes will fail the compile :)

Copy link
Member Author

Choose a reason for hiding this comment

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

write-only

by which I obviously mean read-only

@paulirish paulirish merged commit 11957a0 into master Apr 29, 2017
@paulirish paulirish deleted the fix2000 branch April 29, 2017 00:14
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.

3 participants