Repository navigation
Upgrade Sweet Alert to v8 - #112
Merged
Merged
Conversation
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.
Replaces #109. That Dependabot PR only bumped
composer.json, and v8 is a rewrite, so on its own it broke every page (Target class [RealRashid\SweetAlert\ToSweetAlert] does not exist) and would have stopped the deploy.Changes
realrashid/sweet-alert7.3.2 → 8.0.0.ToSweetAlertmoved toRealRashid\SweetAlert\Http\Middleware\ToSweetAlert(bootstrap/app.php). It still turns thetoast_success/toast_errorflashes from the contact form and the honeypot into toasts. Pint also replaced the fully qualified class names in that file with imports.config/sweetalert.phpis the v8 file, because v8 renamed most keys (alwaysLoadJS→always_load_js, and so on). The toast settings keep this site's v7 values: positiontop, auto close on, 5 seconds. Validation errors still show as toasts, as before.SWEET_ALERT_MIDDLEWARE_TIMER(wasSWEET_ALERT_MIDDLEWARE_ALERT_CLOSE_TIME). No environment file here sets either.resources/views/vendor/sweetalert/alert.blade.php, which came from an earlier version and loadedsweetalert.all.js. The layout uses v8's@sweetAlertdirective. v8's view loads SweetAlert2 from jsDelivr and the package'svendor/sweetalert/sweet-alert.js.sweetalert:publishtoalert:publish. The task is nowartisan:alert:publish, runningphp artisan alert:publish --assets --force, which publishespublic/vendor/sweetalert/sweet-alert.jsinto each release (public/vendorisn't in git).php artisan alert:upgrade --dry-runreports nothing left to rewrite.Tests
ContactFormTest: new test that, after sending the contact form, the page the user lands on loadssweet-alert.jsand shows "Contact message sent successfully." It fails without the middleware.vendor/bin/pest --compact: 49 passed, 2 skipped.php artisan view:cacheandyarn run productionsucceed.To verify on development
artisan:alert:publishstep succeeds, andpublic/vendor/sweetalert/sweet-alert.jsexists in the new release.