Skip to content

Conversation

@Rich-Harris
Copy link
Member

Fixes #5444

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2022

🦋 Changeset detected

Latest commit: 37affe5

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

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor questions, but nothing that blocks me from approving this

Object.defineProperty(globalThis, name, {
enumerable: true,
configurable: true,
writable: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make all globals writable - could this have unintended side effects, like people starting to monkey patch this stuff when they shouldn't? Should we limit this to fetch, or is it actually better that people have the ability to override if needed (I'd say yes, but I wanted to bring this up).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had the same internal conversation. I decided that since we're able to write these values, it's only fair that others can too — there are always going to be legitimate reasons why someone might want to intercept one of these things (if only for debugging)

export default config;
```

- `origin` — the value of `url.origin` during prerendering; useful if it is included in rendered content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make it more apparent that this is from the $page store and/or link to it?

Suggested change
- `origin` — the value of `url.origin` during prerendering; useful if it is included in rendered content
- `origin` — the value of [`$page.url.origin`](/docs/modules#$app-stores-page) during prerendering; useful if it is included in rendered content

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trouble is it's not just $page, it's the url property of RequestEvent and LoadEvent too, so I figured url.origin was the most catch-all. Most people will never need to touch this setting anyway so it probably doesn't matter all that much

@Rich-Harris Rich-Harris merged commit 11d7b85 into master Jul 20, 2022
@Rich-Harris Rich-Harris deleted the gh-5444 branch July 20, 2022 14:25
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.

adaptor-static no longer generate endpoint like sitemap.xml.ts and robots.txt.ts as a static file

4 participants