Skip to content

Commit

Permalink
Merge branch 'cloudflare:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurry-gee authored Aug 10, 2023
2 parents f13ca7f + 94fed9d commit 675ab1a
Show file tree
Hide file tree
Showing 28 changed files with 524 additions and 272 deletions.
5 changes: 0 additions & 5 deletions .changeset/breezy-pants-allow.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/curly-wombats-suffer.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eight-rice-raise.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/few-rivers-tan.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/warm-students-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"edge-preview-authenticated-proxy": patch
---

No longer included the preview token twice in rawhttp requests
7 changes: 7 additions & 0 deletions fixtures/pages-d1-shim/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pages-d1-shim

## 0.0.1

### Patch Changes

- [#3595](https://github.com/cloudflare/workers-sdk/pull/3595) [`c302bec6`](https://github.com/cloudflare/workers-sdk/commit/c302bec639c0eec10d07d6b950c0a2d3e16eab1e) Thanks [@geelen](https://github.com/geelen)! - Removing the D1 shim from the build process, in preparation for the Open Beta. D1 can now be used with --no-bundle enabled.
2 changes: 1 addition & 1 deletion fixtures/pages-d1-shim/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pages-d1-shim",
"version": "0.0.0",
"version": "0.0.1",
"private": true,
"sideEffects": false,
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions fixtures/pages-workerjs-directory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pages-workerjs-directory

## 0.0.1

### Patch Changes

- [#3595](https://github.com/cloudflare/workers-sdk/pull/3595) [`c302bec6`](https://github.com/cloudflare/workers-sdk/commit/c302bec639c0eec10d07d6b950c0a2d3e16eab1e) Thanks [@geelen](https://github.com/geelen)! - Removing the D1 shim from the build process, in preparation for the Open Beta. D1 can now be used with --no-bundle enabled.
2 changes: 1 addition & 1 deletion fixtures/pages-workerjs-directory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pages-workerjs-directory",
"version": "0.0.0",
"version": "0.0.1",
"private": true,
"sideEffects": false,
"scripts": {
Expand Down
11 changes: 8 additions & 3 deletions fixtures/pages-workerjs-directory/public/_worker.js/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import staticMod from "./static.js";
import staticJsMod from "./static.js";
import staticMjsMod from "./static.mjs";
import add from "./add.wasm";

export default {
Expand All @@ -10,8 +11,12 @@ export default {
return new Response(addModule.exports.add(1, 2).toString());
}

if (pathname === "/static") {
return new Response(staticMod);
if (pathname === "/static-js") {
return new Response(`static import text (via js): '${staticJsMod}'`);
}

if (pathname === "/static-mjs") {
return new Response(`static import text (via mjs): '${staticMjsMod}'`);
}

if (pathname === "/d1") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "other-other-script-test";
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default "static";
export default "js static";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "mjs static";
16 changes: 13 additions & 3 deletions fixtures/pages-workerjs-directory/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,19 @@ describe("Pages _worker.js/ directory", () => {
fetch(`http://${ip}:${port}/wasm`).then((resp) => resp.text())
).resolves.toContain("3");
await expect(
fetch(`http://${ip}:${port}/static`).then((resp) => resp.text())
).resolves.toContain("static");
fetch(`http://${ip}:${port}/static-js`).then((resp) => resp.text())
).resolves.toEqual("static import text (via js): 'js static'");
await expect(
fetch(`http://${ip}:${port}/static-mjs`).then((resp) => resp.text())
).resolves.toEqual("static import text (via mjs): 'mjs static'");
await expect(
fetch(`http://${ip}:${port}/other-script.js`).then((resp) => resp.text())
).resolves.toContain("other-script-test");
await expect(
fetch(`http://${ip}:${port}/other-other-script.mjs`).then((resp) =>
resp.text()
)
).resolves.toContain("other-other-script-test");
await expect(
fetch(`http://${ip}:${port}/d1`).then((resp) => resp.text())
).resolves.toContain('{"1":1}');
Expand Down Expand Up @@ -70,6 +78,8 @@ describe("Pages _worker.js/ directory", () => {

expect(contents).not.toContain("D1_ERROR"); // No more D1 shim in the bundle!
expect(contents).toContain('"other-script-test"');
expect(contents).toContain('import staticMod from "./static.js";');
expect(contents).toContain('"other-other-script-test"');
expect(contents).toContain('import staticJsMod from "./static.js";');
expect(contents).toContain('import staticMjsMod from "./static.mjs";');
});
});
2 changes: 1 addition & 1 deletion fixtures/pages-ws-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "*",
"miniflare": "3.20230724.0",
"miniflare": "3.20230801.0",
"wrangler": "*",
"ws": "^8.8.0"
},
Expand Down
Loading

0 comments on commit 675ab1a

Please sign in to comment.