cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.22k stars 301 forks source link

Type collisions with common names #2537

Closed Cherry closed 3 weeks ago

Cherry commented 2 months ago

The latest versions of workers-types is now including image options:

export type InfoResponse export type OutputOptions export type Transform

https://github.com/Cloudflare-Mining/Cloudflare-Datamining/blob/38e659727fe7679e28731e5f2b7adf9ca8121dff/data/workers-types/2021-11-03/index.ts#L4748

etc. which are now available as globals when people load workers-types.

There have been some in the past like Params from Pages, but I wonder if this is something that will want to be thought about at some point with better handling of prefixes for non-standard things? There are a lot of things here that are prefixing with Ai or Pages. I'm not sure what the solution here is, but would love to open a discussion around it.

kentonv commented 2 months ago

Definitely agree that we shouldn't be dropping unqualified type names like this into the global scope when they are specific to a particular API.

@ns476 Can we clean this up please?