TX Text Control .NET Server

Updating npm Packages

Topic

Updating the TX Text Control npm packages of an Angular, React or Node.js application starts with choosing the version that fits your backend. From there, you install a new major version and check which peer dependencies changed between versions.

Match the Major Version of the Backend

The Document Editor and Document Viewer frontends for Angular and React, and the Node.js packages, are listed in npm Packages. They only contain the user interface, and every frontend needs a backend that runs TX Text Control .NET Server, so an update of the frontend usually goes together with an update of the backend's NuGet packages. See Updating NuGet Packages.

Use the npm packages whose major version matches the TX Text Control .NET Server version of your backend: for a backend with the 34.x NuGet packages, the 34.x npm packages. When you upgrade the backend to a new major version, upgrade the npm packages to the same major version. Package Versions and Product Versions explains how the npm versions relate to the product version.

Check for Updates

Run the following command in the folder of your frontend application:

npm outdated

npm outdated checks the registry for newer versions of the installed packages. The Wanted column shows the highest version that satisfies the version range in your package.json, and the Latest column shows the version tagged as latest. A new major version usually appears only in the Latest column, because the range in package.json does not include it.

To see all published versions of a package, or the peer dependencies of a specific version before you install it, use npm view:

npm view @txtextcontrol/tx-react-document-editor versions
npm view @txtextcontrol/tx-react-document-editor@34.0.0 peerDependencies

Install a New Version

To update a package to a new major version, use npm install. The update command cannot install a newer major version. The following command installs the latest release of the Angular Document Editor:

npm install @txtextcontrol/tx-ng-document-editor@latest

To install a specific version, for example the version that matches your backend, pass the version number:

npm install @txtextcontrol/tx-react-document-editor@34.0.0

Update all TX Text Control packages of the application in the same way, then rebuild and test the frontend together with the updated backend.

Peer Dependency Changes

The Angular and React packages declare the framework versions they work with as peer dependencies. Check them before you update, because a new major version of a TX Text Control package can require a newer Angular or React version. The ranges of the 32.x, 33.0 and 34.0 versions are listed in Angular and React under Earlier Package Versions.

What this means for an upgrade:

  • React Document Editor. Version 33.0.0 changed the peer dependency from React 18 to React 19, and version 34.0.0 requires React ^19.2.0. Upgrade react and react-dom in your application before or together with the editor package.
  • React Document Viewer. Version 34.0.0 still declares React ^18.2.0. If you use the Document Editor and the Document Viewer in the same React application, compare the peer dependencies of both packages before you update.
  • Angular Document Editor. Version 34.0.0 requires Angular 18.2.14 or higher and supports versions up to Angular 21. Applications on Angular 17 need to upgrade Angular first.
  • Angular Document Viewer. Version 34.0.1 extends the supported range to Angular 21.

The Node.js packages @txtextcontrol/tx-document-editor and @txtextcontrol/tx-websocket-server have no peer dependencies.

Frontend Code Changes

Besides the framework versions, check whether the new version changes the settings your frontend code uses. An example is the Document Viewer 32.2.1, which added support for PDF.js 4.0 and later: the pdfjs object of documentLoadSettings uses the properties workerSourcePath and librarySourcePath. Breaking Changes shows the code for ASP.NET Core, Angular and React and lists the other changes per version.

Next Steps