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

Update domprops from FF and Chrome: Is this how? #811

Merged
merged 1 commit into from Sep 3, 2020
Merged

Update domprops from FF and Chrome: Is this how? #811

merged 1 commit into from Sep 3, 2020

Conversation

kirbysayshi
Copy link
Contributor

@kirbysayshi kirbysayshi commented Sep 2, 2020

Hello!

I noticed that some properties of the TextMetrics API were being mangled (actualBoundingBoxAscent, actualBoundingBoxDescent). They aren't present in domprops.js, so I:

  • executed the domprops html in both Firefox and Chrome
  • copy/paste merged with existing domprops.js
  • sorted using pbpaste | sort -u (note: VSCode does not sort lines correctly...)

Are these roughly the steps to update this list? Is there another way? If so, let me know and I'll update this PR. I'm not very familiar with terser's testing conventions, but I've done what I could to get the tests to pass. Not sure if these changes should be expected or not.

Sidenote: when I tried running the tests (and even the commit hook) locally, I received and ESM error in node 12.16.1. I didn't look too deeply into this, but wanted to mention it as it definitely hindered testing before creating this PR. Error below:

internal/modules/cjs/loader.js:1174
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/drew/GIT/terser/test/compress.js
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1174:13)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'ERR_REQUIRE_ESM'
}

@kirbysayshi kirbysayshi changed the title Update domprops from FF 82.0a1: but how? Update domprops from FF and Chrome: Is this how? Sep 2, 2020
@kirbysayshi kirbysayshi marked this pull request as ready for review September 2, 2020 23:39
@fabiosantoscode
Copy link
Collaborator

Hello there!

Yes, this is exactly how it's done and that script hasn't been run in years.

Development of Terser requires node 14. I guess I'll add this to CONTRIBUTING.md

@fabiosantoscode fabiosantoscode merged commit a7c1673 into terser:master Sep 3, 2020
@fabiosantoscode
Copy link
Collaborator

Thank you very much!

@kirbysayshi
Copy link
Contributor Author

Development of Terser requires node 14. I guess I'll add this to CONTRIBUTING.md

Nice to know! Thanks for accepting!

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.

None yet

2 participants