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

chore(agnostification): eliminate common's dependent on isNode check. #6737

Closed
wants to merge 5 commits into from

Conversation

webee
Copy link

@webee webee commented Jan 7, 2021

related to #6125
by add a Config module which contains the node specific packages(ws, fs etc), let the common depend on it(dependeny injection), we can remove isNode check in common code, as well as dynamic imports.
every entry(node, web) needs initialize the Config before export the Puppeteer object.
this way, we may support some kind of support for filesystem in the browser(normal webpage or chrome extension).

chore(agnostification): add Config for common

chore(agnostification): move Config to common dir and add path config

chore(agnostification): fix debug function not set error
@mathiasbynens
Copy link
Member

Jack, PTAL

src/common/Config.ts Outdated Show resolved Hide resolved
src/common/Config.ts Outdated Show resolved Hide resolved
src/common/Config.ts Outdated Show resolved Hide resolved
src/common/Debug.ts Outdated Show resolved Hide resolved
src/common/Debug.ts Outdated Show resolved Hide resolved
src/node/fs.ts Outdated Show resolved Hide resolved
src/node/fs.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@jackfranklin jackfranklin left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! I have a few comments and considerations with regards to future web optimisations we can make & eliminating Node code from our web bundle all together, but I like this direction and idea 👍

@mathiasbynens
Copy link
Member

mathiasbynens commented Feb 2, 2021

Jack, could you PTAL and see if your feedback was addressed? Thanks!

@jackfranklin
Copy link
Collaborator

This is looking really good, thanks! I have one final though and then I think we can try to get this in.

@webee webee closed this Apr 7, 2021
@webee webee deleted the remove-dynamic-import branch April 7, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants