-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: allow access to public env in app.html #8449
feat: allow access to public env in app.html #8449
Conversation
🦋 Changeset detectedLatest commit: 30b353b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! To finish this, you need to add the same logic to build_server.js
where the app_template
function is built for the production build. I'd hold off from doing this though because Rich is currently refactoring that part of the app in #8429 - best wait until he's done with that.
Thanks @dummdidumm @benmccann I have subscribed to that PR and will update this one when that's merged in 😃 |
Co-authored-by: Simon H <[email protected]>
Co-authored-by: Simon H <[email protected]>
3f3ef5a
to
2315698
Compare
thank you! |
…Kit (#184) Après le passage de SvelteKit de 1.0.0 en 1.5.2, Chrome reportait des erreurs de Content-Length systématiques, qui bloquaient le reste du chargement. Le changement en cause: sveltejs/kit#8371 SvelteKit, depuis la version 1.2.0, rajoute un en-tête Content-Length à la réponse, or dans https://github.com/betagouv/dora-front/blob/571f7b9033510dec8acd362c8825650c755fc5c7/src/hooks.server.ts#L34 on réécrivait le contenu sans mettre à jour sa taille. Depuis 1.2.0, il est également possible d'accéder aux variables d'environnement directement dans le app.html, ce qui était la raison de la réécriture jusque là: sveltejs/kit#8449 Cette PR remplace donc l'ancien mécanisme de réécriture par l'officiel.
closes #8427
This PR is to enable access to public env variables within
app.html
at render-time.An example of this being useful would be the insertion of a public api key into a
<script>
based upon the deploy environment configuration.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0