Skip to content

Convert the server in worker from Express to Fastify#398

Merged
alexeyr-ci merged 4 commits intomasterfrom
alexeyr/fastify
Aug 14, 2024
Merged

Convert the server in worker from Express to Fastify#398
alexeyr-ci merged 4 commits intomasterfrom
alexeyr/fastify

Conversation

@alexeyr-ci
Copy link
Copy Markdown
Contributor

@alexeyr-ci alexeyr-ci commented Apr 22, 2024

Summary by CodeRabbit

  • New Features

    • Switched from Express to Fastify for improved performance and efficiency.
    • Added form-auto-content for enhanced functionality.
    • Introduced saveMultipartFile function to streamline multipart file handling.
  • Bug Fixes

    • Enhanced error handling in the application to prevent unhandled promise rejections.
    • Improved file upload handling and error messages.
  • Tests

    • Refactored test cases to align with the new dependencies and functionality, enhancing type safety.
  • Chores

    • Updated ESLint configuration to allow the use of for-of loops and added rules for better promise handling.
    • Transitioned build configuration from Webpacker to Shakapacker for improved dependency management.

Copy link
Copy Markdown
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

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

LGTM. Merge if you are confident.

@alexeyr-ci
Copy link
Copy Markdown
Contributor Author

alexeyr-ci commented Apr 24, 2024

@justin808 While double-checking, I noticed a strange issue with logs saying [RORP] info: Bundle /home/alexey/shaka/react_on_rails_pro/spec/dummy/.node-renderer-bundles/48c31915923a72e56f5c0fb34d72229b.js needed, but none saved yet. Worker: 14 even though the file definitely exists (running integration_spec.rb, which shouldn't clean .node-renderer-bundles between runs). I don't know if it's a pre-existing issue, but want to resolve it before merging.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 12, 2024

Walkthrough

The updates emphasize a transition from Express to Fastify, enhancing performance and modernizing the codebase. Key modifications include refining file handling, adjusting ESLint configurations for improved practices, and streamlining dependency management. These changes aim to boost request handling efficiency and align the project with contemporary standards in web development.

Changes

File(s) Change Summary
.eslintrc Disabled no-restricted-syntax for for-of loops in Node environments; added allowance for safe promises in Fastify.
package.json Transitioned from express to fastify, added new dependencies, and removed outdated ones.
src/.../ReactOnRailsProNodeRenderer.ts, src/.../worker/authHandler.ts, src/.../worker/checkProtocolVersionHandler.ts Updated function signatures to use FastifyRequest instead of Request.
src/.../shared/utils.ts Introduced saveMultipartFile function; updated Asset interface for better file management.
src/.../worker.ts, src/.../handleRenderRequest.ts Migrated to Fastify, adjusted request handling, and streamlined bundle handling.
tests/.../handleRenderRequest.test.ts, tests/.../worker.test.ts Refactored test suites for clarity and type safety; removed supertest in favor of Fastify's inject method.

Poem

In code's dance, Express steps aside,
Fastify leaps with joy and pride.
Files refactored, dependencies anew,
Rabbit's song sings of changes true.
Worker's tale, a transformation grand,
Fastify's embrace, across the land. 🐇🌟


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@justin808
Copy link
Copy Markdown
Member

@alexeyr can you rebase on master and let me know if ready to merge?

@alexeyr-ci alexeyr-ci force-pushed the alexeyr/fastify branch 4 times, most recently from 4b54fca to f379d9d Compare July 26, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants