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

convert to ES modules #354

Merged
merged 2 commits into from
Jul 29, 2022
Merged

convert to ES modules #354

merged 2 commits into from
Jul 29, 2022

Conversation

connorjclark
Copy link
Collaborator

Lighthouse 10.0 will be ES modules (#12689) which will require plugins to be ES modules too. Here's a PR that updates everything in this repo to ES modules.

@connorjclark connorjclark force-pushed the esm branch 2 times, most recently from d719ca8 to 72de11d Compare July 26, 2022 22:51
@connorjclark
Copy link
Collaborator Author

re: failures

  • I get the same smoke failure on main.
  • LHCI doesn't support es modules, yet.

@connorjclark
Copy link
Collaborator Author

Confirmed working with GoogleChrome/lighthouse#14241

@@ -70,7 +71,7 @@ const HEADINGS = [
class AdBlockingTasks extends Audit {
/**
* @return {LH.Audit.Meta}
* @override
* /override This member cannot have a JSDoc comment with an '@override' tag because its containing class ... does not extend another class.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove these comments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I'll remove the entire line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BTW I'm not sure why this error occurs now, but it didn't seem worth the effort to figure it out.

@@ -1,3 +1,5 @@
// LHCI currently does not support .cjs, so generate a json config with:
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for keeping this file if unsupported? Any issue with just keeping the json file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just that .cjs is easier to author, and it is on my backlog to update LHCI to support ESM config/at least support .cjs and then I'll come back and delete the JSON here.

I can do as you suggest if you'd prefer.

package.json Outdated
@@ -21,13 +22,15 @@
"dependencies": {
"@tusbar/cache-control": "^0.3.1",
"@types/esprima": "^4.0.2",
"lighthouse": "^8.6.0",
"lighthouse": "next",
Copy link
Contributor

Choose a reason for hiding this comment

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

I worry that if there are breaking changes they will no longer be version tied, and older versions will fail to work. Does this seem like a reasonable concern?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll change this to a specific nightly version. And modify again when 10.0 is actually released, ~Sept.

If you'd rather not cut an actual release to npm, that'd be fine. We can always tie Lighthouse's version of pubads to a branch or specific commit during the transition.

@jburger424
Copy link
Contributor

jburger424 commented Jul 29, 2022

re: failures

  • I get the same smoke failure on main.
  • LHCI doesn't support es modules, yet.

@connorjclark The smoke test seems to be flaky, trying to see if rerunning works. But I've gone ahead and temporarily remove LHCI from the required actions list.

@jburger424
Copy link
Contributor

LGTM, I think best to wait for a stable LH dependency before cutting a new prod release.

@jburger424 jburger424 merged commit 8073f1c into googleads:main Jul 29, 2022
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.

2 participants