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

Update to the latest CDP protocol #1430

Open
2 tasks done
inancgumus opened this issue Sep 19, 2024 · 3 comments
Open
2 tasks done

Update to the latest CDP protocol #1430

inancgumus opened this issue Sep 19, 2024 · 3 comments
Assignees
Labels
maintenance stability runtime stability improvements

Comments

@inancgumus
Copy link
Member

inancgumus commented Sep 19, 2024

What?

Update to the latest CDP protocol package.

Why?

  • The currently used version of CDP is 2 years old. While it's not yet deprecated, the upcoming releases of Chromium may drop certain features that are deprecated now.
  • Using deprecated APIs might create unexpected stability issues.

How?

  • Update to the latest CDP protocol version
  • Remove the deprecated API usage
  • Fix the issues

Tasks

Tasks

@inancgumus inancgumus added maintenance stability runtime stability improvements labels Sep 19, 2024
@ankur22 ankur22 mentioned this issue Sep 27, 2024
3 tasks
@ankur22
Copy link
Collaborator

ankur22 commented Sep 27, 2024

Initial findings from CDP dependency update

I have a draft PR for this: #1447. I was hoping that it wasn't going to be a lot of work but i'm unsure of the current breaking change and what else might be broken.

Deprecate PostData?

In #1447 we're having to work with a new field PostDataEntries instead of PostData in the request type. Instead of trying to concatenate the PostDataEntries into a single PostData field, we could export a new API PostDataEntries and deprecate PostData.

At the moment since it's not possible to intercept any request that the website makes from the test script, i doubt anyone is working with PostData. Which means the deprecation and addition of PostDataEntries might be an easy one that doesn't affect any users.

If we complete page.on('request') before we deprecate PostData then it will become more challenging to deprecate it.

Next steps

Look at the chromium codebase to work out how the PostDataEntries is populated so that we understand how to work with and implement/document it correctly on our side.

@inancgumus inancgumus mentioned this issue Oct 4, 2024
@ankur22 ankur22 self-assigned this Oct 7, 2024
@ankur22
Copy link
Collaborator

ankur22 commented Oct 8, 2024

Having taken a look at the chromium codebase (and not being that successful to be honest), and running some tests, i've come to the conclusion that it should be fine to work with postDataEntries.

From what i can see, only the 0th entry of the slice contains any data at the moment. We can just work with the 0th entry until a need arises to work with the whole slice. Since postDataEntries is an experimental field, i don't want to export this and make it a JS API just yet until there's a good reason to do so.

There doesn't seem to be a huge rush to change to working with postDataEntries in PW and Puppeteer either. I think keeping an eye on them would also help to gauge when the change is necessary.

WDYT?

EDIT: Alternatively we find a recent CDP dependency version that still works with postData and just before it is replaced by postDataEntries.

@inancgumus
Copy link
Member Author

Thanks for the analysis 👍 For now, since it seems to work for us, I wouldn't go to the alternative route and use postDataEntries instead. @ankur22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance stability runtime stability improvements
Projects
None yet
Development

No branches or pull requests

2 participants