@crawlee/cli 4.0.0-beta.331 → 4.0.0-beta.333

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/cli",
3
- "version": "4.0.0-beta.331",
3
+ "version": "4.0.0-beta.333",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.13.0"
@@ -45,7 +45,7 @@
45
45
  "access": "public"
46
46
  },
47
47
  "dependencies": {
48
- "@crawlee/templates": "4.0.0-beta.331",
48
+ "@crawlee/templates": "4.0.0-beta.333",
49
49
  "@inquirer/prompts": "^8.8.1",
50
50
  "ansi-colors": "^4.1.3",
51
51
  "semver": "^7.8.5",
@@ -59,5 +59,5 @@
59
59
  }
60
60
  }
61
61
  },
62
- "gitHead": "7ad8afd8a8b83aaa763f813f570c684842fe3b61"
62
+ "gitHead": "7bf44f6f297cf9d11a8a167aea5b0fcd28013e08"
63
63
  }
@@ -34,6 +34,18 @@ Search the project for what the guide's sections name. Plan the changes around t
34
34
 
35
35
  Apply the Node.js and optional-dependency requirements everywhere the project sets them: every Dockerfile build and runtime stage, base images selected through `ARG`, Compose or CI variables, install and prune scripts, and package-manager configuration. Preserve the image family, browser support, dev-dependency omission and frozen-lockfile behavior.
36
36
 
37
+ ## Behavior changes that compile
38
+
39
+ A passing type check does not cover these. Check each one against the project, then handle it or raise it with the user:
40
+
41
+ - TLS certificates are verified by default: "`ignoreSslErrors` is renamed to `ignoreTlsErrors` and defaults to `false`".
42
+ - `SessionError` and `retryOnBlocked` retries count toward `maxRequestRetries`: "`maxSessionRotations` and `request.sessionRotationCount` are removed".
43
+ - Storage writes commit only when the request handler succeeds: "Storage writes in request handlers are transactional". For Actors, also check charged `Actor.pushData(item, eventName)` calls in request handlers against the Apify SDK v4 upgrade guide.
44
+ - Navigation hooks share `navigationTimeoutSecs` with the navigation: "Navigation and the request handler are timed separately".
45
+ - HTTP crawlers and `sendRequest` use a different client: "The default HTTP client is now `impit`".
46
+ - Queue reuse: "Repeated `run()` calls no longer empty the request queue" and "Multiple crawler instances use separate default request queues".
47
+ - `--omit=optional` in Dockerfiles and install scripts: "Installing with `--omit=optional` breaks native dependencies".
48
+
37
49
  ## Git
38
50
 
39
51
  For a Git project, inspect the branch and working tree. Ask once for permission to create a migration branch and make incremental commits, unless both are already authorized. Wait for approval before those Git actions.
