Skip to content
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

[0.5.x] [BREAKING] Require Precognition-Success header #41

Merged
merged 2 commits into from
Aug 25, 2023
Merged

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Aug 24, 2023

🚨 Breaking change. Requires a major version bump, i.e., 0.5.x.

We introduced a new header to determine if Precognition was truly successful.

To ease migration and not impact existing applications using Precognition that had not yet updated to v10.11.0 (2023-05-16), I intentionally delayed adding it to our JS package.

With the introduction of the testing helpers, I felt this was a good time to make this breaking change and bring everything inline.

This is now a required header for responses, meaning that when this new version is tagged - consuming Laravel applications will need to update to ^10.11.0.

For applications that have not yet updated to ^10.11.0, you may put the following in your bootstrap.js or app.js to maintain the previous functionality until you can update your Laravel framework version.

VueJS + Inertia

import {client} from 'laravel-precognition-vue-inertia'

client.determineSuccessUsing(response => response.status === 204)

VueJS

import {client} from 'laravel-precognition-vue'

client.determineSuccessUsing(response => response.status === 204)

React + Inertia

import {client} from 'laravel-precognition-react-inertia'

client.determineSuccessUsing(response => response.status === 204)

React

import {client} from 'laravel-precognition-react'

client.determineSuccessUsing(response => response.status === 204)

@taylorotwell taylorotwell merged commit b4f47f7 into main Aug 25, 2023
@taylorotwell taylorotwell deleted the success branch August 25, 2023 13:36
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