Skip to content

Commit fbd5772

Browse files
use latest experimental version of @opennextjs/cloudflare
1 parent c0d84b3 commit fbd5772

8 files changed

Lines changed: 6363 additions & 3829 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ tsconfig.tsbuildinfo
3434
dist/
3535

3636
# Ignore worker artifacts
37-
apps/site/.worker-next
37+
apps/site/.open-next
3838
apps/site/.wrangler

apps/site/CLOUDFLARE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ You can monitor and configure the project at https://dash.cloudflare.com/fb4a2d0
7171

7272
The following is an incomplete list of tasks and problems that still need to be resolved:
7373

74-
- [ ] update `@opennextjs/cloudflare` to the latest in `/apps/site/package.json`
7574
- [ ] sort out issues with `eval` and MDX and undo edits in `./app/[locale]/[[...path]]/page.tsx`
7675
- [ ] reimplement `getMarkdownFiles` in `next.helpers.mjs` to be generated at build time
7776
- this can be accomplished either via a npm/turbo prebuild task, or possibly as part of next.js SSG/staticProps (but we need to ensure that we don't end up accidentaly downloading this big file to the client as part of hydration)
@@ -82,6 +81,6 @@ The following is an incomplete list of tasks and problems that still need to be
8281
- [ ] properly implement the rest of `.cloudflare/node/*` polyfills
8382
- [ ] remove symlink hack in `package.json#build:cloudflare`
8483
- would it be possible to make the pages directory part of assets in a less hacky way?
85-
- [ ] move these files under `.worker-next/assets/cdn-cgi/pages` so that these raw md files are not publicly accessible as that could become a maintenance burden down the road.
84+
- [ ] move these files under `.open-next/assets/cdn-cgi/pages` so that these raw md files are not publicly accessible as that could become a maintenance burden down the road.
8685
- [ ] review and improve `/apps/site/turbo.json` changes
8786
- [ ] reenable minification in `next.config.mjs`

apps/site/open-next.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const config = {
2+
default: {},
3+
4+
middleware: {
5+
external: true,
6+
override: {
7+
wrapper: 'cloudflare',
8+
converter: 'edge',
9+
},
10+
},
11+
};
12+
13+
export default config;

apps/site/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"test:unit": "cross-env NODE_NO_WARNINGS=1 jest",
3535
"test:unit:watch": "npm run test:unit -- --watch",
3636
"test": "turbo test:unit",
37-
"build:cloudflare": "cross-env cloudflare && ln -s ../../pages ./.worker-next/assets/",
37+
"build:cloudflare": "cross-env cloudflare && ln -s ../../pages ./.open-next/assets/",
3838
"preview:cloudflare": "wrangler dev --port 8771",
3939
"deploy:cloudflare": "wrangler deploy"
4040
},
@@ -93,7 +93,7 @@
9393
"devDependencies": {
9494
"@eslint/compat": "~1.2.0",
9595
"@next/eslint-plugin-next": "~14.2.14",
96-
"@opennextjs/cloudflare": "^0.2.1",
96+
"@opennextjs/cloudflare": "https://pkg.pr.new/@opennextjs/cloudflare@experimental",
9797
"@storybook/addon-controls": "~8.4.1",
9898
"@storybook/addon-interactions": "~8.4.1",
9999
"@storybook/addon-themes": "~8.4.1",

apps/site/turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"outputs": ["coverage/**", "junit.xml"]
133133
},
134134
"build:cloudflare": {
135-
"outputs": [".worker-next/**"]
135+
"outputs": [".open-next/**"]
136136
},
137137
"preview:cloudflare": {
138138
"dependsOn": ["build:cloudflare"]

apps/site/wrangler.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
main = ".worker-next/index.mjs"
1+
main = ".open-next/index.mjs"
22
name = "nodejs-website"
33
compatibility_date = "2024-11-07"
44
compatibility_flags = ["nodejs_compat"]
@@ -16,5 +16,5 @@ head_sampling_rate = 1
1616

1717

1818
[assets]
19-
directory = ".worker-next/assets"
19+
directory = ".open-next/assets"
2020
binding = "ASSETS"

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default [
1616
'junit.xml',
1717
'storybook-static/**',
1818
'**/.wrangler',
19-
'**/.worker-next',
19+
'**/.open-next',
2020
],
2121
},
2222
{

0 commit comments

Comments
 (0)