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

Refactor/puppeteer core fix dec11 #114

Merged
merged 10 commits into from
Dec 11, 2023
Merged

Conversation

al1abb
Copy link
Owner

@al1abb al1abb commented Dec 11, 2023

Changes

  • Updated puppeteer-core version to ^21.5.0. This fixes security issues related to the old puppeteer-core version
  • Moved puppeteer package to devDependencies
  • Moved @sparticuz/chromium library to dependencies
  • Marked puppeteer-core as external in the next config

Summary by CodeRabbit

  • New Features

    • Introduced an experimental feature to improve server-side rendering capabilities.
  • Bug Fixes

    • Updated the PDF generation service with the latest Chromium package for enhanced stability and performance.

@al1abb al1abb added the feature New feature or request label Dec 11, 2023
Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
invoify ✅ Ready (Inspect) Visit Preview Dec 11, 2023 9:59am

Copy link

coderabbitai bot commented Dec 11, 2023

Walkthrough

The recent updates include an experimental feature in the Next.js configuration to treat "puppeteer-core" as an external package during server-side rendering. Additionally, the service responsible for generating PDFs has been revised to download a newer version of the Chromium package, ensuring compatibility and potentially introducing performance improvements or security patches.

Changes

File Path Change Summary
next.config.js Added serverComponentsExternalPackages to experimental config, specifying "puppeteer-core" as external.
.../server/generatePdfService.ts Updated Chromium package download URL from version 116.0.0 to 119.0.0.

🐇✨
In the land of code, where the bits align,
A rabbit hopped through, with changes so fine.
"Puppeteer-core," it said, "shall external be,"
And Chromium's new garb, from v116 to v119! 🎉🚀
🐇✨

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@al1abb al1abb merged commit 0ea6107 into master Dec 11, 2023
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 744dc90 and 2b65e13.
Files ignored due to filter (2)
  • package-lock.json
  • package.json
Files selected for processing (2)
  • next.config.js (1 hunks)
  • services/invoice/server/generatePdfService.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • services/invoice/server/generatePdfService.ts
Additional comments: 3
next.config.js (3)
  • 8-10: The addition of the experimental configuration with serverComponentsExternalPackages is correct and aligns with the Next.js configuration pattern. This change will treat puppeteer-core as an external package, which is in line with the PR objectives.

  • 8-10: Verify that puppeteer-core is compatible with being listed as an external package in Next.js server components and that this change does not introduce any unexpected behavior during server-side rendering or in the built output.

  • 5-18: Generate a command to verify the changes in package.json to ensure that puppeteer has been moved to devDependencies and @sparticuz/chromium to dependencies.


The verification of the package.json file confirms that puppeteer-core has been correctly added to dependencies and is listed with the intended version ^21.5.0. Additionally, @sparticuz/chromium is also present in dependencies with the updated version ^119.0.0. However, puppeteer is still listed under devDependencies, which is consistent with the PR's objective to move it there.

Final review comment:

The changes in next.config.js and package.json align with the PR's objectives. The puppeteer-core package is correctly treated as an external package in the Next.js configuration, and the puppeteer and @sparticuz/chromium packages are appropriately placed in devDependencies and dependencies, respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant