Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

allow picking a renderer using a query parameter#691

Merged
guidezpl merged 4 commits intomainfrom
dynamic-renderer
May 19, 2022
Merged

allow picking a renderer using a query parameter#691
guidezpl merged 4 commits intomainfrom
dynamic-renderer

Conversation

@yjbanov
Copy link
Contributor

@yjbanov yjbanov commented May 18, 2022

Adding ?renderer=html or ?renderer=canvaskit in the URL will select the respective renderer instead of picking one automatically.

@yjbanov yjbanov requested a review from clocksmith May 18, 2022 22:15
Copy link

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

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

LGTM

@yjbanov yjbanov requested review from ditman and harryterkelsen May 18, 2022 23:18
Copy link

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

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

LGTM

web/index.html Outdated
Comment on lines +37 to +39
let query = window.location.search;
if (query) {
let searchParams = new URLSearchParams(query);
Copy link
Member

Choose a reason for hiding this comment

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

URLSearchParams seems to support a nullable string passed in, so you could potentially just do:

let searchParams = new URLSearchParams(window.location.search);
if (searchParams.has('renderer') {
  ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@guidezpl
Copy link
Member

@guidezpl guidezpl merged commit c4708eb into main May 19, 2022
@guidezpl guidezpl deleted the dynamic-renderer branch May 19, 2022 06:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants