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

parse spec info for generated libraries #111

Merged
merged 2 commits into from
Nov 30, 2023
Merged

parse spec info for generated libraries #111

merged 2 commits into from
Nov 30, 2023

Conversation

devoncarew
Copy link
Member

  • no longer write generated libraries that wouldn't contain any code
  • make the process to clean up previously generated files more lightweight (instead of deleting all the source at the start of generation, we only remove files after generation that hadn't been modified)
  • vend in the node web-specs package; parse that as part of generation in order to read spec info related to the generated libraries (we don't use this info as yet, but could use it to prune which specs we choose to generate for - see Consider excluding IDLs from Web Incubator CG #105)

This PR is sort of a grab-bag; thoughts welcome.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@devoncarew
Copy link
Member Author

Here's the info we parse for each spec entry:

  {
    "url": "https://fetch.spec.whatwg.org/",
    "seriesComposition": "full",
    "shortname": "fetch",
    "series": {
      "shortname": "fetch",
      "currentSpecification": "fetch",
      "title": "Fetch Standard",
      "shortTitle": "Fetch",
      "nightlyUrl": "https://fetch.spec.whatwg.org/"
    },
    "organization": "WHATWG",
    "groups": [
      {
        "name": "Fetch Workstream",
        "url": "https://fetch.spec.whatwg.org/"
      }
    ],
    "nightly": {
      "url": "https://fetch.spec.whatwg.org/",
      "status": "Living Standard",
      "alternateUrls": [],
      "repository": "https://github.com/whatwg/fetch",
      "sourcePath": "fetch.bs",
      "filename": "index.html"
    },
    "title": "Fetch Standard",
    "source": "specref",
    "shortTitle": "Fetch",
    "categories": [
      "browser"
    ],
    "standing": "good",
    "tests": {
      "repository": "https://github.com/web-platform-tests/wpt",
      "testPaths": [
        "cors",
        "fetch"
      ],
      "excludePaths": [
        "fetch/fetch-later",
        "fetch/metadata",
        "fetch/private-network-access"
      ]
    }
  },

@kevmoo kevmoo requested a review from srujzs November 30, 2023 17:08
Copy link
Member

@kevmoo kevmoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOVE IT! should wait for 👍 from @srujzs , though

Copy link
Contributor

@srujzs srujzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! While ideally we should probably move the addition of the web spec to a PR that uses it, I'm totally okay with keeping the processing of the web spec here.

tool/bindings_generator/filesystem_api.dart Outdated Show resolved Hide resolved
@devoncarew
Copy link
Member Author

Nice, thanks! While ideally we should probably move the addition of the web spec to a PR that uses it,

Yeah, totally - this would normally be the 1st half of a PR. After looking at the info we were parsing however, it didn't immediately jump out at me which libraries not to include in the generation. I think this will need someone w/ more domain expertise to incrementally prune the generated libraries.

We may even want to use the info to generate some libraries into a src/experimental directory. It could be nice to make some APIs available, but w/o strong guarantees wrt api stability.

@srujzs
Copy link
Contributor

srujzs commented Nov 30, 2023

We may even want to use the info to generate some libraries into a src/experimental directory. It could be nice to make some APIs available, but w/o strong guarantees wrt api stability.

This would be great! One of the concerns I had was that due to the noise of some of the in-progress API definitions, we'd be releasing breaking changes too often. Moving them to a folder where we make no guarantees of stability should hopefully minimize those breaking changes.

@kevmoo
Copy link
Member

kevmoo commented Nov 30, 2023

Turns out that info is NOT as useful as I'd hoped. It's too complex to explain here...

@devoncarew devoncarew merged commit cffc2e3 into main Nov 30, 2023
8 checks passed
@devoncarew devoncarew deleted the gather_spec_info branch November 30, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants