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

Add a %svelte.version% template placeholder to propagate the current kit.version.name to app.html #12130

Open
potch opened this issue Apr 16, 2024 · 2 comments · May be fixed by #12132
Open

Comments

@potch
Copy link

potch commented Apr 16, 2024

Describe the problem

We use git SHA for our versions across our apps, and pass those versions to third-party analytics services like Datadog. Several of these providers can be largely configured as static <script> tags in our app.html, but we'd like to be able to include the current version as well.

Describe the proposed solution

We're passing the version string as recommended in the version docs and would like if that version string was available as an HTML placeholder, e.g. %svelte.version%.

Alternatives considered

We've looked at doing our own HTML templating as part of hooks.server, as well as duplicating the version string into PUBLIC_VERSION which we could then access via %svelte.env.PUBLIC_VERSION% but if it's reasonable/straightforward to propagate the version via template placeholders it would be great ergonomics

Importance

nice to have

Additional Information

No response

@Conduitry
Copy link
Member

Is there a reason to do this via an app.html template replacement as opposed to a tag inserted by a top-level +layout.svelte file?

@potch
Copy link
Author

potch commented Apr 16, 2024

Is there a reason to do this via an app.html template replacement as opposed to a tag inserted by a top-level +layout.svelte file?

Usually third-party script includes are otherwise static and not "application aware", but in general it's an ergonomic convenience.

@potch potch linked a pull request Apr 16, 2024 that will close this issue
6 tasks
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 a pull request may close this issue.

2 participants