Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sveltejs/kit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @sveltejs/kit@1.0.0-next.420
Choose a base ref
...
head repository: sveltejs/kit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @sveltejs/kit@1.0.0-next.421
Choose a head ref
  • 3 commits
  • 17 files changed
  • 4 contributors

Commits on Aug 18, 2022

  1. [fix] packaging migration cleanup (#6020)

    * ye olde template
    
    * add changeset
    
    * sort config docs
    
    * sort types properties
    
    * trailing backtick?
    ignatiusmb authored Aug 18, 2022
    Copy the full SHA
    93f01df View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7b305af View commit details
  3. Version Packages (next) (#6021)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 18, 2022
    Copy the full SHA
    b9f8b73 View commit details
5 changes: 5 additions & 0 deletions .changeset/few-hornets-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Respect `export const prerender = false` in `+page.server.js`
5 changes: 5 additions & 0 deletions .changeset/gold-rocks-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

update `app.d.ts` for library skeleton template
2 changes: 2 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -256,6 +256,7 @@
"few-buses-argue",
"few-carrots-sell",
"few-cobras-switch",
"few-hornets-joke",
"few-points-taste",
"few-rockets-sort",
"few-rockets-think",
@@ -335,6 +336,7 @@
"gold-carrots-sniff",
"gold-colts-train",
"gold-moles-hunt",
"gold-rocks-hang",
"gold-spies-fail",
"gold-trains-dream",
"good-beans-invite",
8 changes: 4 additions & 4 deletions documentation/docs/15-configuration.md
Original file line number Diff line number Diff line change
@@ -72,9 +72,6 @@ const config = {
}
},

// options passed to svelte.preprocess (https://svelte.dev/docs#compile-time-svelte-preprocess)
preprocess: null,

// options passed to @sveltejs/package
package: {
source: 'value of kit.files.lib, if available, else src/lib',
@@ -83,7 +80,10 @@ const config = {
// excludes all .d.ts and files starting with _ as the name
exports: (filepath) => !/^_|\/_|\.d\.ts$/.test(filepath),
files: () => true
}
},

// options passed to svelte.preprocess (https://svelte.dev/docs#compile-time-svelte-preprocess)
preprocess: null
};

export default config;
6 changes: 6 additions & 0 deletions packages/create-svelte/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# create-svelte

## 2.0.0-next.156

### Patch Changes

- update `app.d.ts` for library skeleton template ([#6020](https://github.com/sveltejs/kit/pull/6020))

## 2.0.0-next.155

### Patch Changes
2 changes: 1 addition & 1 deletion packages/create-svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-svelte",
"version": "2.0.0-next.155",
"version": "2.0.0-next.156",
"repository": {
"type": "git",
"url": "https://github.com/sveltejs/kit",
4 changes: 2 additions & 2 deletions packages/create-svelte/templates/libskeleton/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,6 @@
declare namespace App {
// interface Locals {}
// interface Platform {}
// interface Session {}
// interface Stuff {}
// interface PrivateEnv {}
// interface PublicEnv {}
}
6 changes: 6 additions & 0 deletions packages/kit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sveltejs/kit

## 1.0.0-next.421

### Patch Changes

- Respect `export const prerender = false` in `+page.server.js` ([#6012](https://github.com/sveltejs/kit/pull/6012))

## 1.0.0-next.420

### Patch Changes
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sveltejs/kit",
"version": "1.0.0-next.420",
"version": "1.0.0-next.421",
"repository": {
"type": "git",
"url": "https://github.com/sveltejs/kit",
3 changes: 2 additions & 1 deletion packages/kit/src/runtime/server/page/index.js
Original file line number Diff line number Diff line change
@@ -117,7 +117,8 @@ export async function render_page(event, route, options, state, resolve_opts) {
});
}

const should_prerender = leaf_node.shared?.prerender ?? options.prerender.default;
const should_prerender =
leaf_node.shared?.prerender ?? leaf_node.server?.prerender ?? options.prerender.default;
if (should_prerender) {
const mod = leaf_node.server;
if (mod && (mod.POST || mod.PUT || mod.DELETE || mod.PATCH)) {
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = false;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>This should not be visible</h1>
5 changes: 5 additions & 0 deletions packages/kit/test/prerendering/basics/test/test.js
Original file line number Diff line number Diff line change
@@ -99,6 +99,11 @@ test('does not prerender page with shadow endpoint with non-load handler', () =>
assert.ok(!fs.existsSync(`${build}/shadowed-post/__data.json`));
});

test('does not prerender page with prerender = false in +page.server.js', () => {
assert.ok(!fs.existsSync(`${build}/page-server-options.html`));
assert.ok(!fs.existsSync(`${build}/page-server-options/__data.json`));
});

test('decodes paths when writing files', () => {
let content = read('encoding/path with spaces.html');
assert.ok(content.includes('<p id="a">path with spaces</p>'));
2 changes: 1 addition & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -106,14 +106,14 @@ export interface Config {
compilerOptions?: CompileOptions;
extensions?: string[];
kit?: KitConfig;
preprocess?: any;
package?: {
source?: string;
dir?: string;
emitTypes?: boolean;
exports?: (filepath: string) => boolean;
files?: (filepath: string) => boolean;
};
preprocess?: any;
[key: string]: any;
}

3 changes: 1 addition & 2 deletions packages/kit/types/internal.d.ts
Original file line number Diff line number Diff line change
@@ -211,12 +211,11 @@ export interface SSRNode {
hydrate?: boolean;
prerender?: boolean;
router?: boolean;
ssr?: boolean;
};

server: {
load?: ServerLoad;
HEAD?: ServerLoad;
prerender?: boolean;
POST?: Action;
PATCH?: Action;
PUT?: Action;
4 changes: 2 additions & 2 deletions packages/package/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -18,10 +18,10 @@ export type RecursiveRequired<T> = {
};

export interface ValidatedConfig {
preprocess?: any;
extensions: string[];
package: RecursiveRequired<PackageConfig>;
kit?: any;
package: RecursiveRequired<PackageConfig>;
preprocess?: any;
}

export type Validator<T = any> = (input: T, keypath: string) => T;
2 changes: 1 addition & 1 deletion packages/package/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -29,6 +29,6 @@ export interface Config {
compilerOptions?: CompileOptions;
extensions?: string[];
kit?: any;
preprocess?: any;
package?: PackageConfig;
preprocess?: any;
}