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): move NetworkRequest to lib/dependency-graph #15842

Closed
wants to merge 3 commits into from

Conversation

connorjclark
Copy link
Collaborator

ref #15841

NetworkRequest is used to model the network inside the Lantern graph and simulator. Instead of attempting to recreate a very similar interface that continues to meet the needs of all our use cases in Lighthouse, let's just move the entire NetworkRequest to lantern. Consumers of the library will need to create these on their own to make a graph, and how they do that (CDT logs or trace) is irrelevant.

We may possibly revisit the network interface in Lantern down the line.

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

import * as LH from '../../../types/lh.js';
Copy link
Member

Choose a reason for hiding this comment

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

Nice

@@ -5,6 +5,7 @@
*/

import * as LH from '../../../../types/lh.js';
import {NetworkRequest} from '../network-request.js';
Copy link
Member

@adamraine adamraine Feb 29, 2024

Choose a reason for hiding this comment

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

Would /** @typedef {import('../network-request.js').NetworkRequest} NetworkRequest */ also work? I would prefer that to getting all these "unused" imports and then ignoring the eslint rule.

LH only needed a physical import because LH is a module and jsdoc doesn't support that (yet). NetworkRequest is an actual type that we can assign using jsdoc.

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.

None yet

3 participants