Skip to content
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

Drop the URL patch #11

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ DONE:
- add the following devDependency to the package.json:

```json
"node-url": "npm:url@^0.11.4",
"wrangler": "^3.77.0"
"wrangler": "^3.78.6"
```

- add a wrangler.toml int the generated app
Expand Down Expand Up @@ -90,23 +89,11 @@ Changes:
...
},
"devDependencies": {
"node-url": "npm:url@^0.11.4",
"wrangler": "^3.77.0"
"wrangler": "^3.78.6"
...
}
```

- wrangler, update bundle.ts (based on 3.76.0)

```js
//l 354
conditions: [],
platform: "node",
```

The conditions (`export const BUILD_CONDITIONS = ["workerd", "worker", "browser"];`)
would pull browser files that are not traced by nft.

- Build the app

- Use the updated wrangler `pnpm --filter wrangler start dev -c /path/to/open-next/example/wrangler.toml`
- Serve with `WRANGLER_BUILD_CONDITIONS="" WRANGLER_BUILD_PLATFORM="node" wrangler dev`
2 changes: 0 additions & 2 deletions builder/src/build/build-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { readdirSync, readFileSync, writeFileSync } from "node:fs";
import { cp, readFile, writeFile } from "node:fs/promises";

import { patchRequire } from "./patches/investigated/patch-require";
import { patchUrl } from "./patches/investigated/patch-url";
import { copyTemplates } from "./patches/investigated/copy-templates";

import { patchReadFile } from "./patches/to-investigate/patch-read-file";
Expand Down Expand Up @@ -149,7 +148,6 @@ async function updateWorkerBundledCode(

patchedCode = patchRequire(patchedCode);
patchedCode = patchReadFile(patchedCode, nextjsAppPaths);
patchedCode = patchUrl(patchedCode);
patchedCode = inlineNextRequire(patchedCode, nextjsAppPaths);
patchedCode = patchFindDir(patchedCode, nextjsAppPaths);
patchedCode = inlineEvalManifest(patchedCode, nextjsAppPaths);
Expand Down
21 changes: 0 additions & 21 deletions builder/src/build/patches/investigated/patch-url.ts

This file was deleted.

13 changes: 6 additions & 7 deletions examples/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
"e2e": "playwright test"
},
"dependencies": {
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
"next": "catalog:",
"react": "catalog:",
"react-dom": "catalog:"
},
"devDependencies": {
"@flarelabs-net/builder": "workspace:*",
"@playwright/test": "1.47.0",
"@types/node": "^22.2.0",
"node-url": "npm:url@^0.11.4",
"wrangler": "3.77.0"
"@playwright/test": "catalog:",
"@types/node": "catalog:",
"wrangler": "catalog:"
}
}
23 changes: 11 additions & 12 deletions examples/create-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@
"e2e": "playwright test -c e2e/playwright.config.ts"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "14.2.11"
"react": "catalog:",
"react-dom": "catalog:",
"next": "catalog:"
},
"devDependencies": {
"@flarelabs-net/builder": "workspace:*",
"@playwright/test": "1.47.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.11",
"@playwright/test": "catalog:",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"eslint": "catalog:",
"eslint-config-next": "catalog:",
"postcss": "^8",
"node-url": "npm:url@^0.11.4",
"tailwindcss": "^3.4.1",
"typescript": "^5",
"wrangler": "^3.77.0"
"typescript": "catalog:",
"wrangler": "catalog:"
}
}
Loading