Enable Speedometer to use an external config.json file#515
Conversation
✅ Deploy Preview for webkit-speedometer-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
julienw
left a comment
There was a problem hiding this comment.
I didn't test fully locally and I think I don't get the full picture yet, but here is a first set of comments.
cb77ab0 to
0f511fe
Compare
julienw
left a comment
There was a problem hiding this comment.
Thanks, this looks better.
I still see a small moment at load time where the button is inactive, but this was present before the patch too. Probably because we wait for DOMContentLoaded before calling init/prepareUI. We miught not need this waiting for DOMContentLoaded actually, because we're in a script loaded with type="module"that is always defered. But that's work for another patch IMO.
|
@rniwa - following up, if we're good with the pr. |
|
|
||
| try { | ||
| const urlObject = new URL(url, "http://www.example.com"); | ||
| return urlObject.pathname.toLowerCase().endsWith(".json"); |
There was a problem hiding this comment.
This isn't necessarily required, right? You can have other file extensions or no file extension at all with Content-Type: application/json.
There was a problem hiding this comment.
correct, is this a blocker?
There was a problem hiding this comment.
I'd rather not have arbitrary rule enforced on a filename.
There was a problem hiding this comment.
removed the extension check
rniwa
left a comment
There was a problem hiding this comment.
r=me assuming my comments will be addressed.
This pr sets up Speedometer to use an optional
configurl param, to assign different workloads / tests to use with the benchmark.The initial config.json enables the news site next workload, which is currently the only workload that opted into the postMessage api for it's experimental version. The test name in the config is optional, if the default tests are targeted.
The new `data-provider' checks an allowed list of external urls that the workloads can be pulled in from. Currently this just houses the netlify preview folder.
Other changes:
the
suitesandtagsare not global anymore and thedata-provideris the source of truth. This is to ensure that thedata-providercan process the suites / tests, prior to running speedometer in any mode.news-site dist folder changed, since I had to run the
buildagain, after updating shared files from the benchmark.Preview with config assigned:
https://deploy-preview-515--webkit-speedometer-preview.netlify.app/?config=https://deploy-preview-515--webkit-speedometer-preview.netlify.app/resources/config.json