Skip to content

Commit a878bf8

Browse files
committed
DOC-3147: Refine migration guide for TinyMCE 8.0: update breaking change descriptions, enhance license key system details, and clarify DOMPurify sanitization impacts.
1 parent e40434b commit a878bf8

File tree

1 file changed

+114
-45
lines changed

1 file changed

+114
-45
lines changed

modules/ROOT/pages/migration-from-7x.adoc

Lines changed: 114 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,37 @@ Any items marked **"High"** level require immediate attention during migration.
1919
[cols="2,3,1",options="header"]
2020
|===
2121
|Breaking Change |Impact |Level
22-
|xref:license-key-system-update[License Key System Update]
22+
|xref:license-key-system-update[License Key System]
2323
|Self-hosted deployments now require a new license key format and license key manager. Old keys are **not compatible**.
2424
|High
2525
26-
|xref:dompurify-update-breaking-change[DOMPurify Update and Stricter Sanitization]
27-
|Sanitization is now stricter; content previously allowed may be stripped or altered. See migration guide for details.
26+
|xref:dompurify-update-breaking-change[DOMPurify Update]
27+
|Sanitization is now stricter; content previously allowed may be stripped or altered.
2828
|High
2929
30-
|xref:editor-selection-setcontent-deprecated[editor.selection.setContent] Deprecated
30+
|xref:editor-selection-setcontent-deprecated[editor.selection.setContent]
3131
|Method deprecated. Use `editor.insertContent` instead.
3232
|Medium
3333
34-
|xref:fire-method-deprecation[fire()] Method Deprecation
34+
|xref:fire-method-deprecation[fire()]
3535
|Method deprecated. Use `dispatch()` for event handling.
3636
|Medium
3737
38-
|xref:pagebreak-split-block-default[pagebreak_split_block Default Value]
38+
|xref:pagebreak-split-block-default[pagebreak_split_block]
3939
|The default value changed from `false` to `true`, affecting how page breaks interact with block elements.
4040
|Low
4141
42-
|xref:editor-documentbaseurl-removal[editor.documentBaseUrl] Removal
42+
|xref:editor-documentbaseurl-removal[editor.documentBaseUrl]
4343
|Undocumented property removed. Use `editor.editorManager.documentBaseURI` instead.
4444
|Low
4545
46-
|xref:skipfocus-consolidation[skipFocus and skip_focus] Consolidation
46+
|xref:skipfocus-consolidation[skipFocus and skip_focus]
4747
|Options consolidated to `skipFocus` in `ToggleToolbarDrawer`.
4848
|Low
49+
50+
|xref:split-button-css-breaking-change[Split buttons]
51+
|Split button CSS classes and structure have changed.
52+
|Low
4953
|===
5054
====
5155

@@ -58,7 +62,9 @@ Any items marked **"High"** level require immediate attention during migration.
5862
This section applies to self-hosted installations only. For cloud deployments, license key management is handled automatically.
5963
====
6064

61-
{productname} {release-version} introduces an enhanced license key system that requires specific attention during migration. The complete licensing documentation xref:license-key.adoc[License Key Management] covers:
65+
{productname} {release-version} introduces an enhanced license key system that requires specific attention during migration.
66+
67+
The complete licensing documentation xref:license-key.adoc[License Key Management] covers:
6268

6369
* Detailed explanations of all license types (GPL, Commercial, GPL with Premium Features)
6470
* Time-based vs Version-locked license key differences
@@ -68,17 +74,22 @@ This section applies to self-hosted installations only. For cloud deployments, l
6874
* Commercial License Key Manager setup and requirements
6975
* Troubleshooting and FAQ
7076

71-
==== Key Migration Considerations
77+
**Impact**: The new license key system introduces breaking changes that require updates to your configuration and code.
7278

