Skip to content

Commit 2c93996

Browse files
INT-3359: Support jquery 4 (#30)
* INT-3359: Support jQuery v4 * Use jquery 4 in storybook * Upgrade storybook to v10 * Update type checking * Update storybook * Add changelog * Fix invalid typescript option * Add lint rules for storybook * Re-add the baseUrl config which is needed for bedrock webpack * Unwrap setupIntegration in jqAppendTest * Remove a heading * Undo change to fix test failing * Use jquery 4 in test * Attempt to fix test * Fix tests keeping timeout before tinymce being loaded * Remove gpl license key * Add license key gpl to tests which uses self-hosted tinymce * Bump the minor version * Remove unnecessary test * Fix lint * Use local tinymce * Disabled jqAppentest * Fix flaky tests in OriginalTest * Another attempt to fix test * fix lint * Another fix * Stack trace any error * lint * Undo some changes * Another attempt * Remove all try catches * Strip more try/catch * Use different predicate * Undo jquery restrictin * Skip some tests to try out * Update bedrock and clean up dom after each test * Update bedrock and clean up dom after each test * fix lint * Re-add try/final blocks * Another lint fix
1 parent 1e7cfda commit 2c93996

27 files changed

Lines changed: 2146 additions & 8262 deletions

.storybook/main.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

.storybook/main.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { StorybookConfig } from '@storybook/html-vite';
2+
3+
const config: StorybookConfig = {
4+
stories: [
5+
"../src/**/*.stories.mdx",
6+
"../src/**/*.stories.@(js|jsx|ts|tsx)"
7+
],
8+
addons: [
9+
"@storybook/addon-links",
10+
"@storybook/addon-docs"
11+
],
12+
framework: {
13+
"name": "@storybook/html-vite",
14+
"options": {}
15+
},
16+
async viteFinal(config) {
17+
return config;
18+
}
19+
};
20+
21+
export default config;

.storybook/preview-head.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<!-- load jQuery -->
2-
<script
3-
src="https://code.jquery.com/jquery-3.6.0.min.js"
4-
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
5-
crossorigin="anonymous"></script>
2+
<script src="https://code.jquery.com/jquery-4.0.0.js" integrity="sha256-9fsHeVnKBvqh3FB2HYu7g2xseAZ5MlN6Kz/qnkASV8U=" crossorigin="anonymous"></script>
63
<!-- load TinyMCE -->
74
<script
85
src="https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/8/tinymce.min.js"

.storybook/preview.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const parameters = {
2-
actions: { argTypesRegex: "^on[A-Z].*" },
32
controls: {
43
matchers: {
54
color: /(background|color)$/i,

.storybook/tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"moduleResolution": "nodenext",
5+
"target": "es6",
6+
"module": "nodenext",
7+
"lib": ["es2015", "dom"],
8+
"types": ["jquery"]
9+
},
10+
"include": [
11+
"../src/**/*",
12+
"../.storybook/**/*"
13+
]
14+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
### Changed
10+
11+
- Updated to support jQuery 4. #INT-3359
12+
913
## 2.2.0 - 2025-10-16
1014

1115
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ Have you found an issue with tinymce-jquery or do you have a feature request?
2323
Open up an [issue](https://github.com/tinymce/tinymce-jquery/issues) and let us
2424
know or submit a [pull request](https://github.com/tinymce/tinymce-jquery/pulls).
2525
*Note: For issues concerning TinyMCE please visit the
26-
[TinyMCE repository](https://github.com/tinymce/tinymce).*
26+
[TinyMCE repository](https://github.com/tinymce/tinymce).*

eslint.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ export default defineConfig([
2121
},
2222
},
2323
rules: {}
24+
},
25+
{
26+
files: [
27+
".storybook/*.ts",
28+
"src/stories/**/*.ts"
29+
],
30+
plugins: {
31+
"@tinymce": tinymceEslintPlugin
32+
},
33+
extends: [ '@tinymce/standard' ],
34+
languageOptions: {
35+
parserOptions: {
36+
sourceType: "module",
37+
project: [
38+
".storybook/tsconfig.json"
39+
]
40+
},
41+
},
42+
rules: {}
2443
},
2544
{
2645
files: [

package.json

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tinymce/tinymce-jquery",
3-
"version": "2.2.1-rc",
3+
"version": "2.3.0-rc",
44
"description": "Official TinyMCE integration for jQuery",
55
"main": "dist/tinymce-jquery.js",
66
"files": [
@@ -19,49 +19,43 @@
1919
"test-manual": "bedrock -d src/test/ts",
2020
"build": "yarn run clean && tsc -p ./tsconfig.json && rollup -c rollup.config.js",
2121
"lint": "eslint src",
22-
"storybook": "start-storybook -p 6006",
23-
"build-storybook": "build-storybook",
22+
"storybook": "storybook dev -p 6006",
23+
"build-storybook": "storybook build",
2424
"deploy-storybook": "yarn storybook-to-ghpages --source-branch=main"
2525
},
2626
"repository": "https://github.com/tinymce/tinymce-jquery",
2727
"author": "Tiny Technologies",
2828
"license": "MIT",
2929
"devDependencies": {
30-
"@babel/core": "^7.21.3",
3130
"@ephox/agar": "^7.4.1",
32-
"@ephox/bedrock-client": "^14.0.0",
33-
"@ephox/bedrock-server": "^14.0.0",
31+
"@ephox/bedrock-client": "^16.0.0",
32+
"@ephox/bedrock-server": "^16.2.0",
3433
"@ephox/katamari": "^9.1.5",
3534
"@ephox/mcagar": "^8.3.2",
3635
"@ephox/sand": "^6.0.9",
3736
"@ephox/sugar": "^9.2.1",
3837
"@ephox/swag": "^4.6.0",
3938
"@rollup/plugin-terser": "^0.4.0",
40-
"@storybook/addon-actions": "^6.5.16",
41-
"@storybook/addon-essentials": "^6.5.16",
42-
"@storybook/addon-interactions": "^6.5.16",
43-
"@storybook/addon-links": "^6.5.16",
44-
"@storybook/builder-webpack5": "^6.5.16",
45-
"@storybook/html": "^6.5.16",
46-
"@storybook/manager-webpack5": "^6.5.16",
39+
"@storybook/addon-docs": "^10.0.0",
40+
"@storybook/addon-links": "^10.0.0",
41+
"@storybook/html": "^10.0.0",
42+
"@storybook/html-vite": "^10.0.0",
4743
"@storybook/storybook-deployer": "^2.8.16",
48-
"@storybook/testing-library": "^0.0.13",
4944
"@tinymce/beehive-flow": "^0.19.0",
5045
"@tinymce/eslint-plugin": "^3.0.0",
51-
"@types/jquery": "^3.5.16",
52-
"@types/react": "^17.0.0",
53-
"babel-loader": "^8.3.0",
54-
"react": "^17.0.0",
55-
"react-dom": "^17.0.0",
46+
"@types/jquery": "^4.0.0",
5647
"rimraf": "^4.4.1",
5748
"rollup": "^3.20.2",
58-
"tinymce": "^8.0.1",
49+
"storybook": "^10.0.0",
50+
"tinymce": "^8.5.1",
5951
"tslib": "^2.5.0",
6052
"typescript": "^5.9.3",
61-
"webpack": "^5.9.0"
53+
"vite": "^8.0.0",
54+
"vite-tsconfig-paths": "^6.1.1"
6255
},
6356
"dependencies": {},
6457
"resolutions": {
65-
"@types/node": "^16"
58+
"@types/node": "^16",
59+
"jquery": "^4.0.0"
6660
}
6761
}

src/demo/html/demo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
66
<title>Page Title</title>
77
<meta name='viewport' content='width=device-width, initial-scale=1'>
8-
<script src="http://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
9-
<script src='../../../dist/tinymce-min.js'></script>
8+
<script src="https://code.jquery.com/jquery-4.0.0.js" integrity="sha256-9fsHeVnKBvqh3FB2HYu7g2xseAZ5MlN6Kz/qnkASV8U=" crossorigin="anonymous"></script>
9+
<script src='../../../dist/tinymce-jquery.js'></script>
1010
</head>
1111
<body>
1212
<textarea></textarea>

0 commit comments

Comments
 (0)