Skip to content

Separate domains

Choose a tag to compare

@mafredri mafredri released this 18 Jul 16:05
· 233 commits to main since this release

With this release cdp is very close to a v1.0.0-release.

For a complete changelog, see v0.8.0...v0.9.0.

NOTE: This release is a breaking change from the previous API (just published as v0.8.0).

Instead of domain types belonging to one of cdpcmd, cdpevent or cdptype, they all now reside in a single package, e.g. network. All domain packages are contained in the protocol
package.

This is a big refactor of the generated code that represents all the different CDP domains.

For the common use-case, only the args need to be rewritten:

  1. cdpcmd.NewNetworkEnableArgs() -> network.NewEnableArgs()
  2. &cdpcmd.NetworkEnableArgs{} -> &network.EnableArgs{}

IMPORTANT: A number of changes were made to avoid the cyclic dependencies caused by the dom, network and page domains.

Go 1.9:

  • The types page.FrameID and page.ResourceType are aliases to internal.PageFrameID and internal.PageResourceType, respectively. The user should use the types defined in the page domain.

  • The PageResourceType and FrameID type aliases were added to the protocol package for full backwards compatibility with Go 1.8. These have been marked deprecated and should not be used in newer code.

Go 1.8:

  • The types page.FrameID and page.ResourceType were moved to protocol.PageFrameID and protocol.PageResourceType as a fallback since type aliases are not available.

  • The enums for protocol.PageResourceType are located in the page package, e.g. page.ResourceTypeDocument. This gives us a smoother transition to type aliases in Go 1.9.