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

core(lantern): refactor to DevTools modules convention #16071

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Jun 12, 2024

ref #15841

Makes core/lib/lantern/lantern.js the single entry point for all usages of Lantern in Lighthouse, tests, and types.

@connorjclark connorjclark requested a review from a team as a code owner June 12, 2024 21:22
@connorjclark connorjclark requested review from adamraine and removed request for a team June 12, 2024 21:22
import {runTraceEngine} from '../metrics/MetricTestUtils.js';

const {NetworkNode, CPUNode} = Lantern;
const {Simulator, DNSCache} = Lantern.Simulation;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in some places I just do this so as not to fight line length limits

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {BaseNode} from '../BaseNode.js';
import * as Lantern from '../lantern.js';
Copy link
Member

Choose a reason for hiding this comment

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

nit: the old way may still be valid since we're in the lantern/ directory already. Also would this cause any sort of circular dependency situation?

Copy link
Collaborator Author

@connorjclark connorjclark Jun 12, 2024

Choose a reason for hiding this comment

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

ya know, the tests in CDT repo suggest relative imports like that are not preferred, but I do see non-test code doing that. so ok.

i'm not gonna keep spinning the wheels here so I'll keep it like this.

no circular issues here, everything executes fine. you have to be doing circular stuff in the root module scope for that.

@connorjclark connorjclark changed the title core(lantern): refactor to adhere to DevTools modules convention core(lantern): refactor to DevTools modules convention Jun 12, 2024
@connorjclark connorjclark merged commit d438037 into main Jun 12, 2024
26 of 27 checks passed
@connorjclark connorjclark deleted the lantern-modules branch June 12, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants