- A unified experience for web development! -
Empowering dreams, pushing boundaries, and exploring limitless possibilities.
Fresh perspectives and updates
We asked: Why complicate things? So I made a headless CMS where content is file based, and theme controlled.
"We built the PHPue Headless CMS so you didn't have to"
Check the repo. Let me know what you think:
We discovered that AlpineJS and PHPue Framework works flawlessly, apart from that "x-for" attribute, which was far from what we needed. After some research, we found there was 3 issues, and 1 pull request with AlpineJS:
The creator of PHPue Framework created a extension for AlpineJS, that introduces a x-ssr attribute! This is similar to x-for, though it respects what HTML blocks exist, then you define a "csrTemplate" variable when the array changes, which holds the building blocks for CSR controlled elements!
(This may feel like a sacrifice for DX, although, the choice derived from lack of performance, from how x-for was handled!)
Usage (The extension is still new, so any bugs, please create issues, and if you are down to contribute, fork and edit /assets/js/phpue-ext-csr/alpine.ext.prod.ssr.js, and minify the file
(I used https://www.minifier.org/):
<div x-data="customDataHandler">
<ul x-ssr="varArrayName">
<li p-for="$item in $items">{{ $item }}</li>
</ul>
</div>
(OR)
(Managed by customDataHandler and csrTemplate! (just like x-for, but the definition is inside customDataHandler))
<ul x-data="customDataHandler" x-ssr="varArrayName">
</ul>
Checkout PHPue's AlpineJS Extension by:
PHPue Extensions - AlpineJS SSR Extension
I have tested it, not thoroughly though! (There may still be some bugs or optimisations I may have missed over!) - From my personal testing, I have not seen any errors, or development strains.
Happy developing, Edward!
#opensource #alpine #alpinejs #phpueframework #development #php #js