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

Serve the new web client instead of the old one. #522

Merged
merged 15 commits into from
Jul 11, 2024

Conversation

chris-dietz
Copy link
Collaborator

In addition ensure that trunk is installed and use trunk to build the web client from source automatically.

@chris-dietz chris-dietz requested a review from ia0 as a code owner July 3, 2024 20:15
@chris-dietz
Copy link
Collaborator Author

I think the CI is broken at the head of dev/web-ui. Not sure what the best way of fixing that is, I don't want to clutter up this PR pulling in commits from main to fix it. Do you have a way to rebase/merge the dev/web-ui branch from main? I don't think I have the ability to do that anyways.

ia0
ia0 previously approved these changes Jul 4, 2024
Copy link
Member

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

I've merged main into dev/web-ui and updated your branch. You should pull before fixing the 2 CI failures.

crates/runner-host/Cargo.toml Outdated Show resolved Hide resolved
crates/runner-host/src/main.rs Outdated Show resolved Hide resolved
crates/runner-host/src/main.rs Outdated Show resolved Hide resolved
Copy link
Member

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

Thansk! LGTM

crates/runner-host/src/main.rs Outdated Show resolved Hide resolved
crates/runner-host/src/main.rs Outdated Show resolved Hide resolved
scripts/wrapper.sh Show resolved Hide resolved
crates/runner-host/src/main.rs Outdated Show resolved Hide resolved
Copy link
Member

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

Thanks! I'm gonna test some applets and merge.

scripts/wrapper.sh Show resolved Hide resolved
@ia0
Copy link
Member

ia0 commented Jul 11, 2024

LGTM, it's gonna take some time to pass the CI because it needs to build trunk. I hope it will get cached after the merge. I didn't test this with a development branch yet.

@ia0 ia0 merged commit 71a1466 into google:dev/web-ui Jul 11, 2024
18 checks passed
@ia0
Copy link
Member

ia0 commented Jul 11, 2024

I guess now only the esthetic aspects remain right? Or do you see other technical aspects?

@chris-dietz chris-dietz deleted the web-client-rs branch July 11, 2024 18:17
@chris-dietz
Copy link
Collaborator Author

I guess now only the esthetic aspects remain right? Or do you see other technical aspects?

Yeah I believe it's functionality is identical to the existing web client now other than aesthetics.

The only other thing I might want to do is see if I can add some tests, but I'm not sure the best way to go about that with yew. The page on testing is sparse to say the least
https://yew.rs/docs/more/testing

The existing web frontend wasn't tested either though so I don't think it would be a regression to replace it with this even if I can't find a good way of testing it.

But yeah, overall I think I just need to add some CSS styling and it will be pretty much good to go.

@ia0
Copy link
Member

ia0 commented Jul 11, 2024

Tests are a good idea, but as you mentioned, not a regression. Also testing UIs is usually much harder than testing logic, so I wouldn't worry about it, but feel free to explore this direction if it's something that interests you.

To merge this development branch in main, some CSS is probably enough indeed. Then there's also the automatic websocket reconnection when the server dies, but maybe a manual reload is fine for now (or just opening a new window).

@chris-dietz
Copy link
Collaborator Author

To merge this development branch in main, some CSS is probably enough indeed. Then there's also the automatic websocket reconnection when the server dies, but maybe a manual reload is fine for now (or just opening a new window).

Sg, also I believe it recovers from the server going down already. The thing that doesn't quite seem to work is the web server seems to not realize the client is already open and tries to open a new tab anyways. I'm not quite sure the reason why but if you comment out the lines opening the browser it recovers like it's supposed to.

I'll have to look into that more closely.

@ia0
Copy link
Member

ia0 commented Jul 12, 2024

Sg, also I believe it recovers from the server going down already. The thing that doesn't quite seem to work is the web server seems to not realize the client is already open and tries to open a new tab anyways. I'm not quite sure the reason why but if you comment out the lines opening the browser it recovers like it's supposed to.

This seems to be because the web-socket retries to connect every 3 seconds instead of every second. The web server waits 2 seconds before opening a new window, so there's some chances that the web client won't connect in that timeframe. Instead of using use_websocket() you need to use use_websocket_with_options() and set reconnect_interval to 1000. This could be its own PR.

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