Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: remove node.js dependency in browser #1081

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

Merged
sserrata merged 1 commit into PaloAltoNetworks:main from himself65:himself65/2024/02/07/fix
Feb 19, 2025

Conversation

@himself65
Copy link
Contributor

@himself65 himself65 commented Feb 7, 2025
edited
Loading

Description

Node.js core modules are imported in client(browser) side. And the previsous code use node polyfill, however this would brings more issue:

  1. node:buffer, node:zlib... where node: as prefix would still break the webpack bundler because node-polyfill-webpack-plugin didn't handle it correctly
  2. node polyfill packages are mostly too outdated (many years no updates)
  3. indirectly import Buffer could leads unexpected behavior

This PR remove node.js dependency, instead now uses pika and web api directly to reduce the bundle hack, bundle size and more explicit imports

Motivation and Context

For more context, docusaurus will raise error if use nolyfill

telegram-cloud-photo-size-5-6138468470803777616-y

How Has This Been Tested?

Try this in demo and everything works

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

sserrata reacted with thumbs up emoji
Copy link

github-actions bot commented Feb 7, 2025
edited
Loading

Visit the preview URL for this PR (updated for commit 2e73145):

https://docusaurus-openapi-36b86--pr1081-lq3u8386.web.app

(expires 2025年3月13日 18:43:09 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

Copy link
Member

sserrata commented Feb 7, 2025

Hi @himself65, thanks for the PR...there seems to be some issues with CSR:

On initial load and route change I'm not getting past the loading skeletons:

Screenshot 2025年02月07日 at 2 23 03 PM
himself65 reacted with eyes emoji

Copy link
Contributor Author

Hi @himself65, thanks for the PR...there seems to be some issues with CSR:

On initial load and route change I'm not getting past the loading skeletons:

Screenshot 2025年02月07日 at 2 23 03 PM

thanks for checking. I see there is a process somewhere, let me check

Copy link
Collaborator

@blindaa121 blindaa121 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 the PR @himself65! For context, I believe the polyfill package was initially added to provide support for our postman library (see #422). Since this package has since been removed from the project, I think your solution should be good to go.

@sserrata Thoughts?

Copy link
Member

To clarify, node-polyfill-webpack-plugin was introduced as a convenient way to avoid defining specific loaders for modules no longer present in Webpack 5.

Our theme still relies on both the postman-code-generators and postman-collection libraries, although it's possible later updates to these libraries could have reduced or changed the need to define those loaders (e.g. url, process, etc.). We moved from forked to canonical versions of both libraries in #861.

@himself65 thanks for the work on replacing my use of zlib with the browser-ready pako! So far it appears to function as intended.

himself65 reacted with thumbs up emoji

@sserrata sserrata merged commit a86e203 into PaloAltoNetworks:main Feb 19, 2025
9 checks passed
@himself65 himself65 deleted the himself65/2024/02/07/fix branch March 10, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@blindaa121 blindaa121 blindaa121 left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /