-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#184: Use Volt for blog #206
Merged
Merged
Conversation
This file contains 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
This also strips down most of the post indexing stuff from original version, so need to figure out a better way to add the same filters back in.
Also added optional wire navigation to a number of elements—AND DISCOVERED A BUG.
NOT FIXED YET. Just used a dummy project to smoke out some issues with how testing changed recently.
Was very outdated, including having some vars that didn't exist anymore in the new example file, missing some that were added, and missing some renames.
Add a Livewire and Volt helpers for quickly checking that components can mount. Also discovering there's something wrong with finding the database. Sometimes it's there, sometimes the necessary tables are there...other times, not.
Don't try to create models before tests start, otherwise the DB connection won't be ready.
For some reason, Pennant's table isn't available before tests are run. To get around this, Pennant feature storage will use the array driver as suggested here: https://laravel.com/docs/11.x/pennant#store-configuration
Allow manually setting a created post 'published' to check that this component can render (duh, it can't if the post isn't published).
Was complaining about not being able to drop indexes because they didn't exist, meaning it was happening when running migration `down()` methods. Now these migrations conditionally check if the indexes exist before trying to drop them.
This will be helpful for locating HTML in tests...maybe.
Tests work, but the 1 test in BlogPostTest is flaky. I tried explicitly setting the `publish` and `published_at` states for the 1 post I'm passing in to guarantee it'll be published, but it's not working... And it's literally just for this 1 test. In BlogIndexTest, it seems to be consistent...or is it?
I undid some bad factory design from a while ago to hopefully fix this, but overriding these fields still appears to not work. Why...?
Thinking it was a combination of things: - using '->afterMaking()' directly in the factory instead of '->state()' - passing static closures to methods that use closure binding under the hood Had some help from Zach smoking this out and refactoring a bit. Now: - Generated posts are unpublished by default - The randomness idea is contained in a dedicated factory method for when I definitely want it - Setting 'published' explicitly is now its own factory method Co-authored-by: The Zach <[email protected]>
Need to customize 404 message: - shouldn't use 'no query results for model' - shouldn't include the class name - probably should say page or post not found
Before I was loading the old GA component—which is fine for Blade, but it doesn't work for Livewire due to slots replacing stacks. So GA will now be configured in a Volt component as well. I think some of the leftover vanilla GA stuff will need to become Alpine components.
Restructured a bit and fixed a super annoying "expression not defined" issue with existing Alpine stuff. 1. The cookie popup is now its own partial. This makes far more sense because it's not REALLY part of the whole Google Analytics thing. It just hooks into part of it. 2. Google Analytics is a Volt component now, which means Alpine is pulled in directly. There's no need to load Alpine separately anymore. 3. A separate Alpine global file actually does exist now, for if it's ever needed. It shouldn't be, but it's there just in case. 4. All the old GA and popup stuff is removed since both are set up different ways now. 5. The listener for that custom event is now collocated with the actual handler. Don't know why I didn't do this before, it makes FAR more sense this way.
Since we're back on this train...
Forgot I allow the details of the failure through outside of prod.
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.
The blog is now rendered using Volt components. This was done to make pagination nicer, and to prep for adding search later.
Clicking into an individual blog post also uses Volt now.
Resolves #184