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: address a few esmodule TODOs #14258

Merged
merged 4 commits into from
Aug 16, 2022
Merged

misc: address a few esmodule TODOs #14258

merged 4 commits into from
Aug 16, 2022

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Aug 2, 2022

This PR is meant to be merged without squashing.

Going through some of the TODO(esmodules) comments, each commit here addresses a separate thing (so you should view each commit in isolation)

EDIT: converted to draft, a few unexpected test failures to dig through first

@connorjclark connorjclark requested a review from a team as a code owner August 2, 2022 23:16
@connorjclark connorjclark requested review from brendankenny and removed request for a team August 2, 2022 23:16
@connorjclark
Copy link
Collaborator Author

connorjclark commented Aug 2, 2022

For some reason I can't get locales to work with a locally built devtools (only english is shown for all of devtools, not related to these changes). Should port the now-removed i18n test to e2e first before merging this.

@connorjclark connorjclark marked this pull request as draft August 2, 2022 23:29
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
// TODO(esmodules): included to support require('file.json'). Remove on the switch to ES Modules.
"resolveJsonModule": true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have a number of @type comments that import json files for a type.

delimiters: ['', ''],
values: {
'getModuleDirectory(import.meta)': '""',
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

inline-fs replaces the entire expression using moduleDir anyway, so this doesn't matter ... except to remove invalid syntax/code from the bundled result. Ideally, a bundler would drop const moduleDir = ... entirely (and the import of getModuleDirectory entirely, since unused) ... but rollup isn't doing that for us. Maybe esbuild would :)

Or maybe it just need some sort of pure comment? idk. for now, easier to just rip it out like this.

@@ -52,11 +51,26 @@ async function main() {
],
javascripts: [
reportGeneratorJs,
'window.ReportGenerator = window.ReportGenerator.ReportGenerator',
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a TODO to remove this for #13429

@connorjclark connorjclark changed the title address a few esmodule TODOs misc: address a few esmodule TODOs Aug 16, 2022
@connorjclark connorjclark merged commit 6c04777 into master Aug 16, 2022
@connorjclark connorjclark deleted the todo-esm branch August 16, 2022 20:00
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