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

deprecate usage of JSDOM #138

Closed
1 of 5 tasks
thescientist13 opened this issue Aug 2, 2019 · 0 comments
Closed
1 of 5 tasks

deprecate usage of JSDOM #138

thescientist13 opened this issue Aug 2, 2019 · 0 comments
Assignees
Labels
chore unit testing, maintenance, etc question Further information is requested v0.4.0 Plugins and Packages
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Aug 2, 2019

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

In regards to a comment here just questioning usage of JSDOM

Details

Will make an issue for it specifically, but have been wondering if there's a way we can remove our dependency on JSDOM? In particular in browser.js it seems clunky to get the content from puppeteer (a real browser) but then just pass it back into a "fake" browser.

const browser = await puppeteer.launch({
  headless: true,
  args: ['--no-sandbox']
});
const renderer = new Renderer(browser);
const result = await renderer.serialize(url);

// need url: https://github.com/jsdom/jsdom/issues/2005
const dom = new JSDOM(result.content, { url });
const html = dom.serialize();
const target = path.join(outputDirectory, route);

I could see how JSDOM could be helpful for unit testing, so maybe we just need to make it a devDependency or just get some sort of simple DOM parsing library? Just seems like a lot to have both Puppeteer and JSDOM.

@thescientist13 thescientist13 added question Further information is requested chore unit testing, maintenance, etc labels Aug 2, 2019
@thescientist13 thescientist13 self-assigned this Aug 2, 2019
@thescientist13 thescientist13 added the v0.4.0 Plugins and Packages label Sep 21, 2019
@thescientist13 thescientist13 added this to the MVP milestone Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore unit testing, maintenance, etc question Further information is requested v0.4.0 Plugins and Packages
Projects
None yet
Development

No branches or pull requests

1 participant