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

Move renderer bundle (for devtools) to use ES module exports #11628

Closed
TimvdLippe opened this issue Nov 4, 2020 · 3 comments
Closed

Move renderer bundle (for devtools) to use ES module exports #11628

TimvdLippe opened this issue Nov 4, 2020 · 3 comments

Comments

@TimvdLippe
Copy link
Contributor

I am working on trying to run TypeScript on the front_end/lighthouse files in DevTools, but I am running into several problems. Most prominently, LightHouse puts several types on the global scope, such as ReportRenderer and ReportUIFeatures (see the declarations in https://source.chromium.org/chromium/chromium/src/+/master:third_party/devtools-frontend/src/front_end/lighthouse/LighthouseReporterTypes.js;l=28-30;drc=1e10f8546c3cd94438e2046711e302a9dc771394)

To make consumption easier for DevTools and potentially improve tree-shaking and all, could we consider changing the way LightHouse exports symbols to use ES exports instead? E.g. rather than putting symbols on the global scope, make them export class definitions that DevTools can then import. This should be possible, now that LightHouse is bundled and several other infrastructure improvements have been made on the DevTools side.

@paulirish paulirish changed the title Change DevTools bundle to use ES module exports Change DevTools renderer bundle to use ES module exports Nov 10, 2020
@paulirish paulirish changed the title Change DevTools renderer bundle to use ES module exports Move renderer bundle (for devtools) to use ES module exports Nov 10, 2020
@paulirish
Copy link
Member

After discussion: we plan to change our bundling so that we'll expose the renderer/report-generator via a ESM export. We'll do this with some clever concat/bundling but not converting our renderer source files to ESM (yet).

devtools-bot pushed a commit to ChromeDevTools/devtools-frontend that referenced this issue Nov 18, 2020
Note that we are blocked on GoogleChrome/lighthouse#11628
to fully run TypeScript on this file.

[email protected]

Bug: 1011811
Change-Id: I475d7c80c366f9599b695f6a4e961117ae363391
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2547288
Commit-Queue: Tim van der Lippe <[email protected]>
Auto-Submit: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
@paulirish
Copy link
Member

@connorjclark
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants