w3c / spec-prod

GitHub Action to build ReSpec/Bikeshed specs, validate output and publish to GitHub pages or W3C
https://w3c.github.io/spec-prod/
MIT License
34 stars 21 forks source link

Investigate alternatives for Puppeteer usage #147

Open whimboo opened 2 years ago

whimboo commented 2 years ago

Follow-up from the discussion on #146.

It would be good to know for what exactly Puppeteer is needed and if it could be replaced with something else that doesn't have a strict requirement for a given browser.

@sidvishnoi maybe you could please explain? I'm happy to help on this issue.

OrKoN commented 2 years ago

@whimboo what's the use case? We could use puppeteer with WebDriver BiDi + Firefox if you need basic JS evaluation to a basic type.

sidvishnoi commented 2 years ago

Puppeteer is used in following cases presently:

  1. Getting processed shortname from ReSpec document (after JS evaluation): https://github.com/w3c/spec-prod/blob/bc93d69901e2c76b0e5147c12263acf6099506d3/src/prepare-build.ts#L188-L193
  2. Extracting bikeshed metadata pre.metadata to get shortname: https://github.com/w3c/spec-prod/blob/bc93d69901e2c76b0e5147c12263acf6099506d3/src/prepare-build.ts#L218-L237
  3. Some query selector processing to extract metadata from published pages: https://github.com/w3c/spec-prod/blob/bc93d69901e2c76b0e5147c12263acf6099506d3/src/prepare-build.ts#L263-L266
  4. Full page content parsing, JS/CSS evaluation with subresources to extract all directly and indirectly referenced assets from a page that need to be copied for deployment: https://github.com/w3c/spec-prod/blob/bc93d69901e2c76b0e5147c12263acf6099506d3/src/build.ts#L169