better handling of environment variables? #6

Closed
opened 5 years ago by mbutterick · 5 comments
mbutterick commented 5 years ago (Migrated from github.com)

I’m working on a project where I’d like to use mutiple environment variables (not just POLLEN). You don’t need Pollen’s permission to do this, but ordinarily the cache only tracks the value of the POLLEN variable itself, so if you use others, the cache will not be invalidated correctly (assuming that the other environment variables affect the output).

I’m thinking of adding pollen/setup value — let’s call it envvar-watchlist — that would allow a project to specify the environment variables that matter. (Simply looking at all the environment variables is not a good policy.)

Thoughts? Objections? Improvements?

I’m working on a project where I’d like to use mutiple environment variables (not just `POLLEN`). You don’t need Pollen’s permission to do this, but ordinarily the cache only tracks the value of the `POLLEN` variable itself, so if you use others, the cache will not be invalidated correctly (assuming that the other environment variables affect the output). I’m thinking of adding `pollen/setup` value — let’s call it `envvar-watchlist` — that would allow a project to specify the environment variables that matter. (Simply looking at all the environment variables is not a good policy.) Thoughts? Objections? Improvements?
sorawee commented 5 years ago (Migrated from github.com)

I'd love this feature! If possible, I'd also love a feature that enables Racket file that calls render to communicate Racket values to Pollen files that are being rendered -- though I understand if that's not possible. Dealing with namespaces is hard.

I'd love this feature! If possible, I'd also love a feature that enables Racket file that calls `render` to communicate Racket values to Pollen files that are being rendered -- though I understand if that's not possible. Dealing with namespaces is hard.
mbutterick commented 5 years ago (Migrated from github.com)

I'd also love a feature that enables Racket file that calls render to communicate Racket values to Pollen files that are being rendered

Can you give me an example?

> I'd also love a feature that enables Racket file that calls `render` to communicate Racket values to Pollen files that are being rendered Can you give me an example?
mbutterick commented 5 years ago (Migrated from github.com)

BTW I’ve now pushed an update with envvar-watchlist:

(define envvar-watchlist '("PUB"))
BTW I’ve now pushed an update with `envvar-watchlist`: ``` (define envvar-watchlist '("PUB")) ```
sorawee commented 5 years ago (Migrated from github.com)

Can you give me an example?

Someone asks in the Slack channel a few months ago about this. Pretty much, s/he wants to render twice, each with different parameter. Trying to mutate variables doesn't work because they live in different namespace. The final solution we came up with is using environment variables, but being able to use Racket values are obviously better and less restrictive than using environment variables.

(The Slack post was gone due to Slack limitation)

> Can you give me an example? Someone asks in the Slack channel a few months ago about this. Pretty much, s/he wants to render twice, each with different parameter. Trying to mutate variables doesn't work because they live in different namespace. The final solution we came up with is using environment variables, but being able to use Racket values are obviously better and less restrictive than using environment variables. (The Slack post was gone due to Slack limitation)
mbutterick commented 5 years ago (Migrated from github.com)

Someone asks in the Slack channel a few months ago about this … The Slack post was gone

Well if they come back and post a question here, I will look into it. Otherwise I can only speculate …

> Someone asks in the Slack channel a few months ago about this … The Slack post was gone Well if they come back and post a question here, I will look into it. Otherwise I can only speculate …
This repo is archived. You cannot comment on issues.
Loading…
There is no content yet.