Skip to content

Conversation

@brianmay
Copy link
Contributor

@brianmay brianmay commented Dec 20, 2024

This was annoying me. I don't think the default is always sensible.

I ran the tests and they passed, but haven't yet tried running the code.

@brianmay
Copy link
Contributor Author

I haven't tried to update the CLI tool, possible that should be updated also. Not sure. Haven't thought that far ahead yet.

@brianmay
Copy link
Contributor Author

Tested this change now using real code and it is working.

@brianmay
Copy link
Contributor Author

Could also replace public_path() to use some environment variable. Might make it easier to work with the CLI that way.

But being able to customize value from application I think is good also.

Copy link
Member

@jkelleyrtp jkelleyrtp left a comment

Choose a reason for hiding this comment

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

Overall looks good but adding the public_path into the signatures is semver breaking.

I think it'd be better to read an env var instead since I'd rather change the public_dir depending on my deploy setup rather than at compile time.

/// }
/// ```
fn serve_static_assets(self) -> Self
fn serve_static_assets(self, pubic_path: &Path) -> Self
Copy link
Member

Choose a reason for hiding this comment

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

Modifying this signature is not semver compatible meaning we wouldn't be able to release this in version 0.6.2.

I think we can add this with a default impl but since DioxusRouterExt is not sealed, any changes to its signature will need to follow semver rules.

https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature

@brianmay
Copy link
Contributor Author

brianmay commented Dec 24, 2024

OK. I must admit I never considered being semver compatible.

Unless any objections, I will revert these changes for one that replaces public_path() with something that reads an environment variable instead. Which is totally fine for my purposes.

@jkelleyrtp jkelleyrtp added this to the 0.6.2 milestone Jan 9, 2025
@jkelleyrtp jkelleyrtp added the cli Related to the dioxus-cli program label Apr 9, 2025
@jkelleyrtp jkelleyrtp merged commit 2c5de0a into DioxusLabs:main Apr 15, 2025
17 checks passed
@brianmay brianmay deleted the cfg_public_path branch April 15, 2025 22:12
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jun 2, 2025
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the dioxus-cli program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants