Skip to content

fix(sanity): live preview service is called before be initialized in v18#12

Merged
osnoser1 merged 1 commit into
mainfrom
bugfix/live-preview-service
Feb 22, 2025
Merged

fix(sanity): live preview service is called before be initialized in v18#12
osnoser1 merged 1 commit into
mainfrom
bugfix/live-preview-service

Conversation

@osnoser1

Copy link
Copy Markdown
Member

PR Checklist

What is the new behavior?

This PR fixes a timing issue with the LivePreviewService initialization in v18 introduced by #9. Previously, the service was initialized effect(), which cause race conditions or initialization delays. The change add this with Angular's afterNextRender() that previously worked in v19 while it maintains the effect for v19, ensuring that:

  1. The initialization happens reactively when the token input is available
  2. The service is properly initialized before any live preview functionality is used
  3. The initialization will re-run if the token changes

Does this PR introduce a breaking change?

  • Yes
  • No

What gif best describes this PR or how it makes you feel?

[A "Perfect Timing" gif would be appropriate here since this PR fixes a timing-related issue]

@netlify

netlify Bot commented Feb 22, 2025

Copy link
Copy Markdown

Deploy Preview for limitless-angular-sanity-example ready!

Name Link
🔨 Latest commit 048872a
🔍 Latest deploy log https://app.netlify.com/sites/limitless-angular-sanity-example/deploys/67b96287f7bb0000081e4750
😎 Deploy Preview https://deploy-preview-12--limitless-angular-sanity-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nx-cloud

nx-cloud Bot commented Feb 22, 2025

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 048872a.

Command Status Duration Result
nx affected -t lint --fix ✅ Succeeded 3s View ↗
nx run sanity:build ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-22 05:39:18 UTC

@pkg-pr-new

pkg-pr-new Bot commented Feb 22, 2025

Copy link
Copy Markdown

Open in Stackblitz

npm i https://pkg.pr.new/@limitless-angular/sanity@12

commit: 048872a

@osnoser1 osnoser1 merged commit 2cd0c94 into main Feb 22, 2025
@osnoser1 osnoser1 deleted the bugfix/live-preview-service branch February 22, 2025 05:44
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.

1 participant