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

perf: parallel ast to code #1053

Merged
merged 22 commits into from
Apr 16, 2024
Merged

perf: parallel ast to code #1053

merged 22 commits into from
Apr 16, 2024

Conversation

xusd320
Copy link
Contributor

@xusd320 xusd320 commented Apr 15, 2024

Close #451

测试 with-antd

  • 启动:744ms -> 483ms ⬇️35%
  • full rebuild: 356ms -> 107ms ⬇️70%
image image

Summary by CodeRabbit

  • Refactor

    • Updated source map generation functions for improved performance.
    • Simplified logic in the use_eval function.
    • Split build_source_map function into smaller, more manageable functions.
    • Renamed and restructured functions for better organization.
  • Chores

    • Removed deprecated devEval configuration field.
    • Updated import statements for consistency and clarity.
  • Documentation

    • Updated documentation to reflect changes in configuration and functionality.

@xusd320 xusd320 requested review from sorrycc and stormslowly April 15, 2024 10:09
Copy link
Contributor

coderabbitai bot commented Apr 15, 2024

Walkthrough:

A harmonious melody of updates graces the Mako project, focusing on refining source map management and code logic. Notable changes include the introduction of new functions, restructuring of source map generation, and enhancements to code structure for improved clarity and maintainability.

Changes:

File Change Summary
css_ast.rs, js_ast.rs Updated source map handling functions and introduced base64_encode dependency.
chunk_pot.rs, util.rs Renamed and refactored functions related to source map handling and logic simplification.
ast_impl.rs, str_impl.rs Refactored source mapping functions and imports for improved organization.
config.rs Removed dev_eval field and added chunk_parallel field to Config struct.
generate.rs, sourcemap.rs Updated imports and functions related to source map handling.
visitors/react.rs Introduced new structs for span cleaning and source map duplication handling.
docs/config.md, binding.d.ts Updated documentation and added interface for transformation output handling.

Poem:

In Mako's realm, changes dance in glee,
Source maps polished, logic set free.
A rabbit's touch, code sings with might,
Paths simplified, in logic's light.
Mako's world now sparkles and gleams,
With updates fresh, in code's dreams.

Note

Pull Request 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://coderabbit.ai


Commits Files that changed from the base of the PR and between 2e4f357 and 116015d.
Files selected for processing (1)
  • crates/mako/src/visitors/react.rs (3 hunks)

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.

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

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

CodeRabbit Configration 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.

@xusd320 xusd320 force-pushed the perf/parallel-ast-to-code branch from 599156a to db33e1c Compare April 15, 2024 11:18
@xusd320 xusd320 requested a review from stormslowly April 16, 2024 02:28
@xusd320 xusd320 merged commit aa1a90e into master Apr 16, 2024
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the perf/parallel-ast-to-code branch April 16, 2024 03:34
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.

ast to code 提速思路
3 participants