73-
* *License Key Format Change:* Version 7 keys are **not compatible** with {productname} {release-version}. New keys use the prefix `T8LK:` for commercial licenses or `GPL+T8LK:` for GPL with Premium Features.
74-
* *Mandatory Key Requirement:* Self-hosted deployments now **require** a valid license key; without one, the editor will be set to readonly.
75-
* *Commercial License Manager:* Self-hosted commercial deployments **require** the new license key manager addon.
79+
**Key Migration Considerations**:
7680

77-
==== Migration Steps
81+
* *License Key Format Change:* Version 7 keys are:
82+
** Not compatible with {productname} {release-version}.
83+
** New keys use the prefix `T8LK:` for commercial licenses or `GPL+T8LK:` for GPL with Premium Features.
84+
* *Mandatory Key Requirement:* Self-hosted deployments **now require** a valid license key; without one, the editor will be set to `readonly`.
85+
* *Commercial License Manager:* Self-hosted commercial deployments **require** the new License Key Manager addon.
7886

79-
. *Obtain New License Key:*
80-
** link:https://www.tiny.cloud/contact/[Contact us] to obtain a new {productname} {release-version} license key, or use `gpl` for the open source version. See: xref:license-key.adoc#setting-the-license[setting the license] for details.
87+
**Migration Steps:**
8188

