Skip to content

Convert to ES6 Modules - #19

Merged
camillobruni merged 15 commits into
WebKit:mainfrom
camillobruni:2022-09-19_modules
Oct 31, 2022
Merged

camillobruni merged 15 commits into
WebKit:mainfrom
camillobruni:2022-09-19_modules

Conversation

@camillobruni

@camillobruni camillobruni commented Sep 19, 2022 •

Copy link
Copy Markdown
Contributor
  • Rename files from .js to .mjs (not strictly necessary but it makes clear that we use modules)
  • Pull in missing statistics.js file from https://github.com/WebKit/WebKit/blob/main/PerformanceTests/resources/statistics.js
  • Restructure UI init code to be all in main.mjs
  • Moved free-floating UI code to MainBenchmarkClient
  • Added _isRunning instance variable to MainBenchmarkClient
  • Fix CSS to address removed links
  • Use <button> instead of links for better keyboard navigation

@camillobruni
camillobruni requested a review from rniwa September 19, 2022 14:38
@camillobruni

Copy link
Copy Markdown
Contributor Author

@rniwa I missed your formatting CL. I'll wait for that one to land first.

@camillobruni
camillobruni requested a review from bgrins September 19, 2022 14:41
@bgrins

bgrins commented Sep 19, 2022

Copy link
Copy Markdown
Contributor

Pull in missing statistics.js file

Just for reference, can you link to the source you pulled in for this file?

@juliandescottes juliandescottes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks, overall this looks good to me. There are remaining references to the "logo-link" id to cleanup (I assume this breaks displaying the results?)

Comment thread resources/main.mjs Resolved
@bgrins
bgrins removed their request for review September 20, 2022 21:37
@bgrins

bgrins commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

I trust Julian's reviews, so removing myself

Comment thread index.html Resolved
Comment thread index.html Resolved
Comment thread index.html Resolved
Comment thread resources/tests.mjs Resolved
Comment thread index.html Resolved
Comment thread resources/main.mjs Resolved
Comment thread index.html Resolved
Comment thread index.html Resolved
Comment thread index.html Resolved
Comment thread resources/main.css Resolved
Comment thread resources/main.css

img {
user-select: none;
-webkit-user-select: none;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

user-select seems to not work as expected in Safari 16.0, thus I left this in.

@camillobruni

Copy link
Copy Markdown
Contributor Author

PTAL again

Comment thread resources/main.mjs Resolved
Comment thread resources/main.mjs Resolved
Comment thread resources/main.mjs Resolved
Comment thread resources/main.mjs
document.getElementById('screen-size-warning').style.display = screenIsTooSmall ? null : 'none';
}

_startBenchmarkHandler() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should just call this startBenchmarkHandler. _ prefix doesn't really buy us anything.

@camillobruni camillobruni Oct 12, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed there is no real "protected". Since we do have other _-prefixed methods in the MainBenchmarkClient, how about following one of the following strategies for more consistency:
a) Consistently use _-prefix for "protected" methods that are not referenced from outside the class
b) Drop _ prefix alltogether

- add showAbout method
This was referenced Oct 13, 2022

@rniwa rniwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

r=me

@juliandescottes juliandescottes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, sorry about the delay

Comment thread resources/main.css Resolved
Comment thread resources/main.css Resolved
@camillobruni
camillobruni merged commit 8787833 into WebKit:main Oct 31, 2022
squarewave pushed a commit to squarewave/Speedometer that referenced this pull request Nov 7, 2022
- Rename files from .js to .mjs (not strictly necessary but it makes clear that we use modules)
- Pull in missing statistics.js file from https://github.com/WebKit/WebKit/blob/main/PerformanceTests/resources/statistics.js
- Restructure UI init code to be all in main.mjs
- Moved free-floating UI code to MainBenchmarkClient
- Added `_isRunning` instance variable to MainBenchmarkClient
- Fix CSS to address removed links
- Use `<button>` instead of links for better keyboard navigation in all browsers
@camillobruni
camillobruni deleted the 2022-09-19_modules branch November 30, 2022 18:29
bgrins pushed a commit to bgrins/Speedometer that referenced this pull request Jun 23, 2023
Address PR comments.
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.

4 participants