spinframework / spinframework/spin
Enable mustache-inspired string templates for `key_value_stores` and others
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
I'm building a Spin App that consists of multiple components:
# ...
[component.a]
source = "a/target/wasm32-wasi/release/a.wasm"
key_value_stores = ["data"]
[component.b]
source = "b/target/wasm32-wasi/release/b.wasm"
key_value_stores = ["data"]
# ...
Instead of providing the magic string (name of the desired key-value store) 4 times (twice as part of key_value_stores and once per component), I would want to use mustache-inspired string templates as illustrated here:
#...
[variables]
store = { default = "data" }
[component.a]
source = "a/target/wasm32-wasi/release/a.wasm"
key_value_stores = ["{{ store }}"]
[component.a.variables]
store = "{{ store }}"
[component.b]
source = "b/target/wasm32-wasi/release/b.wasm"
key_value_stores = ["{{ store }}"]
[component.b.variables]
store = "{{ store }}"
# ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the TOML examples in the issue and trace how variables, key_value_stores, and component variables are currently represented and resolved. Done means a shared variable such as store can be used in those fields with mustache-inspired syntax, while preserving the existing configuration behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100