Gutenberg: "Headless TinyMCE"

Created on 28 Apr 2017  路  7Comments  路  Source: WordPress/gutenberg

This has been asked for, need to understand the requirement more.

Most helpful comment

This was added in TinyMCE 4.7. Setting the theme to false will cause TinyMCE to be headless.

All 7 comments

Thanks Andrew. @iseulde can you help clarify what this could entail? Thanks.

A "headless" version of TinyMCE would be the current version but without any UI, plugin loader, and stuff like that. Just a package that fixes bad browser manipulation in contentEditable, maybe with some tools/API to make it easier to use. Ideally it's also in npm and doesn't create global variables.

This was added in TinyMCE 4.7. Setting the theme to false will cause TinyMCE to be headless.

@androb Would you be able to point us to an example of this API? I'm trying to run headless using Jest/jsdom and there are tons of errors being thrown by the core tinymce library because of all of the DOM APIs that it needs.

I tried stubbing window.matchMedia and that worked, but then an error was being thrown for tinymce's util.toAbsPath because the base URI is not defined. I'm assuming this is going to become a giant chain of stubbing DOM APIs if I keep proceeding down this path.

Does this need to run in an actual headless browser? Will jsdom not cut it?

CC: @spocke

Thanks in advance.

What we mean by headless is that it has no ui similar to headless browsers like phantomjs. JSDom is a js implementation of the dom that is very limited so only parts of a complex editor like tiny would be able to support that and we don鈥檛 have that on our roadmap. Tiny and all it鈥檚 tests works in a headless browser you can run our tests command line using grunt for example. So if you could run your tests though phantomjs it should work fine.

I see. Thanks for the clarification.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

youknowriad picture youknowriad  路  3Comments

davidsword picture davidsword  路  3Comments

aaronjorbin picture aaronjorbin  路  3Comments

ellatrix picture ellatrix  路  3Comments

cr101 picture cr101  路  3Comments