Skip to content

Feat: Add netlify support and update deps#20

Open
splindsay-92 wants to merge 2 commits intomainfrom
chore/update-package-deps
Open

Feat: Add netlify support and update deps#20
splindsay-92 wants to merge 2 commits intomainfrom
chore/update-package-deps

Conversation

@splindsay-92
Copy link

@splindsay-92 splindsay-92 commented Feb 10, 2026

This PR overhauls the current NextJs version and Ably versions, corrects token usage to the recommended way (via JWT) and adds Netlify deployment support.

Other minor changes include:

  • Update TypeScript configuration to support react-jsx.
  • Add "use client" directive to React pages for client-side rendering.
  • Update dependencies in package-lock.json, including ably, eslint, and next.js versions.
  • Refactor Next.js configuration: replace domains with remotePatterns for image handling and adjust server package settings.
    -Updated token generation to use the preferred JWT method.

- Update TypeScript configuration to support `react-jsx`.
- Add `"use client"` directive to React pages for client-side rendering.
- Update dependencies in `package-lock.json`, including `ably`, `eslint`, and `next.js` versions.
- Refactor Next.js configuration: replace `domains` with `remotePatterns` for image handling and adjust server package settings.
-Updated token generation to use the preferred JWT method.
@splindsay-92 splindsay-92 requested a review from Copilot February 10, 2026 09:05
@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ably-nextjs-fundamentals-kit Error Error Feb 16, 2026 9:39am

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the project to newer Next.js/TypeScript tooling and adjusts client/server behavior for the Ably examples, including a refactor of the /token route to generate JWTs.

Changes:

  • Update TypeScript JSX mode to react-jsx and tweak tsconfig includes.
  • Upgrade key dependencies (Next.js, ESLint, Ably) and add jsonwebtoken (+ typings).
  • Update Next.js configuration for images (remotePatterns) and server package externals; mark several App Router pages as client components.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsconfig.json Switch JSX mode to react-jsx and adjust include paths.
package.json Upgrade Next.js/ESLint/Ably and add JWT dependencies for token signing.
next.config.js Replace images.domains with images.remotePatterns and update server externals config.
app/token/route.ts Replace Ably SDK token request generation with JWT signing logic.
app/pub-sub/page.tsx Add 'use client' directive for client-side rendering needs.
app/presence/page.tsx Add 'use client' directive for client-side rendering needs.
app/history/page.tsx Add 'use client' directive for client-side rendering needs.
app/authentication/page.tsx Add 'use client' directive for client-side rendering needs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import * as Ably from "ably";
import jwt from 'jsonwebtoken';

export async function POST(req: Request) {
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NextRequest is imported but never used in this route handler. This will trigger no-unused-vars under next/core-web-vitals; remove it from the import or change the handler signature to use NextRequest if needed.

Suggested change
export async function POST(req: Request) {
export async function POST(req: NextRequest) {

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
const apiKey = process.env.ABLY_API_KEY;
const [keyName, keySecret] = apiKey.split(':');

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apiKey is typed as string | undefined (because process.env.* values are optional), so apiKey.split(':') will fail TypeScript strict type-checking. Capture the env var into a local const apiKey = process.env.ABLY_API_KEY and validate apiKey (or use a non-null assertion after validation) before calling .split().

Copilot uses AI. Check for mistakes.
Comment on lines +21 to 23
"jsonwebtoken": "^9.0.3",
"next": "^16.1.6",
"random-names-generator": "^1.0.2",
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next@16.1.6 declares engines.node >= 20.9.0 (per the resolved package metadata in package-lock.json). Consider adding a matching "engines" entry (and/or documenting it) so deploy/runtime environments don’t accidentally use an unsupported Node version.

Copilot uses AI. Check for mistakes.
@splindsay-92 splindsay-92 requested a review from VeskeR February 12, 2026 16:35
@splindsay-92 splindsay-92 removed the request for review from VeskeR February 16, 2026 09:36
@splindsay-92 splindsay-92 changed the title Chore: Update package deps and correct token generation Feat: Add netlify support and update deps Feb 16, 2026
…yment documentation

- Introduce wrapper components (`*Wrapper`) to simplify dynamic imports for client-side rendering.
- Update README to include Netlify deployment instructions alongside Vercel.
- Add `netlify.toml` for Netlify deployment support.
- Install `@netlify/plugin-nextjs` as a dev dependency for Netlify compatibility.
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