Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cb8ca2d to
7bbf38b
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7bbf38b to
9b4f86d
Compare
splindsay-92
left a comment
There was a problem hiding this comment.
Before I start the review, I checked the ticket which states this is a Getting started guide for NextJS and React using Pub/Sub. Is this guide supposed to just be a NextJS with plain ably-js, is there a NextJS + React coming too? :)
Oops, that's where lack of experience in platforms can bite. I wasn't aware that it's possible to use ably differently with NextJS (plain and hooks) to even ask this question. And now I'm not sure whether it worth two separate guides or put second set of code blocks into the same guide or go solo on hooks variant. WDYT @m-hulbert @splindsay-92 |
No worries at all! If you checkout https://github.com/ably/ably-nextjs-fundamentals-kit, this shows best practice for using ably-js react hooks and providers with NextJS (there are some gotchas which is why we put this together) :) My personal opinion is that a common use-case is Vercel + NextJS + React as a stack, so it would be good to either have a built example app or a guide for NextJs + React at least :) |
|
I think we should have them as standalone guides rather than trying to mix languages in the getting started ones. As Steven says, React + NextJS has a few things that trip people up, so I think it would be worth updating to use hooks if you don't mind @maratal |
@splindsay-92 @m-hulbert I asked claude and this is the response: |
React hooks rewriteUpdated the guide to use the new React hooks from ably/ably-js#2187 ( Structure changeThe monolithic
Key changesSSR handling: The previous guide created the Ably client inside Activation ( Channel subscriptions ( Realtime messages: Error handling: Service worker: unchanged. |
Replace the monolithic PushPage component with four focused components using usePushActivation, usePush, useAbly, useChannel, AblyProvider, and ChannelProvider from ably/react. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8045469 to
c60c953
Compare
client.push.admin.publish and channel.publish snippets now sit alongside the CLI commands in Steps 3 and 4. Dedicated Step 5 removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Push events are not channel-specific, so the listener belongs in PushApp rather than ChannelSubscription. Added as a new subsection in Step 3 alongside the service worker setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 'use client' to page.tsx snippet - Lift device ID display above the log area in PushApp - Pass onDeviceChange callback through PushActivationBanner - Move Clear button below the log in NotificationLog - Reduce flex gap from 20px to 10px Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Recommend the ably-nextjs-fundamentals-kit for production Next.js apps instead of dynamic(ssr:false), per Steven Lindsay's review feedback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0746a3a to
0c31cd0
Compare
6252bdd to
062fb4f
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Separating shell and javascript into distinct Code blocks prevents selecting the shell tab from breaking js-only code blocks on the page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Description
Getting started guide for NextJS and React using Pub/Sub.
https://ably.atlassian.net/browse/DX-531
Checklist