89+
. *Obtain New License Key:*
90+
+
91+
* link:https://www.tiny.cloud/contact/[Contact us] to obtain a new {productname} {release-version} license key, or use `gpl` for the open source version. See: xref:license-key.adoc#setting-the-license[setting the license] for details.
92+
+
8293
. *Update Configuration:*
8394
+
8495
[source, javascript]
@@ -98,11 +109,12 @@ tinymce.init({
98109

99110
==== License Key Manager Setup
100111

101-
When migrating to TinyMCE {release-version} with a commercial license, the license key manager addon is required for the editor to operate. The setup varies based on your deployment method:
112+
When migrating to {productname} {release-version} with a commercial license, the License Key Manager addon is required for the editor to operate. The setup varies based on your deployment method:
113+
114+
*CDN/Static Hosting:*
115+
116+
* Ensure the supplied `licensekeymanager` folder is in your {productname} plugins directory:
102117

103-
. *CDN/Static Hosting:*
104-
** Ensure the supplied `licensekeymanager` folder is in your {productname} plugins directory:
105-
+
106118
[tree]
107119
----
108120
your-site/
@@ -114,9 +126,10 @@ your-site/
114126
│ └── ... other plugins
115127
----
116128

117-
. *NPM/Module Bundler:*
118-
** Install TinyMCE and ensure the license key manager is imported:
119-
+
129+
*NPM/Module Bundler:*
130+
131+
Install {productname} and ensure the license key manager is imported:
132+
120133
[source, javascript]
121134
----
122135
// Import TinyMCE
@@ -131,9 +144,10 @@ tinymce.init({
131144
});
132145
----
133146

134-
. *React/Next.js:*
135-
** When using the `@tinymce/tinymce-react` package:
136-
+
147+
*React/Next.js:*
148+
149+
When using the `@tinymce/tinymce-react` package:
150+
137151
[source, javascript]
138152
----
139153
import { Editor } from '@tinymce/tinymce-react';
@@ -150,24 +164,25 @@ export default function MyEditor() {
150164
}
151165
----
152166

153-
. *PHP/Laravel:*
154-
** Ensure the license key manager is included when publishing {productname} assets:
155-
+
167+
*PHP/Laravel:*
168+
169+
Ensure the license key manager is included when publishing {productname} assets:
170+
156171
[source, php]
157172
----
158173
<script src="{{ asset('path/to/tinymce/tinymce.min.js') }}"></script>
159174
<script src="{{ asset('path/to/tinymce/plugins/licensekeymanager/plugin.min.js') }}"></script>
160175
<script>
161-
tinymce.init({
162-
selector: '#editor',
163-
license_key: 'T8LK:...'
164-
});
176+
tinymce.init({
177+
selector: '#editor',
178+
license_key: 'T8LK:...'
179+
});
165180
</script>
166181
----
167182

168183
[IMPORTANT]
169184
====
170-
* The license key manager is automatically included when using Tiny Cloud.
185+
* The license key manager is automatically included when using {companyname} Cloud.
171186
* The plugin does not need to be added to the `plugins` configuration option.
172187
* For bundled applications, the license key manager must be loaded before {productname} initialization.
173188
* For bundled applications, ensure the license key manager is not excluded during build optimization.
@@ -196,14 +211,20 @@ This change improves security and aligns with DOMPurify's recommended defaults.
196211

197212
==== Key Changes
198213

199-
* **DOMPurify upgraded to 3.2.6** — The custom patch is now included upstream; maintaining a forked patch is no longer required.
214+
* **DOMPurify upgraded to 3.2.6**
200215
* **`SAFE_FOR_XML` enabled** — This setting enforces stricter handling of comments and attribute values, preventing certain XSS vectors.
201216
* **Content Impact** — HTML comments containing tags, Internet Explorer conditional comments, and attributes with HTML-like values may now be removed during sanitization. Content that was previously allowed may be stripped.
202217

203-
==== Migration Guidance
218+
*Impact*: This change improves security by preventing potential XSS attacks through comments and attributes that were previously allowed. However, it may also result in content being stripped or altered unexpectedly.
219+
220+
**Migration Steps:**
204221

205222
* Review workflows and test content that previously relied on relaxed sanitization.
206-
* If custom comment handling is required, consider using DOMPurify hooks as recommended by the maintainers.
223+
* If custom comment handling is required, note that DOMPurify hooks cannot be used directly unless you fork TinyMCE or disable TinyMCE's built-in sanitization and implement your own with DOMPurify.
224+
* {productname} now provides the xref:content-filtering.adoc#allow_html_in_comments[Content Filtering: allow_html_in_comments option] option. Enabling this option allows HTML tags in comments with sanitization still enabled.
225+
226+
[WARNING]
227+
Using `allow_html_in_comments` increases the risk of XSS vulnerabilities. xref:security.adoc#allow_html_in_comments[allow_html_in_comments] is not recommended for production use unless you fully understand the implications and have appropriate security measures in place.
207228

208229
.Example: Content Differences
209230
|===
@@ -227,6 +248,46 @@ This change improves security and aligns with DOMPurify's recommended defaults.
227248
For information on disabling DOMPurify sanitization (not recommended), see xref:security.adoc#xss_sanitization-option[xss_sanitization option].
228249
====
229250

251+
== Core Changes
252+
253+
[[split-button-css-breaking-change]]
254+
=== Split button CSS structure updates
255+
// #TINY-8665
256+
257+
{productname} {release-version} updates the internal structure of split buttons. Split buttons now render as two separate components with updated CSS classes:
258+
259+
* `.tox-split-button__main` — Main action button
260+
* `.tox-split-button__chevron` — Dropdown chevron button
261+
262+
**Impact**: This change improves the flexibility of split button styling and allows for more granular control over each component.
263+
264+
**Migration steps:**
265+
266+
Update all CSS selectors and styles that previously targeted the unified `.tox-split-button` class to target the new `.tox-split-button__main` and `.tox-split-button__chevron` classes.
267+
268+
[source,css]
269+
----
270+
/* Before TinyMCE 8.0 */
271+
.tox-split-button {
272+
/* Previous styling approach */
273+
}
274+
275+
/* TinyMCE 8.0+ */
276+
.tox-split-button__main {
277+
/* Main button styling */
278+
}
279+
280+
.tox-split-button__chevron {
281+
/* Chevron button styling */
282+
}
283+
----
284+
285+
**Migration checklist:**
286+
287+
* [ ] Search your CSS for `.tox-split-button` and update to use `.tox-split-button__main` and `.tox-split-button__chevron`.
288+
* [ ] Test all split button styles in your application to ensure they render correctly.
289+
* [ ] Update any custom plugins that use split buttons to reflect the new structure.
290+
230291
== Core API Changes
231292

232293
[discrete]
@@ -243,6 +304,12 @@ IMPORTANT: The following sections detail important changes that require updates
243304

244305
The `editor.selection.setContent` API has been deprecated and will be removed in {productname} 9.
245306

307+
*Impact*: This change simplifies content manipulation by consolidating insertion methods.
308+
309+
**Migration steps:**
310+
311+
To replace `editor.selection.setContent`, use `editor.insertContent` instead. The new method is more consistent with other content manipulation methods in {productname}.
312+
246313
.Example Usage
247314
[source,javascript]
248315
----
@@ -253,8 +320,6 @@ editor.selection.setContent('<p>New content</p>');
253320
editor.insertContent('<p>New content</p>');
254321
----
255322

256-
*Impact*: This change simplifies content manipulation by consolidating insertion methods.
257-
258323
**Migration checklist:**
259324

260325
* [ ] Replace all instances of `editor.selection.setContent` with `editor.insertContent`
@@ -282,7 +347,9 @@ console.log('documentBaseURI', editor.documentBaseURI.getURI());
282347

283348
TIP: Use `tinymce.activeEditor.documentBaseURI.getURI()` for all base URL operations.
284349

285-
.Required Changes
350+
**Impact**: This change improves URL handling consistency by removing an undocumented API that was not aligned with the documented `documentBaseURI` property.
351+
352+
**Migration steps:**
286353

287354
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `tinymce.activeEditor.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
288355

@@ -316,6 +383,10 @@ For more information see: link:https://www.tiny.cloud/docs/tinymce/latest/apis/t
316383

317384
The `skipFocus` and `skip_focus` options for the `ToggleToolbarDrawer` command have been consolidated into a single, more consistent argument. This reduces API complexity and clarifies the intended behavior.
318385

386+
**Impact**: This change simplifies focus management, reducing the risk of confusion and unexpected behavior.
387+
388+
**Migration steps:**
389+
319390
[source, javascript]
320391
----
321392
// Old approach (Deprecated) in TinyMCE 8
@@ -325,8 +396,6 @@ editor.execCommand('ToggleToolbarDrawer', { skip_focus: false }, { skipFocus: tr
325396
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
326397
----
327398

328-
**Impact**: This change simplifies focus management, reducing the risk of confusion and unexpected behavior.
329-
330399
**Migration checklist:**
331400

332401
* [ ] Locate all instances of `ToggleToolbarDrawer` command usage
@@ -403,7 +472,7 @@ The Image and Accessibility Checker plugins now follow the latest W3C standards
403472
**Migration checklist:**
404473

405474
* [ ] Identify images previously using `role="presentation"` for decorative purposes in your content
406-
* [ ] Replace those with empty alt attributes (`alt=""`)
475+
* [ ] Replace those with empty alt attributes `alt=""`
407476
* [ ] Update image plugin configuration if customized
408477
* [ ] Test accessibility checker with updated content
409478

@@ -554,8 +623,8 @@ Upgrading to {productname} {release-version} requires integrators to update thei
554623

555624
For more guidance, refer to the:
556625

557-
* link:https://www.tiny.cloud/docs[{productname} Documentation],
558-
* Utilize our in-house **Ask AI** widget for general support found in the bottom corner of every documentation page, or
626+
* link:https://www.tiny.cloud/docs[{productname} Documentation].
627+
* {productname}’s new **Ask AI** widget is ready to assist you, just click the icon in the bottom-right corner of any documentation page.
559628
* link:https://www.tiny.cloud/contact/[Contact {supportname}] for assistance.
560629

561630
For additional details on {productname} {release-version} changes, see xref:8.0-release-notes.adoc#overview[{productname} {release-version} release notes].

0 commit comments

Comments
 (0)