@@ -45,6 +45,7 @@ Adjust the command to your situation:
45
45
  - **Cookies behave.** `sendRequest` finally [respects your `Cookie` header](#cookie-handling-in-httpcrawler-and-sendrequest), and browser cookies set inside the handler are [persisted to the session](#browser-cookies-are-also-persisted-after-requesthandler).
46
46
  - **No half-written results.** Storage writes in a request handler are [transactional](#storage-writes-in-request-handlers-are-transactional) — a handler that throws leaves nothing behind, and its retry does not duplicate data.
47
47
  - **Simpler storage backend contract.** A custom storage backend is now [4 classes instead of 7](./storage-backends.md#storagebackend-interface-simplified).
48
+ - **Remote browsers.** The new `remoteBrowser` option connects `PlaywrightCrawler` or `PuppeteerCrawler` to a [remote browser service](https://crawlee.dev/js/docs/next/guides/remote-browser) instead of launching a local browser, while the crawler keeps managing sessions and the request lifecycle.
48
49
 
49
50
  ## Rename cheat sheet
50
51
 
@@ -110,12 +111,27 @@ await concurrencySystem.start();
110
111
  await Promise.all([a.run(), b.run()]);
111
112
  ```
112
113
 
113
- The hook calls the same `stop()` / `teardown()` / `destroy()` method as before, and those stay — `await using` needs Node.js 24, and v4 supports Node.js 22.
114
+ The hook calls the same `stop()` / `teardown()` / `destroy()` method as before, and those stay — untranspiled `await using` needs Node.js 24, and v4 supports Node.js 22.
114
115
 
115
116
  ### TypeScript 5.8+ required
116
117
 
117
118
  Support for older TypeScript versions was dropped. Crawlee ships compiled JavaScript, so this only affects type-checking against its type declaration files — plain JavaScript projects are unaffected. In particular, a CJS TypeScript project needs TypeScript 5.8+ to type-check a `require()` of an ESM package like Crawlee; older versions might still work if your project is also ESM.
118
119
 
120
+ ### `CheerioRoot`, `CheerioAPI` and `Dictionary` are no longer exported from `crawlee`
121
+
122
+ After the bump, TypeScript reports `Module '"crawlee"' has no exported member 'CheerioRoot'` (or `CheerioAPI`, `Dictionary`). `CheerioRoot` was an alias for cheerio's `CheerioAPI`; import the types from the packages that own them:
123
+
124
+ ```ts
125
+ import type { CheerioAPI } from 'cheerio';
126
+ import type { Dictionary } from '@crawlee/types';
127
+ ```
128
+
129
+ Add `cheerio` and `@crawlee/types` to your dependencies if they are not there already. See [`@crawlee/utils` and `@crawlee/types`](./utils-and-types.md#crawleetypes-symbols-are-no-longer-re-exported) for the other types that moved.
130
+
131
+ ### DOM globals in `page.evaluate()` callbacks need the `DOM` lib
132
+
133
+ In a TypeScript project, `document`, `HTMLElement` and other DOM globals used in `page.evaluate()` or `page.waitForFunction()` callbacks may stop resolving after the upgrade. In v3 the `crawlee` meta-package depended on `@crawlee/jsdom`, whose `@types/jsdom` dependency pulled the DOM typings in; v4 [no longer includes it](#only-if-you-use-jsdomcrawler-or-linkedomcrawler). Add `"DOM"` to `compilerOptions.lib` in your `tsconfig.json`.
134
+
119
135
  ### Cheerio v1
120
136
 
121
137
  Previously, we kept the dependency on cheerio locked to the latest RC version, since there were many breaking changes introduced in v1.0. This release bumps cheerio to the stable v1. `CheerioCrawler`, `HttpCrawler` and `htmlToText` keep parsing with `htmlparser2` through `cheerio/slim`; the `parseWithCheerio` helper on the browser crawlers loads full cheerio, which parses with `parse5`.
@@ -166,6 +182,8 @@ Crawlee v4 relies on more native, prebuilt dependencies than v3 did — notably
166
182
 
167
183
  Running `npm install --omit=optional` (or the equivalent `yarn`/`pnpm` flag) skips all optional dependencies, including these platform binaries, so the native dependencies fail to install correctly. If your Dockerfile or install scripts carried over `--omit=optional` from a v3 project template, remove it — it is no longer safe to use with Crawlee v4.
168
184
 
185
+ On Windows, the native binaries also need the [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170); `impit` fails to load without it.
186
+
169
187
  ### Deprecated crawler options are removed
170
188
 
171
189
  The crawler following options are removed:
@@ -864,7 +882,7 @@ Disposing is optional — a finished run leaves no browsers open and no timer ho
864
882
 
865
883
  :::info
866
884
 
867
- The `await using` syntax needs Node.js 24 or later. On Node.js 22 call `destroy()` yourself instead — it is what the disposal hook calls anyway, as with the [collaborators you own](#collaborators-you-own-are-disposable).
885
+ Untranspiled, the `await using` syntax needs Node.js 24 or later; TypeScript compiles it down unless `target` is `ESNext`, and the result runs on Node.js 22. In plain JavaScript on Node.js 22 call `destroy()` yourself instead — it is what the disposal hook calls anyway, as with the [collaborators you own](#collaborators-you-own-are-disposable).
868
886
 
869
887
  :::
870
888