Skip to content

Research: detecting polyfills #264

@43081j

Description

@43081j

If we can land #257 , it means we can better represent polyfills since we can specify their target platform/engine versions.

We should do a big push to list as many widely used polyfills in this repo, along with their engine constraints and their replacements.

For example:

So we would want to define this similar to the following:

{
  "moduleName": "abort-controller",
  "replacements: [
    {
      "type": "native",
      "replacement": "AbortController",
      "engines": [
        {
          "type": "baseline",
          "category": "aborting",
          "key": "api.AbortController"
        },
        {
          "type": "engine",
          "name": "node",
          "version": ">=18.0.0", // put real version here
        }
      },
  ]
}

this should help us define #257 as we add more polyfills to this issue

in this example, we can use the category and key to access the web-features npm package's data set to get hold of the browser versions.

we still need to define node, bun, etc ourselves.

so tasks for us to do:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions