Skip to content

refactor: live style resolution and refresh docs/deps - #9

Merged
lifeiscontent merged 3 commits into
mainfrom
feat/cleanup
May 6, 2026
Merged

lifeiscontent merged 3 commits into
mainfrom
feat/cleanup

Conversation

@lifeiscontent

@lifeiscontent lifeiscontent commented May 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Refactor LiveStyle resolution so static and runtime paths share merger behavior and component spreads preserve override metadata.
  • Rework module data, manifest lookups, usage tracking, and stale cleanup around batched compiler-pass data while keeping serialized CSS deterministic.
  • Tighten helper signatures and split runtime/static ref processing to reduce unused context and clarify ownership.
  • Update dependency configuration, GitOps README/version management, and public ExDoc module curation.
  • Refresh guides and generated docs for current APIs, markers, theming, browser support, dependency versions, and setup details.

Validation

  • mix docs --warnings-as-errors
  • mix format --check-formatted
  • mix compile --warnings-as-errors
  • MIX_ENV=test mix compile --warnings-as-errors
  • mix test
  • mix credo --strict
  • mix dialyzer
  • git diff --check

Copilot AI review requested due to automatic review settings May 6, 2026 08:14
@lifeiscontent lifeiscontent self-assigned this May 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Manifest collections from sorted lists to map-backed storage, adding entries/2, count/2, and list-backed serialization for disk writes.
  • Introduce runtime attr payload/merging refactor (LiveStyle.Runtime.StyleMerger) and update css/1,2 static 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.

Comment thread lib/live_style/runtime/style_merger.ex
Comment thread mix.exs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.

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
@lifeiscontent
lifeiscontent merged commit 4ee0fc9 into main May 6, 2026
6 checks passed
@lifeiscontent
lifeiscontent deleted the feat/cleanup branch May 6, 2026 09:15
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