Skip to content

v7.0.0 - #523

Open
colbyfayock wants to merge 57 commits into
mainfrom
beta
Open

v7.0.0#523
colbyfayock wants to merge 57 commits into
mainfrom
beta

Conversation

@colbyfayock

@colbyfayock colbyfayock commented Sep 26, 2024 •

Copy link
Copy Markdown
Collaborator

Includes

Resolves

Fixes #441 - v7
Fixes #137 - "use client"
Fixes #519 - Bundle Size

This is a small internal improvement that I think is worth taking. This
makes sure that the repository is using only a single package manager
and switches away from using relative paths to reach out across
workspace boundaries

cc @colbyfayock

---------

Co-authored-by: Colby Fayock <fayock@gmail.com>
@vercel

vercel Bot commented Sep 26, 2024 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
next-cloudinary Ready Ready Preview Oct 12, 2026 8:36pm UTC

Request Review

# Description

This PR switches away from tsup to preconstruct - a lesser-known but
more capable tool.

The benefits are:
- better cjs & esm setup 
- and types for the above (this should pass
https://arethetypeswrong.github.io/ checks)
- `'use client'` directive support. With this you just can just add the
directive to any of your files and Preconstruct takes care of isolating
that in its own chunk
- `package.json#exports` flexibility:
- it should be possible to add extra entrypoints with ease if you ever
need that (like `next-cloudinary/something`)
- it's also easy to use differential bundling with this, if you ever
need to ship different code for dev/prov bundles, or for
node/browser/webworker/vercel's edge-light/younameit (or perhaps for
`react-server` condition)

## Issue Ticket Number

Related to
#435

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Fix or improve the documentation
- [ ] This change requires a documentation update


# Checklist

- [x] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [x] I have created an
[issue](https://github.com/cloudinary-community/next-cloudinary/issues)
ticket for this PR
- [x] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/cloudinary-community/next-cloudinary/pulls)
for the same update/change?
- [x] I have performed a self-review of my own code
- [x] I have run tests locally to ensure they all pass
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes needed to the documentation

BREAKING CHANGE: New build tool, no longer requires `use client` directive, marking as breaking for safety
# [7.0.0-beta.1](v6.13.0...v7.0.0-beta.1) (2024-09-27)

### Features

