Skip to content

fix: dev server don't support publicPath (again)#1436

Merged
sorrycc merged 2 commits intomasterfrom
sorrycc-9mm6
Jul 23, 2024
Merged

fix: dev server don't support publicPath (again)#1436
sorrycc merged 2 commits intomasterfrom
sorrycc-9mm6

Conversation

@sorrycc
Copy link
Contributor

@sorrycc sorrycc commented Jul 23, 2024

#1398 的后续。


@whyer11

你的逻辑应该是对的。

我之前以为的逻辑是静态资源会 proxy 到 mako(rust) 的 server,我昨天验也只验了 mako(rust) server 的逻辑。刚才看代码发现,我们是基于 express.static 的逻辑才生效的。。

我先把你之前的修改再加回去,但感觉终态应该要走 mako(rust) 的 server。

Summary by CodeRabbit

  • 新特性
    • 引入了动态处理请求URL的新功能,可以根据配置自定义公共路径,提高了URL处理的灵活性。

@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2024

Walkthrough

此次更改引入了一个新函数 processReqURL,该函数根据配置中的 publicPath 修改请求 URL。通过确保 publicPath 以斜杠开头,函数能够动态调整传入的请求 URL,增强了应用程序的 URL 处理灵活性。这一变动通过中间件实现,确保在满足条件时有效应用该逻辑,从而优化了请求处理流程。

Changes

文件 更改摘要
packages/bundler-mako/index.js 新增函数 processReqURL 以修改请求 URL,提升 URL 处理灵活性。

Poem

在草地上,我欢快跳,
新函数来,URL变道。
配置随意,灵活无比,
请求如风,乐在其中。
呜呜,兔子心欢喜! 🐰✨


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 your favorite social media?

Share
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.

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.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e8a1748 and 569814c.

Files selected for processing (1)
  • packages/bundler-mako/index.js (1 hunks)
Additional comments not posted (1)
packages/bundler-mako/index.js (1)

125-130: 验证中间件的正确性

中间件集成看起来是正确的,但需要确保中间件正确应用并经过测试。请验证 opts.config.publicPath 的所有可能值,并确保 processReqURL 函数在所有情况下都能正确处理请求 URL。

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 569814c and e9a77c7.

Files selected for processing (1)
  • packages/bundler-mako/index.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/bundler-mako/index.js

@sorrycc sorrycc merged commit b29f99c into master Jul 23, 2024
@sorrycc sorrycc deleted the sorrycc-9mm6 branch August 9, 2024 03:35
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.

2 participants