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

misc(build): shim fs out of lightrider report generator bundle #14098

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

brendankenny
Copy link
Member

from my too-late comment in #14031. We shim fs this way for the standalone report umd bundle, can do the same thing here. Still a workaround, but a little less finicky.

@brendankenny brendankenny requested a review from a team as a code owner June 7, 2022 21:07
@brendankenny brendankenny requested review from connorjclark and removed request for a team June 7, 2022 21:07
Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

works for me.

@connorjclark
Copy link
Collaborator

Does someone need to confirm it works when improving to google3?

@brendankenny
Copy link
Member Author

Probably smart, but FWIW here's the diff from the current version:

diff --git a/dist/lightrider/report-generator-bundle.js b/report-generator-bundle.js
index 1627f073c..3a507a5e9 100644
--- a/dist/lightrider/report-generator-bundle.js
+++ b/dist/lightrider/report-generator-bundle.js
@@ -1,5 +1,8 @@
-var ReportGenerator = (function () {
-	'use strict';
+(function (global, factory) {
+	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+	typeof define === 'function' && define.amd ? define(factory) :
+	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ReportGenerator = factory());
+}(this, (function () { 'use strict';
 
 	function getAugmentedNamespace(n) {
 		if (n.__esModule) return n;
@@ -224,6 +227,4 @@ var ReportGenerator = (function () {
 
 	return reportGenerator;
 
-}());
-
-window.ReportGenerator = ReportGenerator;
+})));

no require('fs')

@paulirish
Copy link
Member

paulirish commented Jun 8, 2022

Does someone need to confirm it works when improving to google3?

yes. i was being lazy but.. yes.

anyway, just tried it

did a cherrypick of 36787c6 on top of the 961branch thats in use there.

ran the renderer tests and also built lr:app. while the latter would break (before #14031 and stuff), it's good here (again).

🔒 http://go/wahgd 👍

@connorjclark connorjclark changed the title misc: shim fs out of lightrider report generator bundle misc(build): shim fs out of lightrider report generator bundle Jun 8, 2022
@connorjclark connorjclark merged commit 4574943 into master Jun 8, 2022
@connorjclark connorjclark deleted the lr-bundle-fs branch June 8, 2022 18:45
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