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

Rewrite from proc-macro to build.rs #15

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

marlonbaeten
Copy link
Member

The current implementation uses a proc-macro. This macro is not expanded in incremental builds. This causes changes in the static asset directory to not show up in the binary.

This proposed change drops the load_assets! macro and introduces a build script for the memory-serve crate. The build script takes an environment variable to load assets from. Any changes in the path defined by ASSET_DIR or changes to the variable itself will trigger a rerun and will load fresh assets.

Note that this will be a breaking change:

MemoryServe::new(load_assets!("static"))

Becomes:

MemoryServe::new()

And the ASSET_DIR environment variable will be required.

This PR also ships some improvements to logging and improves build performance.

README.md Outdated Show resolved Hide resolved
memory-serve/build.rs Show resolved Hide resolved
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