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

Add Trunk.toml and make urls relative. #90

Merged
merged 4 commits into from
Dec 30, 2023
Merged

Add Trunk.toml and make urls relative. #90

merged 4 commits into from
Dec 30, 2023

Conversation

kaydensigh
Copy link
Contributor

This enables IDEs to live preview dist/index.html without any extra config (since they usually default to serving the whole repo).

It also allows the template to work as-is on itch.io and any other services that serve the package under some path.

This enables IDEs to live preview `dist/index.html` without any extra config (since they usually default to serving the whole repo).

It also allows the template to work as-is on itch.io and any other services that serve the package under some path.
Copy link
Owner

@NiklasEi NiklasEi left a comment

Choose a reason for hiding this comment

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

Hey, thank you for this. I remember, that I had issues with itch hosting back in the day and failed to find a working trunk configuration. I ended up doing some sed stuff in CI which could now be removed: https://github.com/NiklasEi/bevy_game_template/blob/main/.github/workflows/release.yaml#L201

Copy link
Owner

@NiklasEi NiklasEi left a comment

Choose a reason for hiding this comment

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

The web build renders fine for me in the IDE now, but inputs don't seem to work. Do they work for you?

If there is anything to fix about input handling that could be done separately. I am happy to get rid of the sed scripts 👍

@NiklasEi NiklasEi merged commit d50ecba into NiklasEi:main Dec 30, 2023
5 checks passed
@kaydensigh
Copy link
Contributor Author

Do you mean keyboard and mouse inputs? Which IDE do you see this in? (Maybe we should move this to an issue).

I've only been using RustRover's built-in server, which always opens in your default browser. On VS Code, the ritwickdey.LiveServer extension also opens on default browser. ms-vscode.live-server opens in a panel, but mouse seems to work. My guess would be any preview that displays inside the IDE might have some inputs captured by the IDE itself.

BTW thanks for the reviews and for putting together this template; it's super useful to folks like myself who are new to Bevy and Rust 😁

@kaydensigh kaydensigh deleted the relative_path branch December 31, 2023 09:06
@NiklasEi
Copy link
Owner

I tested it in RustRover and IntelliJ. Opening it in a browser is fine and keyboard inputs work.

I was testing it inside the IDE itself and that's when the inputs stop working. They seem to be captured by the preview (the canvas gets marked), but Bevy doesn't get them.

I don't think we need an issue for it, since it works in browsers. Seems like in issue of the IDEs.

@NiklasEi NiklasEi mentioned this pull request Jan 14, 2024
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