Repository navigation
refactor: live style resolution and refresh docs/deps - #9
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors LiveStyle’s manifest/storage representation and runtime attribute resolution to support deterministic traversal with faster put/get operations, while improving incremental build hygiene (stale module/usage cleanup) and updating docs/dependencies to match the current public API.
Changes:
- Refactor
LiveStyle.Manifestcollections from sorted lists to map-backed storage, addingentries/2,count/2, and list-backed serialization for disk writes. - Introduce runtime attr payload/merging refactor (
LiveStyle.Runtime.StyleMerger) and updatecss/1,2static outputs to carry merge metadata for component spreads. - Add stale per-module data + stale usage cleanup during manifest merge; extend property validation into conditional and pseudo-element processors; refresh docs and dependency versions.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/live_style/storage_test.exs | Updates storage expectations for map-backed manifests; adds tests for stale module/usage cleanup. |
| test/live_style/property_validation_test.exs | Adds regression tests for validation errors in conditional + pseudo-element processors. |
| test/live_style/manifest_test.exs | Updates manifest tests to use map-backed collections and deterministic entries/2 traversal. |
| test/live_style/css_statics_test.exs | Updates static css() expectations to return LiveStyle.Attrs payload for merge metadata and spread behavior. |
| test/live_style/compiler/module_hash_test.exs | Updates module hash tests to use Manifest.entries/2 + Manifest.count/2. |
| README.md | Updates theming API references and dependency version examples. |
| mix.lock | Refreshes locked dependency versions. |
| mix.exs | Updates deps (runtime flags, versions), ExDoc configuration, and module grouping/filtering for docs. |
| lib/mix/tasks/live_style.audit.ex | Extracts unused-class output formatting into a helper for reuse/clarity. |
| lib/live_style/when.ex | Updates docs/examples to reflect marker usage via css/1 spreads; adds targeted docs for custom-marker overloads. |
| lib/live_style/types.ex | Adjusts transform_list/1 docs to match string-based transform function inputs. |
| lib/live_style/storage.ex | Adds stale cleanup before merge; cleans stale usage after merge; serializes manifest deterministically on disk writes. |
| lib/live_style/shorthand_behavior/forbid_shorthands.ex | Fixes docs to reference expand_declaration/2. |
| lib/live_style/shorthand_behavior/accept_shorthands.ex | Updates moduledoc to describe longhand tracking/merge behavior more accurately. |
| lib/live_style/shorthand_behavior.ex | Updates shorthand behavior summary text to match new semantics. |
| lib/live_style/runtime/style_merger.ex | New module encapsulating runtime merge state + class/style merging logic. |
| lib/live_style/runtime/attrs.ex | Refactors runtime resolution to use StyleMerger and handle static-ref payloads in %LiveStyle.Attrs{}. |
| lib/live_style/marker.ex | Updates docs/examples to use css([marker(...)]) spreading style. |
| lib/live_style/manifest.ex | Converts collections to map-backed storage; adds entries/2, count/2, and to_serializable/1; normalizes on load. |
| lib/live_style/dev.ex | Extracts class diff output into helpers for readability. |
| lib/live_style/config.ex | Updates config docs around manifest/usage paths and validation-related settings text. |
| lib/live_style/compiler/module_data.ex | Adds source fingerprinting, stale module cleanup, batched usage writes, and stale usage cleanup. |
| lib/live_style/compiler/css/writer/stats.ex | Uses Manifest.count/2 for stats with map-backed manifests. |
| lib/live_style/compiler/css/view_transition_classes.ex | Uses deterministic Manifest.entries/2 traversal for view transition classes. |
| lib/live_style/compiler/css/vars.ex | Uses deterministic Manifest.entries/2 traversal for vars generation. |
| lib/live_style/compiler/css/theme_classes.ex | Uses deterministic Manifest.entries/2 traversal for theme class generation. |
| lib/live_style/compiler/css/position_try.ex | Uses deterministic Manifest.entries/2 traversal for position-try generation. |
| lib/live_style/compiler/css/pipeline.ex | Uses Manifest.count/2 for pipeline stats; aligns with map-backed manifest. |
| lib/live_style/compiler/css/keyframes.ex | Uses deterministic Manifest.entries/2 traversal for keyframes generation. |
| lib/live_style/compiler/css/dynamic_properties.ex | Uses deterministic Manifest.entries/2 traversal for dynamic @property generation. |
| lib/live_style/compiler/css/classes/collector.ex | Switches to Manifest.entries/2 and updates comments assuming list-backed ordering. |
| lib/live_style/compiler.ex | Updates docs/example output to reflect current CSS output style. |
| lib/live_style/class/processor/pseudo_element.ex | Adds property validation support (config-gated) for pseudo-element declarations. |
| lib/live_style/class/processor/conditional.ex | Adds property validation support (config-gated) for conditional declarations. |
| lib/live_style/attrs.ex | Extends prop_classes type to support static-ref sources; updates to_list/1 behavior and protocols. |
| lib/live_style.ex | Refactors css() static output to carry merge metadata, introduces compile-time usage batching, and updates docs accordingly. |
| guides/theming.md | Updates JS integration guidance around theme class handling (dark vs default light). |
| guides/styling-components.md | Clarifies breakpoint constant format and @media usage pattern. |
| guides/getting-started.md | Updates dependency examples/version and setup guidance. |
| guides/design-tokens.md | Updates breakpoint constant format and expands token type table; refreshes suggested module layout. |
| guides/configuration.md | Expands configuration options table (paths, validation levels, prefixes, etc.). |
| guides/advanced-features.md | Updates marker usage examples and revises browser-support wording to be less version-specific. |
| config/config.exs | Scopes :git_ops configuration to :dev and adjusts managed files settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lifeiscontent
force-pushed
the
feat/cleanup
branch
from
May 6, 2026 08:45
b139dc9 to
5348868
Compare
Comment on lines
+152
to
160
| @doc """ | ||
| Converts the manifest to a deterministic list-backed representation for disk. | ||
| """ | ||
| @spec to_serializable(t()) :: t() | ||
| def to_serializable(manifest) do | ||
| Enum.reduce(@collections, manifest, fn collection, acc -> | ||
| Map.put(acc, collection, entries(acc, collection)) | ||
| end) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
mix docs --warnings-as-errorsmix format --check-formattedmix compile --warnings-as-errorsMIX_ENV=test mix compile --warnings-as-errorsmix testmix credo --strictmix dialyzergit diff --check