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

Track locales files in proc macro #93

Merged
merged 6 commits into from
Feb 9, 2024
Merged

Conversation

Baptistemontan
Copy link
Owner

Add the use of the path tracking api to help with cargo-leptos watch.

Before if you added watch-additional-files = ["locales"] in you manifest for watching the locales, the build system would not see the translations files as dependencies and would not rerun the load_locales! macro, now if you use nightly the macro will add those files as a dependencies and would rerun when then changes. Unfortunately this API is unstable (pretty bad API for the moment to be honnest) so it is only enabled with the "nightly" feature.

@Baptistemontan
Copy link
Owner Author

There seams to be a work around in stable by using include_bytes! to track files on stable: SOF3/include-flate#13, but I'm a bit sceptical of the performance impact of including every translations files so I will implement it under an optionnal feature.

@Baptistemontan Baptistemontan changed the title Track locales files in proc macro (nightly only) Track locales files in proc macro Jan 31, 2024
@Baptistemontan
Copy link
Owner Author

Baptistemontan commented Jan 31, 2024

Added the track_locale_files feature to enable file tracking in stable, but I'm not sure about the performance impact on build time so I won't put it by default.

@Baptistemontan
Copy link
Owner Author

close #86 and relevant to #90

@Baptistemontan Baptistemontan merged commit 7e3f1bd into master Feb 9, 2024
15 checks passed
@Baptistemontan Baptistemontan deleted the track_locales_files branch February 13, 2024 08:58
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.

1 participant