Skip to content

chore: generate the env modules in a single pass - #16833

Open
Nic-Polumeyv wants to merge 2 commits into
version-3from
env-generator-dedup
Open

chore: generate the env modules in a single pass#16833
Nic-Polumeyv wants to merge 2 commits into
version-3from
env-generator-dedup

Conversation

@Nic-Polumeyv

@Nic-Polumeyv Nic-Polumeyv commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

core/env.js had one generator per <sveltekit:generated>/env/* module, each iterating the same variables and calling validate() on the same static values, so a user's schema ran three to four times per build (and per hot update in dev), and a validator that isn't a pure function of its input baked different values into config.js, public/server.js and public/client.js.

create_env_modules replaces them with a single pass over the variables that returns every module keyed by path, so the plugin only writes files. Dynamic variables are untouched; they were already validated once by set_env.

One visible change: invalid variables that previously surfaced one module at a time are now reported in a single error.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 17, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 5f75e64:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/5f75e6400c6089ac0c791f0a2075605c5cafae5b

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16833

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5f75e64

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@svelte-docs-bot

Copy link
Copy Markdown

@Nic-Polumeyv
Nic-Polumeyv marked this pull request as draft August 17, 2026 19:41
@Nic-Polumeyv Nic-Polumeyv changed the title chore: merge public and private env module generators chore: merge the duplicated env module generators Aug 19, 2026
@Nic-Polumeyv Nic-Polumeyv changed the title chore: merge the duplicated env module generators fix: generate the env modules in one pass so each inlined value is validated once Aug 19, 2026
@Nic-Polumeyv Nic-Polumeyv changed the title fix: generate the env modules in one pass so each inlined value is validated once chore: generate the env modules in a single pass Aug 19, 2026
@Nic-Polumeyv
Nic-Polumeyv marked this pull request as ready for review August 19, 2026 04:21
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.

1 participant