Skip to content

Purge PrimeNG and migrate to Tailwind CSS#1815

Open
mutatrum wants to merge 8 commits into
bitaxeorg:masterfrom
mutatrum:tailwind-css
Open

Purge PrimeNG and migrate to Tailwind CSS#1815
mutatrum wants to merge 8 commits into
bitaxeorg:masterfrom
mutatrum:tailwind-css

Conversation

@mutatrum

@mutatrum mutatrum commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

This PR purges PrimeNG and migrates to Tailwind CSS. PrimeNG stopped being open source and requires a license from version 22. We could get a license but are not allowed to ship the firmware with a license embedded, so this makes it impossible to move forward with PrimeNG.

To resolve this predicament, the following changes were made:

  • Remove PrimeNG
  • Add custom components for checkbox, dropdown, slider and tooltips
  • Migrate css variable names to Tailwind CSS standards
  • Make system page and drop downs only update on changing fields

As Tailwind CSS is much more efficient in what to pack, the size of the packages has reduced by ~25%:

Before:

Initial chunk files Names Raw size Estimated transfer size
main.js main 1.55 MB 343.55 kB
styles.css styles 378.67 kB 24.91 kB
polyfills.js polyfills 34.76 kB 11.41 kB
Initial total 1.96 MB 379.87 kB

After:

Initial chunk files Names Raw size Estimated transfer size
main.js main 1.04 MB 263.22 kB
styles.css styles 60.53 kB 11.88 kB
polyfills.js polyfills 34.76 kB 11.41 kB
Initial total 1.13 MB 286.51 kB

Follow-up of #1651.
Supersedes #1800 and mutatrum#10

To keep the scope slightly smaller ahem, this PR does not upgrade Angular,, does not replace toastr with a native component nor replaces moment.js with Intl. As always with these changes, package-lock.json causes a big chunk of the diff with +657/-313, so the net diff of this PR is +1703/-1289. Biggest impact is all .html files are changed a lot.

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

Test Results

  2 files  ±0    2 suites  ±0   1s ⏱️ -1s
110 tests +7  110 ✅ +7  0 💤 ±0  0 ❌ ±0 
112 runs  +7  112 ✅ +7  0 💤 ±0  0 ❌ ±0 

Results for commit 2829352. ± Comparison against base commit 55c7d8c.

♻️ This comment has been updated with latest results.

@WantClue

Copy link
Copy Markdown
Collaborator

Tailwind establishes theme, base, components, utilities, after which layout is declared. Consequently, layout declarations such as .card { margin-bottom: 1rem } override utilities such as mb-0 despite equal specificity. Several Home and Swarm cards rely on those utilities. Define the complete layer order before importing Tailwind, with utilities last.

@WantClue

Copy link
Copy Markdown
Collaborator

Classes constructed as 'text-' + swarmColor + '-500' are invisible to Tailwind’s scanner. The generated CSS lacks text-purple-500, text-cyan-500, and text-gray-500, so several device models lose their intended color. Return complete literal class names or safelist all possible values.

@WantClue

Copy link
Copy Markdown
Collaborator

HomeComponent uses app-dropdown without importing DropdownComponent; SwarmComponent similarly omits SliderComponent. Their fixtures should fail template creation once the browser executes the tests.

@mutatrum

mutatrum commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator Author

Tailwind establishes theme, base, components, utilities, after which layout is declared. [...]

Added layer config, which made some margin classes work like they should. Good observation!

Classes constructed as 'text-' + swarmColor + '-500' are invisible to Tailwind’s scanner. [...]

Should be fixed now. No more compound class names in use.

HomeComponent uses app-dropdown without importing DropdownComponent; SwarmComponent similarly omits SliderComponent. Their fixtures should fail template creation once the browser executes the tests.

Improved test harnass, some cases were not tested so missing imports didn't break the tests. Also, tests now fail on any console error.

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