* Switch to Preconstruct for library building ([#520](#520)) ([a35a928](a35a928))

### BREAKING CHANGES

* New build tool, no longer requires `use client` directive, marking as breaking for safety
# [7.0.0-beta.2](v7.0.0-beta.1...v7.0.0-beta.2) (2024-10-03)

### Bug Fixes

* make sure to publish types ([#528](#528)) ([b1d1f61](b1d1f61))
# [7.0.0-beta.3](v7.0.0-beta.2...v7.0.0-beta.3) (2024-10-14)

### Bug Fixes

* removed ts-ignore ([#535](#535)) ([32931c9](32931c9)), closes [#426](#426)
* use more proper type to derive `CldVideoPlayerProps` ([#537](#537)) ([65c3dd1](65c3dd1))

### Features

* added unique id generation using React's `useId()` hook ([#529](#529)) ([682f4c2](682f4c2)), closes [#493](#493)
# [7.0.0-beta.4](v7.0.0-beta.3...v7.0.0-beta.4) (2024-10-15)

### Features

* Log x-cld-error on image error ([#553](#553)) ([711c759](711c759)), closes [#512](#512)
# [7.0.0-beta.5](v7.0.0-beta.4...v7.0.0-beta.5) (2024-10-25)

### Bug Fixes

* upgrading util packages to beta which refactors type system and how props are exported ([08a60de](08a60de))
onUpload has been deprecated in favor of onSuccess since #424 and only
duplicated the success event. Remove the prop from CldUploadWidget and
CldUploadButton, and update docs examples to use onSuccess.

BREAKING CHANGE: The `onUpload` prop has been removed from
CldUploadWidget and CldUploadButton. Use `onSuccess` instead. Note that
the second argument is now an options object:
`onUpload={(result, widget) => ...}` becomes
`onSuccess={(result, { widget }) => ...}`.
…ad errors

The build downloaded dist/fonts/cloudinary_icon_for_*.svg from unpkg, but
those files don't exist for any player version, so the 404 response body
was written to disk as the SVGs. The package exports also pointed to
dist/cloudinary_icon_*.svg, which never existed (4 publint errors).

Remove the icon downloads and their export paths (the icons are inlined
in the player CSS), and make copy-assets fail when a download returns a
non-200 response instead of writing the error page as the asset.
@PaulBoye-py

Copy link
Copy Markdown
Collaborator

Hi @eportis-cloudinary, a follow-up to my scope comment above, now that testing is done on my side.

Ready for your review

  • #667: removes the deprecated onUpload callback (docs updated to onSuccess)
  • #668: removes the missing icon files from the build and package exports, and makes the build fail if a download fails

Both target beta, pass CI, and aren't part of the stack, so they can be merged on their own.

Asset-Saved Settings (#663)

I tested this with a video that has a custom poster saved in the Video Player Studio. With player v4 (#665), CldVideoPlayer shows the custom poster without any further changes; with v1 it shows the first frame. Other saved settings (colors, controls) still need the switch to cloudinary.player(), which I've noted on the issue as a follow-up.

Breaking changes for the 7.0.0 release notes

I compared every public type between 6.19.3 and beta, and compiled common v6 usage against both. This is the full list I found:

  1. Video Player v4: the default player appearance changes.
  2. Explicit aspectRatio breaks the video poster with player v4 (details in feat: upgrade Cloudinary video player from v1 to v4 #665). Workaround: also set cropMode. A fix is possible; see the question below.
  3. Package exports map: imports from paths other than next-cloudinary and next-cloudinary/dist/cld-video-player.css (for example next-cloudinary/dist/index.js) no longer resolve.
  4. onUpload removed (feat!: remove deprecated onUpload callback from CldUploadWidget #667): use onSuccess. The second argument is now an options object: onSuccess={(result, { widget }) => ...}.
  5. overlay (singular) removed from the types: use overlays. It was never applied at runtime in v6, so only the TypeScript error is new.
  6. assetType only accepts supported values (it was any string). Unsupported values such as 'raw' already threw at runtime in v6.
  7. The analytics argument no longer accepts false. In v6, false was accepted by the types but didn't actually turn analytics off.
  8. CloudinaryLoaderCldOptions now requires src (from feat: add src type to CloudinaryLoaderCldOptions interface #552). This only affects code calling cloudinaryLoader directly, which isn't documented.

New options (such as displace, hue, noise and zoompan for videos) aren't breaking.

Still waiting on you

Once these are settled, I can prepare the release notes from the list above.

@eportis-cloudinary

Copy link
Copy Markdown
Contributor

#665: unstack it and merge it into beta on its own, or keep the stack for the release?

Unstack it and merge! Sorry for stacking when it didn't really make sense.

aspectRatio poster fix: in url-loader's getVideoPlayerOptions, or locally in CldVideoPlayer?

I think this is already in the latest shipped version of url-loader? cloudinary-community/cloudinary-util@c595c99

#662 (upload widget steals focus): the cause is that the widget is created as soon as the script loads. We could either create it only when it's opened, by default in v7 (a breaking change), or keep the current default and add an opt-in prop in a later minor release (non-breaking). Either is fine with me.

Are there performance implications to creating it lazily? If not, it seems like a cleaner solution than a prop/option, and a breaking/major release seems like the perfect time to ship it.

#575 (playerRef not set on mount): you mentioned the forwardRef fix belongs in v7. The contributor's #598 still targets main and has conflicts. Should we ask them to rebase onto beta, or leave this for later?

It looks like you asked @SK1965 a couple weeks ago, and they haven't responded. Could you perhaps try to rebase? And if we are able to merge this for v7 still give them credit of course.

Supported versions: peer dependencies still allow Next.js 12+ and React 17+, but CI only tests Next.js 16 and React 19. A major release is the time to raise the floor if you want to (for example Next.js 14+ and React 18+), and to add engines.node (>=20, which matches CI).

Very happy to raise floors to any still-supported versions of these dependencies.

@PaulBoye-py
PaulBoye-py removed this pull request from stack #666 October 2, 2026 19:56
PaulBoye-py and others added 2 commits October 2, 2026 20:57
feat: upgrade Cloudinary video player from v1 to v4
# [7.0.0-beta.13](v7.0.0-beta.12...v7.0.0-beta.13) (2026-10-02)

### Features

* upgrade Cloudinary video player from v1 to v4 ([8c2e700](8c2e700)), closes [cloudinary/cloudinary-video-player#1087](cloudinary/cloudinary-video-player#1087)

### BREAKING CHANGES

* the video player's default appearance changes.
…player-icons

fix: remove missing video player icon assets and fail build on downlo…
# [7.0.0-beta.14](v7.0.0-beta.13...v7.0.0-beta.14) (2026-10-03)

### Bug Fixes

* remove missing video player icon assets and fail build on download errors ([9eb75a3](9eb75a3))
feat!: remove deprecated onUpload callback from CldUploadWidget
# [7.0.0-beta.15](v7.0.0-beta.14...v7.0.0-beta.15) (2026-10-03)

* feat!: remove deprecated onUpload callback from CldUploadWidget ([0d08df9](0d08df9)), closes [#424](#424)

### BREAKING CHANGES

* The `onUpload` prop has been removed from
CldUploadWidget and CldUploadButton. Use `onSuccess` instead. Note that
the second argument is now an options object:
`onUpload={(result, widget) => ...}` becomes
`onSuccess={(result, { widget }) => ...}`.
The player was never fully disposed on unmount (only the Cloudinary
plugin was), so it stayed registered with video.js. With an `id` prop,
remounting reused that stale player and the new <video> element was
never initialized; without one, every remount leaked a player. Next.js
also doesn't fire onLoad again for a script id it already loaded.

Dispose the player on unmount (skipping React Strict Mode's simulated
unmount, which reuses the same element), add onReady alongside onLoad
so remounts initialize again, and guard initialization with the player
ref instead of possibly stale state.
@PaulBoye-py

Copy link
Copy Markdown
Collaborator

hi @eportis-cloudinary, following up on supported versions for v7, here's a proposal based on the official support status as of today:

  • Next.js ^16: Next.js 15 reaches end-of-life on October 21, before v7 ships, and CI only tests Next.js 16. Users on Next.js 12–15 can stay on v6. (Next.js support policy)
  • React ^18.2.0 || ^19: the same range Next.js 16 itself accepts, so we're never stricter than Next.js. (React versions)
  • engines.node: ">=22": Node.js 20 reached end-of-life on April 30, 2026. The CI test matrix would move from Node 20/22 to 22/24. (Node.js release schedule)

These are breaking changes, so I'll add them to the release notes list.

One follow-up outside v7: the docs site still runs Next.js 14 and React 18, so it should be upgraded separately. It still builds, so it doesn't block the release.

If this looks right, I'll make these changes in one PR against beta.

Next.js 15 and earlier, and Node.js 20 and earlier, are end-of-life or
about to be. Require the versions that are still supported, matching
what CI tests.

BREAKING CHANGE: next-cloudinary now requires Next.js 16, React 18.2 or
19, and Node.js 22 or later. Projects on older versions can stay on v6.
PaulBoye-py and others added 2 commits October 12, 2026 21:06
…mount

fix: re-initialize CldVideoPlayer after unmount and remount
# [7.0.0-beta.16](v7.0.0-beta.15...v7.0.0-beta.16) (2026-10-12)

### Bug Fixes

* re-initialize CldVideoPlayer after unmount and remount ([4b37a24](4b37a24))
…-floors

chore: raise minimum supported Next.js, React and Node.js versions
# [7.0.0-beta.17](v7.0.0-beta.16...v7.0.0-beta.17) (2026-10-12)

### chore

* raise minimum supported Next.js, React and Node.js versions ([bc96fc6](bc96fc6))

### BREAKING CHANGES

* next-cloudinary now requires Next.js 16, React 18.2 or
19, and Node.js 22 or later. Projects on older versions can stay on v6.

This branch was successfully deployed

1 active deployment
Preview — fd3a0530 Deployed Oct 12, 2026 by vercel[bot]
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.

Reduce Client Bundle Size v7.0.0 [Feature] Bundle use client with components

7 participants