Upgrading to 0.5
0.5 changes how Folio's packages depend on each other, so that a server that installs a Node-side package (importers, exporters, layout, sync, the slides model) gets no React, editor or browser-only code on disk. Most imports keep working through re-export shims; a few apps need one more dependency.
What moved
| Before (0.4) | 0.5 | Shim kept? |
|---|---|---|
@nextgensoftwares/folio-plugin-layers/core | @nextgensoftwares/folio-layers-core (new package) | yes: /core re-exports it |
toProseMirrorSchema from @nextgensoftwares/folio-editor or folio-editor/schema | @nextgensoftwares/folio-pm-schema (new package) | yes: both still export it |
prosemirror-collab / prosemirror-state installed by folio-sync, folio-plugin-collab, folio-plugin-comments | taken from @nextgensoftwares/folio-editor, which now also exports collab, getVersion, receiveTransaction, sendableSteps, EditorState, Plugin, PluginKey | n/a |
@nextgensoftwares/folio-slides depended on folio-plugin-layers | depends on folio-layers-core | n/a |
The new packages version with the others (all at 0.5.0).
What you may need to change
1. Apps using collaboration, comments or sync's client. @nextgensoftwares/folio-editor is now an optional peer of folio-sync, folio-plugin-collab and folio-plugin-comments (their main entries build on the editor; their server entries don't). An app that uses them already has the editor, usually through folio-react, but with pnpm's strict layout it must be your app's own dependency:
pnpm add @nextgensoftwares/folio-editor2. Node servers importing @nextgensoftwares/folio-sync's main entry. It is the client's entry and needs the editor. Import the server half instead (the same classes, since 0.4.1):
// before
import { MemoryDocumentServer, docChecksum } from '@nextgensoftwares/folio-sync';
// 0.5
import { MemoryDocumentServer, docChecksum } from '@nextgensoftwares/folio-sync/server';3. Code that relied on folio-slides installing folio-plugin-layers. If you import @nextgensoftwares/folio-plugin-layers yourself, list it in your dependencies (it was only there by accident through folio-slides). Drawing helpers used with slides come from @nextgensoftwares/folio-layers-core.
4. Code importing prosemirror-state or prosemirror-collab through Folio's packages without listing them. Add them to your dependencies, or use the re-exports from @nextgensoftwares/folio-editor.
Recommended (not required)
// before
import { layoutText, loadPresetShapes } from '@nextgensoftwares/folio-plugin-layers/core';
import { toProseMirrorSchema } from '@nextgensoftwares/folio-editor/schema';
// 0.5
import { layoutText, loadPresetShapes } from '@nextgensoftwares/folio-layers-core';
import { toProseMirrorSchema } from '@nextgensoftwares/folio-pm-schema';The shims are kept in 0.5; new code should use the new packages.
Checking an install
tools/check-node-installs.mjs packs every package and installs each Node-side one into a clean directory, failing if React, React DOM, folio-react, folio-editor, folio-plugin-layers or prosemirror-view ends up in node_modules. To check your own server, run ls node_modules/@nextgensoftwares (or npm ls react prosemirror-view) after installing it.