I had sometime to put together a small demo app. I decided to try out CBWire, Quick and Tailwind + DaisyUI. This was the first time I had used that particular set of tools and I was honestly really impressed. Even without any prior experience with CBWire or livewire it felt very natural and easy to pickup.
That being said I did notice a few things I wanted to bring up/get some feedback on.
A lot of the component examples start with
<!-- Template -->, which is unfortunate because that prevents the component from loading. At first I thought it was a bug until I came across this github issue. If I can make a suggestion it would be to either resolve the issue and allow comments on the first line or at least change the documentation so it doesn’t cause people to error when they copy/paste.
I was able to create nested components just fine. That was easy. After a bit I wanted to try and create conditional components, something like
<cfoutput> <div> <cfif loggedIn> #wire("secureCompnent")# <cfelse> #wire("loginForm")# </cfif> </div> </cfoutput>
No matter what I tried it would always render the component that was first loaded - either secureComponent or loginForm depending on what the value of
loggedIn was at the first load. Eventually I decided to refactor my code to use separate views and eliminate the condition. That worked fine. Is conditional rendering a thing and I just couldn’t get it right?
I was curious about how one might go about securing CBWire components. It isn’t obvious to me how you would secure individual components. Sure the pages they are loaded on would be easy to secure but since the module registers a single endpoint it seems like it would be easy to secure your pages but forget to secure your CBWire components. Would you recommend creating CBSecurity rules based on component names?
Lots of questions! No rush! Like I said, just working on a personal project and trying out new things. Thanks for the work you put into CBWire. It’s awesome! Looking forward to using it on something that sees the light of production deployment