Skip to content

Commit fd562c7

Browse files
INT-3378: Support Angular v20 (#437)
* INT-3378: Support Angular v20 * Attempt to fix flaky test * Update more dependencies * Update support version * Another attempt to fix test * Remove unused package * Remove more unused dependency
1 parent 88a1a9f commit fd562c7

6 files changed

Lines changed: 1666 additions & 1674 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This package is a thin wrapper around [TinyMCE](https://github.com/tinymce/tinym
1313

1414
|Angular version|`tinymce-angular` version|
1515
|--- |--- |
16-
|>=16.x <=19.x |8+ |
16+
|>=16.x <=20.x |8+ |
1717
|14+ |7.x |
1818
|13+ |6.x |
1919
|9+ |4.x |

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,30 @@
1515
},
1616
"private": true,
1717
"devDependencies": {
18-
"@angular-devkit/build-angular": "^19",
19-
"@angular-devkit/core": "^19",
20-
"@angular/animations": "^19",
21-
"@angular/cdk": "^19",
22-
"@angular/cli": "^19",
23-
"@angular/common": "^19",
24-
"@angular/compiler": "^19",
25-
"@angular/compiler-cli": "^19",
26-
"@angular/core": "^19",
27-
"@angular/forms": "^19",
28-
"@angular/language-service": "^19",
29-
"@angular/material": "^19",
30-
"@angular/platform-browser": "^19",
31-
"@angular/platform-browser-dynamic": "^19",
18+
"@angular-devkit/build-angular": "^20",
19+
"@angular-devkit/core": "^20",
20+
"@angular/animations": "^20",
21+
"@angular/cdk": "^20",
22+
"@angular/cli": "^20",
23+
"@angular/common": "^20",
24+
"@angular/compiler": "^20",
25+
"@angular/compiler-cli": "^20",
26+
"@angular/core": "^20",
27+
"@angular/forms": "^20",
28+
"@angular/language-service": "^20",
29+
"@angular/material": "^20",
30+
"@angular/platform-browser": "^20",
3231
"@babel/core": "^7.24.9",
3332
"@ephox/agar": "^8.0.1",
3433
"@ephox/bedrock-client": "^14.1.1",
3534
"@ephox/bedrock-server": "^14.1.3",
3635
"@ephox/sugar": "^9.3.1",
37-
"@storybook/addon-essentials": "~8.5",
38-
"@storybook/addon-interactions": "~8.5",
39-
"@storybook/addon-links": "^8.2.5",
40-
"@storybook/angular": "~8.5",
41-
"@storybook/blocks": "^8.2.5",
42-
"@storybook/test": "~8.5",
36+
"@storybook/addon-essentials": "9.0.0-alpha.12",
37+
"@storybook/addon-interactions": "^9.0.0-alpha.10",
38+
"@storybook/addon-links": "^9",
39+
"@storybook/angular": "^9",
40+
"@storybook/blocks": "^9.0.0-alpha.17",
41+
"@storybook/test": "^9.0.0-alpha.2",
4342
"@tinymce/beehive-flow": "^0.19.0",
4443
"@tinymce/eslint-plugin": "^3.0.0",
4544
"@tinymce/miniature": "^6.0.0",
@@ -61,7 +60,7 @@
6160
"regenerator-runtime": "^0.14.1",
6261
"rimraf": "^6.0.1",
6362
"rxjs": "^7.8.1",
64-
"storybook": "~8.5",
63+
"storybook": "^9",
6564
"tinymce": "^8.0.0",
6665
"tinymce-4": "npm:tinymce@^4",
6766
"tinymce-5": "npm:tinymce@^5",
@@ -71,10 +70,11 @@
7170
"tinymce-8": "npm:tinymce@^8",
7271
"to-string-loader": "^1.1.5",
7372
"tslib": "^2.6.2",
74-
"typescript": "~5.5.4",
73+
"typescript": "^5.9.3",
7574
"webpack": "^5.95.0",
76-
"zone.js": "~0.15.0"
75+
"zone.js": "~0.16.0"
7776
},
7877
"version": "9.1.2-rc",
79-
"name": "@tinymce/tinymce-angular"
78+
"name": "@tinymce/tinymce-angular",
79+
"dependencies": {}
8080
}

stories/Editor.stories.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import { ViewQueryComponent } from './viewquery/Viewquery.component';
1212
import { MaterialTabs } from './materialtabs/MaterialTabs.component';
1313
import { SafePipe } from './pipes/Safe.pipe';
1414
import { MatTabsModule } from '@angular/material/tabs';
15-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1615
import { ContainerComponent, ContentProjectionComponent } from './contentprojection/ContentProjection.component';
1716
import { BindingComponent } from './data-binding/DataBinding.component';
1817
import { ReadonlyComponent } from './readonly/Readonly.component';
18+
import { BrowserModule } from '@angular/platform-browser';
1919

2020
const meta: Meta = {
2121
component: EditorComponent,
@@ -168,7 +168,7 @@ export const MaterialTabsStory: StoryObj<EditorComponent> = {
168168
name: 'Material Tabs',
169169
render: () => ({
170170
moduleMetadata: {
171-
imports: [ ReactiveFormsModule, FormsModule, BrowserAnimationsModule, MatTabsModule ],
171+
imports: [ ReactiveFormsModule, FormsModule, BrowserModule, MatTabsModule ],
172172
declarations: [ MaterialTabs ],
173173
},
174174
template: `<material-tabs/>`
@@ -180,6 +180,7 @@ export const ContentProjectionStory: StoryObj<EditorComponent> = {
180180
render: () => ({
181181
moduleMetadata: {
182182
declarations: [ ContentProjectionComponent, ContainerComponent ],
183+
imports: [ FormsModule ],
183184
},
184185
template: `<content-projection/>`
185186
}),

tinymce-angular-component/src/test/ts/alien/InitTestEnvironment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import 'zone.js';
33
import 'zone.js/plugins/fake-async-test';
44

55
import { TestBed } from '@angular/core/testing';
6-
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
6+
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
77

8-
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
8+
TestBed.initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {
99
teardown: { destroyAfterEach: true },
1010
});

tinymce-angular-component/src/test/ts/alien/TestHooks.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@ export const editorHook = <T = unknown>(component: Type<T>, moduleDef: TestModul
7474
switchMap(
7575
({ editor }) =>
7676
new Promise<Editor>((resolve) => {
77-
if (editor.initialized) {
78-
resolve(editor);
79-
}
80-
editor.once( 'SkinLoaded', () => resolve(editor));
77+
editor.once('SkinLoaded', () => {
78+
// This is a workaround to avoid a race condition occurring in tinymce 8 where licenseKeyManager is still validating the license key
79+
// after global tinymce is removed in a clean up. Specifically, it happens when unloading/loading different versions of TinyMCE
80+
if (editor.licenseKeyManager) {
81+
editor.licenseKeyManager.validate({}).then(() => {
82+
resolve(editor);
83+
}).catch((reason) => console.warn(reason));
84+
} else {
85+
resolve(editor);
86+
}
87+
});
8188
})
8289
),
8390
map(

0 commit comments

Comments
 (0)