Skip to content

feat: CSS subset splitting and tree-shaking for compiler - #9

Open
Roy-Wanyoike wants to merge 1 commit into
mainfrom
feat/css-subset-splitting
Open

feat: CSS subset splitting and tree-shaking for compiler#9
Roy-Wanyoike wants to merge 1 commit into
mainfrom
feat/css-subset-splitting

Conversation

@Roy-Wanyoike

Copy link
Copy Markdown
Owner

Summary

Adds subset/tree-shaking support to the Ferrum compiler, enabling users to import only selected effects or categories instead of the full 542+ effect set.

Features

Method Description
selectByCategories() Import all effects from specific categories
selectByNames() Import specific effects by name
selectByPattern() Import effects matching a regex
selectAll() Import all effects
buildSubsetCSS() Generate optimized CSS for selected subset
getCategoryTree() Full category→effects tree for selection UIs

Files Added/Modified

  • src/lib/ferrum-compiler/subset.ts — SubsetSelector class |
  • src/lib/ferrum-compiler/subset-writer.ts — File output utilities |
  • src/lib/ferrum-compiler/index.ts — Added subset re-exports |
  • __tests__/ferrum-compiler-subset.test.ts — 40 tests |

Tests

  • 40 unit tests covering all selection modes, CSS generation, and edge cases

Enables users to reduce bundle size by importing only the effects they need.

Enables importing only selected effects or categories instead of the full 542+ effect set:

Features:
- selectByCategories(): Import all effects from specific categories
- selectByNames(): Import specific effects by name
- selectByPattern(): Import effects matching a regex
- buildSubsetCSS(): Generate optimized CSS for the selected subset
- getCategoryTree(): Full category→effects tree for selection UIs
- Subset manifest generation (JSON)
- Minified output option

Compiler Integration:
- Added subset exports to ferrum-compiler/index.ts
- Works with existing effect data structures

40 unit tests covering all selection modes, CSS generation, and edge cases
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ferrum-engine Error Error Aug 31, 2026 6:19pm

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.

1 participant