Commit Graph

3146 Commits

Author SHA1 Message Date
jrandolf
ec79f3a58a
feat: add experimental client to HTTPRequest (#8556) 2022-06-23 13:20:42 +02:00
jrandolf
ebcb8a2760
chore: split JSHandle.ts (#8551) 2022-06-23 11:31:43 +02:00
jrandolf
26c3acbb07
feat!: type inference for evaluation types (#8547)
This PR greatly improves the types within Puppeteer:

- **Almost everything** is auto-deduced.
  - Parameters don't need to be specified in the function. They are deduced from the spread.
  - Return types don't need to be specified. They are deduced from the function. (More on this below)
  - Selections based on tag names correctly deduce element type, similar to TypeScript's mechanism for `getElementByTagName`.
- [**BREAKING CHANGE**] We've removed the ability to declare return types in type arguments for the following reasons:
  1. Setting them will indubitably break auto-deduction.
  2. You can just use `as ...` in TypeScript to coerce the correct type (given it makes sense).
- [**BREAKING CHANGE**] `waitFor` is officially gone.

To migrate to these changes, there are only four things you may need to change:
- If you set a return type using the `ReturnType` type parameter, remove it and use `as ...` and `HandleFor` (if necessary).
 `evaluate<ReturnType>(a: number, b: number) => {...}, a, b)`
 `(await evaluate(a, b) => {...}, a, b)) as ReturnType`
 `evaluateHandle<ReturnType>(a: number, b: number) => {...}, a, b)`
 `(await evaluateHandle(a, b) => {...}, a, b)) as HandleFor<ReturnType>`
- If you set any type parameters in the *parameters* of an evaluation function, remove them.  
 `evaluate(a: number, b: number) => {...}, a, b)`
 `evaluate(a, b) => {...}, a, b)`
- If you set any type parameters in the method's declaration, remove them.
 `evaluate<(a: number, b: number) => void>((a, b) => {...}, a, b)`
 `evaluate(a, b) => {...}, a, b)`
2022-06-23 11:29:46 +02:00
jrandolf
da269c3f32
chore: add stale bot (#8554) 2022-06-23 10:28:07 +02:00
jrandolf
988aeabfb2
chore: remove type tests (#8550) 2022-06-23 10:02:52 +02:00
Randolf J
b007ee4f50 chore: run CI on any PR branch 2022-06-23 09:12:51 +02:00
jrandolf
93d6c6deae
chore: remove doclint type checking (#8549) 2022-06-23 08:39:28 +02:00
jrandolf
347101883f
chore: split Launcher.ts (#8544) 2022-06-23 00:13:39 +02:00
jrandolf
70c7f64a58
chore: freeze revisions (#8543) 2022-06-22 15:56:43 +02:00
jrandolf
84712cbc28
chore: use Google's TS style guide's format config (#8542) 2022-06-22 15:25:44 +02:00
Randolf J
3744c2f584 chore: unfreeze version on docs 2022-06-20 09:31:06 +02:00
Randolf J
c7400bbc78 chore: remove bootstrap commit for release-please 2022-06-20 09:29:57 +02:00
Randolf J
f9586b1226 chore: use PAT for release 2022-06-20 09:28:36 +02:00
release-please[bot]
3d1ec573fb
chore(main): release 14.4.1 (#8523) 2022-06-17 15:29:28 +02:00
James Diefenderfer
6cd5cd0439
fix: avoid instanceof Object check in isErrorLike (#8527) 2022-06-17 15:26:18 +02:00
Randolf J
f0c17378a0 chore: run only unit tests with coverage in CI
This will verify coverage and unit tests without duplicating unit runs.
2022-06-15 12:48:20 +02:00
jrandolf
ce0dd25349
chore: use braces in function bodies (#8525) 2022-06-15 12:42:21 +02:00
jrandolf
570087ea94
chore: use strict typing in tests (#8524)
* The testing tsconfig.json inherits from the base TS config.
  * A lot of type assertions have been inserted...a lot.
* All testing utilities have migrated to TS.
* text-diff is being replaced with diff for TS compatibility.
* ProtocolError has been added to PuppeteerErrors and PuppeteerErrors is no longer a record (it's been frozen).
* Fixes a small bug where null was an allowable media type in emulation (should be undefined).
2022-06-15 12:09:22 +02:00
jrandolf
80373f7a12
chore: use composite builds for tests (#8522) 2022-06-15 12:05:25 +02:00
Randolf J
cba58a12c4 fix: export devices, errors, and more
This commits exports `devices`, `errors`, and `networkConditions`.
2022-06-14 20:56:14 +02:00
jrandolf
e6442dd767
chore: use curly (#8519) 2022-06-14 13:55:35 +02:00
jrandolf
0678343b53
chore: move helper.js to util.js (#8510) 2022-06-14 13:16:21 +02:00
Randolf J
6efb660f4d chore: fix release-please 2022-06-14 11:31:41 +02:00
Randolf J
19854888cd chore: update changelog 2022-06-14 11:24:24 +02:00
Randolf J
6bc45c4ae8 chore: unfreeze version on docs 2022-06-13 23:27:40 +02:00
Randolf J
8dc53d5157 chore: disable workflow_dispatch publishing 2022-06-13 23:14:42 +02:00
Randolf J
ba67518f6b chore: enable workflow_dispatch publishing 2022-06-13 23:13:24 +02:00
release-please[bot]
e0c537408e
chore(main): release 14.4.0 (#8512)
* chore(main): release 14.4.0

* chore: freeze version on docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-13 23:05:56 +02:00
jrandolf
6c960115a3
chore: use private fields (#8506) 2022-06-13 11:16:25 +02:00
jrandolf
733cbecf48
chore: use c8 coverage (#8495) 2022-06-10 18:49:14 +02:00
Randolf J
2b5a90dd72 chore: remove old site 2022-06-10 17:46:02 +02:00
Randolf J
34144b4b07 chore: update CONTRIBUTING.md 2022-06-10 17:03:38 +02:00
jrandolf
4d359906a4
fix: use error-like (#8504) 2022-06-10 15:27:42 +02:00
jrandolf
bfd4e68f25
fix: use OS-independent abs. path check (#8505) 2022-06-10 14:34:57 +02:00
Alex Rudenko
8dbb4f3153
chore: run different ToT jobs in parallel (#8502) 2022-06-10 12:42:29 +02:00
Alex Rudenko
58ff348b76
chore: skip an oopif test for headful and chrome headless (#8501) 2022-06-10 12:39:18 +02:00
jrandolf
75c3f94a54
chore: namespace commands (#8494) 2022-06-10 11:55:53 +02:00
jrandolf
465a7c405f
feat: export puppeteer methods (#8493) 2022-06-09 19:00:50 +02:00
jrandolf
b30f3f44cd
fix: parse empty options in <select> (#8489) 2022-06-09 13:27:34 +02:00
jrandolf
f64ec2051b
feat: support node-like environments (#8490) 2022-06-09 13:03:44 +02:00
Randolf J
353358a996 chore: unfreeze version on docs 2022-06-07 16:34:36 +02:00
Randolf J
c712f45209 chore: use release-please[bot] as committer 2022-06-07 16:31:16 +02:00
Randolf J
2dd0d42d41 chore: require publish before post-publish 2022-06-07 16:26:44 +02:00
release-please[bot]
4b05a8454e
chore(main): release 14.3.0 (#8471)
* chore(main): release 14.3.0

* chore: freeze version on docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-07 16:21:47 +02:00
jrandolf
e8378666c6
fix: don't throw on bad access (#8472) 2022-06-07 16:17:21 +02:00
Alex Rudenko
e14256010d
feat: use absolute URL for EVALUATION_SCRIPT_URL (#8481)
Closes #8424
2022-06-07 15:36:51 +02:00
Randolf J
96b416c3b9 chore: add pull-requests: write perm on publish 2022-06-07 15:28:57 +02:00
James Diefenderfer
7dc8e37a23
fix: Kill browser process when killing process group fails (#8477)
Fixes #8476. Similar fix to #8352 which only covered Windows.
2022-06-07 15:25:45 +02:00
jrandolf
b54dc55f76
fix: robustly check for launch executable (#8468) 2022-06-07 15:25:04 +02:00
dependabot[bot]
328c3f5b08
chore(deps): bump actions/setup-node from 3.2.0 to 3.3.0 (#8478)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-07 14:37:49 +02:00