-
-
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
Fix Redirect issue when using baseURL #1584
Conversation
* 'master' of https://github.com/sveltejs/kit: Version Packages (next) (sveltejs#1543) type fixes for adapter-node and adapter-static (sveltejs#1578) Upgrade to Vite 2.3.3 (sveltejs#1580) fix: improve getRawBody parsing & handle error(s) (sveltejs#1528) create-svelte: add svelte-check for TS (sveltejs#1556) pass validated svelte config to adapters (sveltejs#1559) types: group related and reduce potential inconsistencies (sveltejs#1539) Use sveltekit tag on StackOverflow (sveltejs#1558) Fix create-svelte build-template script (sveltejs#1555) Remove err param from Polka .listen() callback (sveltejs#1550) bump: polka and sirv versions (sveltejs#1548) svelte-kit package (sveltejs#1499)
* 'master' of github.com:sidharthv96/kit: chore: Add changeset for favicon Add favicon to skeleton template
This comment has been minimized.
This comment has been minimized.
This reverts commit 9dabbe0.
This comment has been minimized.
This comment has been minimized.
Should I be adding tests to packages/kit/test/apps/basics/src/routes/routing/_tests.js ? |
Seems like all the tests are running with a config with empty paths.base. Got this when I grepped the output after logging the config being passed to the tests.
Is there any tests which utilise 2 configs which I can refer to ? |
I think you need to create a new top-level-app so to speak (below tests) where you can create a svelte.config with a baseUrl |
* upstream/master: Add favicon to skeleton template (sveltejs#1514)
@dummdidumm Tried creating a new app, but it's failing when I try to load I'm adding that folder into this PR. I've named it aa-routing just so that it's run first and I can see failures fast. |
@@ -242,7 +242,7 @@ export class Router { | |||
|
|||
if (incorrect) { | |||
info.path = has_trailing_slash ? info.path.slice(0, -1) : info.path + '/'; | |||
history.replaceState({}, '', `${info.path}${location.search}`); | |||
history.replaceState({}, '', `${this.base}${info.path}${location.search}`); |
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.
This is the main fix in the PR.
Rest are UX improvements for CLI/Config validations.
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 — just left a few comments
@@ -0,0 +1,12 @@ | |||
<!DOCTYPE html> |
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.
rather than creating a new top-level app, could we move these into test/apps/options
? it will mean updating the paths in the existing tests in that app, but i think that's preferable to creating a new app, since that will have a noticeable impact on how long tests take to run overall
@Rich-Harris the Options tests have been modified. But they still won't pass as the base path is not properly used in the dev and build servers. |
Ah, of course — the base path isn't reflected locally during dev (or ideally during preview — #1154 / #1155), and as such the tests shouldn't account for it. We could change that behaviour so that the base path is reflected, I haven't spent much time thinking about which is preferable. Either way, in the meantime we should a) remove the tests from this PR, and b) remove all the |
Raised #1608 with just the changes mentioned. |
@sidharthv96 thanks for you contribution. I merged your other PR together with a related one. If you'd like to continue with this one it would need to be rebased now |
@sidharthv96 did you want to rebase and continue with this PR or close it? |
* 'master' of github.com:sidharthv96/kit: (1114 commits) Version Packages (next) (sveltejs#1858) Bump vite-plugin-svelte to 1.0.0-next.12 (sveltejs#1869) [fix] preserve user defined config and files on `svelte-kit package` (sveltejs#1735) [fix] handle undefined body on endpoint output (sveltejs#1808) [fix] copy essentials files from root on packaging (sveltejs#1747) [docs] sort config alphabetically (sveltejs#1867) add config.kit.package.emitTypes option (sveltejs#1852) [fix] add $lib alias to js/tsconfig (sveltejs#1860) Pass along custom properties added to Error (sveltejs#1821) Version Packages (next) (sveltejs#1840) Improve grammar in packages FAQ Docs for writing an adapter (sveltejs#1846) Additional documentation around pnpx changeset usage [feat] expose Vite.js `mode` from `$app/env` (sveltejs#1789) Service worker files exclusion support (sveltejs#1645) chore: Enable `vite.server.fs.strict` internally by default (sveltejs#1842) Test with the latest version of Svelte (sveltejs#1848) [docs] don't need to run pnpm install twice Improve HN example docs [fix] correct `ReadOnlyFormData` generator implementation (sveltejs#1837) ...
|
@sidharthv96 this PR would still need to be rebased. I may close this PR as stale if I don't hear from you. In that case we can always reopen later |
…ePath * 'master' of https://github.com/sveltejs/kit: (85 commits) [chore] minor simplification of `parse_body` (sveltejs#2043) Version Packages (next) (sveltejs#2026) [chore] deduplicate config types (sveltejs#2030) [chore] remove invalid css declaration (sveltejs#2038) [fix] correctly pass Vite options in preview mode (sveltejs#2036) [feat] Ignore adapter build files (sveltejs#1924) [chore] Upgrade Rollup Don't check external links on prerender (sveltejs#1679) Version Packages (next) (sveltejs#2017) [chore] convert remaining type aliases (sveltejs#2018) [feat] explicitly set compilerOptions.hydratable to config.kit.hydrate (sveltejs#2024) [feat] More powerful and configurable rendering options (sveltejs#2008) [chore] typecheck example (sveltejs#2019) Change config `prerender.force` to `prerender.onError` (sveltejs#2007) [chore] prefer interfaces to types (sveltejs#2010) [docs] minor wording improvement in migration guide (sveltejs#2006) [chore] test debugging improvements [docs] fix typo (sveltejs#2003) [chore] use @ts-expect-error instead of @ts-ignore (sveltejs#1999) Version Packages (next) (sveltejs#1996) ...
@Rich-Harris should the behaviour be changed to reflect base path ? |
I'm going to go ahead and close this since there hasn't been any response. We can reopen if necessary |
Closes #1583
Fixes #1476
Before submitting the PR, please make sure you do the following
Tests
pnpm test
and lint the project withpnpm lint
Changesets
pnpx changeset
and following the prompts