Generate Design CSS in the asset pipeline, not mix compile - #126
Open
karim-semmoud wants to merge 3 commits into
Open
Generate Design CSS in the asset pipeline, not mix compile#126karim-semmoud wants to merge 3 commits into
karim-semmoud wants to merge 3 commits into
Conversation
Remove Mix.Tasks.Compile.CorexDesign and stop injecting :corex_design into compilers. Keep mix corex.design.build as the only generator, wired through assets.build / assets.deploy. Scaffold corex_design as runtime: false in every Mix env so MIX_ENV=prod mix assets.deploy can run the task. Co-authored-by: Karim Semmoud <karim-semmoud@users.noreply.github.com>
karim-semmoud
marked this pull request as ready for review
August 26, 2026 10:41
Mark corex_design as runtime: false like generated apps, load it in the Gigalixir release so Accessibility helpers stay available, and hook mix assets.deploy from the phoenix-static compile script so production no longer relies on mix compile to emit CSS. Co-authored-by: Karim Semmoud <karim-semmoud@users.noreply.github.com>
Preference CSS is still a mix corex.design.build asset. Runtime: false and corex_design: :load are Mix packaging, not per-request generation. Document mix release :load for --a11y apps. Co-authored-by: Karim Semmoud <karim-semmoud@users.noreply.github.com>
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.
Design CSS is generated by
mix corex.design.buildas a Phoenix asset step (same layer as Tailwind/esbuild), not duringmix compile.Why
A Mix compiler is the wrong layer for CSS: it writes outside
_build, hashes source trees on every compile, doubles work withassets.build, and breaksMIX_ENV=prod mix assets.deploywhencorex_designisonly: :dev.Changes
Mix.Tasks.Compile.CorexDesign.:corex_designintocompilersinmix corex.new/ Tableau scaffolds and e2e.mix corex.design.buildas the only generator, already wired throughassets.build/assets.deploy.{:corex_design, "~> 0.2", runtime: false}in every Mix env (noonly: :dev) so prodassets.deploycan run the Mix task.runtime: falsepluscorex_design: :loadin the release so Accessibility helpers stay in the Gigalixir slug. Mix.Release omitsruntime: falseapps unless listed.:loaddoes not start Design or rebuild CSS.--a11yrequest path only setsdata-*on<html>(same as theme/mode). Preference CSS was already emitted by the design build.corex_design: :loadfor generated--a11yapps that usemix release(Accessibility, Production).mix corex.design.buildafterconfig :corex_designchanges.mix compiledoes not regenerate CSS.Test plan
mix corex.design.build)design_guidea11y/mix releasewordingmix compile+mix corex.design.build+MIX_ENV=prod mix release(corex_design present in the slug)