feat(pack): allow emit seperate css when building library - #2598
Conversation
Summary of ChangesHello @xusd320, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the library chunking context by introducing a dedicated mechanism for customizing filenames of non-evaluate chunks. This allows for more granular control over the output structure, particularly enabling the emission of separate CSS files during library builds, by providing a new 'chunk_filename' template that supports dynamic placeholders like '[name]' and '[contenthash]'. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature by allowing customizable filenames for non-evaluate chunks, which is particularly useful for emitting separate CSS files. The implementation is solid and follows the intended design. I have one suggestion to refactor a block of code to improve its readability and maintainability by reducing nesting. Overall, great work!
📊 Performance Benchmark Report (with-antd)Utoopack Performance ReportReport ID: Executive SummaryKey Findings
Workload Distribution by Tier
Parallelization AnalysisThread Utilization
Assessment: With 5 working threads, achieving 3.2x parallelism indicates significant loss of potential parallelism. Top 20 Tasks by Total Duration
Deep Dive by TierTier 1: Runtime & Resolution (P0)Focus: Task scheduling and dependency resolution.
Potential P0 Issues:
Tier 2: Physical & Resource Barriers (P1)Focus: Hardware utilization, I/O, and heavy monoliths.
Tier 3: Architecture & Asset Pipeline (P2-P3)Focus: Global state and transformation pipeline.
Duration Distribution
Diagnostic Signal Summary
Action Items (P0-P4)
Report generated by Utoopack Performance Analysis Agent on 2026-02-12 |
This pull request adds support for customizable chunk filenames in the library chunking context, allowing users to specify a separate filename template for non-evaluate chunks. The changes introduce a new
chunk_filenamefield, update the builder pattern to support it, and modify the chunk path logic to use this template when appropriate.Chunk filename customization:
chunk_filenamefield to theLibraryChunkingContextstruct to store a non-evaluate chunk filename template. [1] [2]LibraryChunkingContextBuilderwith a new.chunk_filename()method to set the chunk filename template.ChunkingContextimplementation to use thechunk_filenametemplate for non-evaluate chunks, including support for name and content hash placeholders. [1] [2]Integration with library context creation:
get_library_chunking_contextto set bothfilenameandchunk_filenameon the builder when in production mode, based on the output configuration.Hashing utility import:
hash_xxh3_hash64function to support content hash replacement in chunk filenames.