Skip to content

Commit

Permalink
INT-3324: Move tinymce to an optional peer dependency (#544)
Browse files Browse the repository at this point in the history
* INT-3324: tinymce is now an optional peer dependency

* INT-3324: Swap all imports of tinymce to `import type`

* INT-3324: Upgraded dependencies to latest

* INT-3324: Added changelog entries

* INT-3324: Bump major version
  • Loading branch information
danoaky-tiny authored Jul 19, 2024
1 parent d919ad8 commit f6b7a13
Show file tree
Hide file tree
Showing 7 changed files with 2,617 additions and 3,463 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed
- Updated dependencies. #INT-3324

### Changed
- Moved tinymce dependency to peerDependencies, as well as making it optional. #INT-3324

## 5.1.0 - 2024-06-11

### Added
Expand Down
56 changes: 31 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,50 +26,56 @@
"author": "Ephox Corporation DBA Tiny Technologies, Inc.",
"license": "MIT",
"dependencies": {
"prop-types": "^15.6.2",
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1"
"prop-types": "^15.6.2"
},
"peerDependencies": {
"react": "^18.0.0 || ^17.0.1 || ^16.7.0",
"react-dom": "^18.0.0 || ^17.0.1 || ^16.7.0"
"react-dom": "^18.0.0 || ^17.0.1 || ^16.7.0",
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1"
},
"peerDependenciesMeta": {
"tinymce": {
"optional": true
}
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@ephox/agar": "^8.0.0-alpha.0",
"@ephox/bedrock-client": "^14.1.1",
"@ephox/bedrock-server": "^14.1.3",
"@ephox/bedrock-server": "^14.1.4",
"@ephox/katamari": "^9.1.5",
"@ephox/mcagar": "^9.0.0-alpha.0",
"@ephox/sand": "^6.0.9",
"@ephox/sugar": "^9.2.1",
"@storybook/addon-essentials": "^8.0.2",
"@storybook/addon-interactions": "^8.0.2",
"@storybook/addon-links": "^8.0.2",
"@storybook/blocks": "^8.0.2",
"@storybook/react": "^8.0.2",
"@storybook/react-vite": "^8.0.2",
"@storybook/addon-essentials": "^8.2.4",
"@storybook/addon-interactions": "^8.2.4",
"@storybook/addon-links": "^8.2.4",
"@storybook/blocks": "^8.2.4",
"@storybook/react": "^8.2.4",
"@storybook/react-vite": "^8.2.4",
"@tinymce/beehive-flow": "^0.19.0",
"@tinymce/eslint-plugin": "^2.3.1",
"@tinymce/miniature": "^6.0.0",
"@types/node": "^20.9.0",
"@types/prop-types": "^15.7.10",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/node": "^20.14.10",
"@types/prop-types": "^15.7.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"gh-pages": "^6.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"storybook": "^8.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "^6.0.1",
"storybook": "^8.2.4",
"tinymce": "^7.2.1",
"tinymce-4": "npm:tinymce@^4",
"tinymce-5": "npm:tinymce@^5",
"tinymce-6": "npm:tinymce@^6",
"tinymce-7": "npm:tinymce@^7",
"typescript": "~5.4.3",
"vite": "^5.2.2"
"typescript": "~5.5.3",
"vite": "^5.3.3"
},
"version": "5.1.2-rc",
"version": "6.0.0-rc",
"name": "@tinymce/tinymce-react"
}
2 changes: 1 addition & 1 deletion src/main/ts/Events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Editor as TinyMCEEditor, EditorEvent, Events } from 'tinymce';
import type { Editor as TinyMCEEditor, EditorEvent, Events } from 'tinymce';

export type EventHandler<A> = (a: EditorEvent<A>, editor: TinyMCEEditor) => unknown;

Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/TinyMCE.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TinyMCE as TinyMCEGlobal } from 'tinymce';
import type { TinyMCE as TinyMCEGlobal } from 'tinymce';

const getTinymce = (view: Window): TinyMCEGlobal | null => {
const global = view as any;
Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { eventPropTypes, IEventPropTypes } from './components/EditorPropTypes';
import { IAllProps } from './components/Editor';
import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
import type { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';

export const isFunction = (x: unknown): x is Function => typeof x === 'function';

Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ScriptItem, ScriptLoader } from '../ScriptLoader2';
import { getTinymce } from '../TinyMCE';
import { isFunction, isTextareaOrInput, mergePlugins, uuid, configHandlers, isBeforeInputEventAvailable, isInDoc, setMode } from '../Utils';
import { EditorPropTypes, IEditorPropTypes } from './EditorPropTypes';
import { Bookmark, Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce';
import type { Bookmark, Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce';

type OmitStringIndexSignature<T> = { [K in keyof T as string extends K ? never : K]: T[K] };

Expand Down
Loading

0 comments on commit f6b7a13

Please sign in to comment.