Skip to content

Refine E2E module from upstream feedback: optional TinyMCE + client ergonomics - #9

Merged
erikfrerejean merged 3 commits into
6from
feat/optional-tinymce-and-client-ergonomics
Jul 7, 2026
Merged

Refine E2E module from upstream feedback: optional TinyMCE + client ergonomics#9
erikfrerejean merged 3 commits into
6from
feat/optional-tinymce-and-client-ergonomics

Conversation

@erikfrerejean

@erikfrerejean erikfrerejean commented Jul 7, 2026

Copy link
Copy Markdown
Member

Addresses four observations from the downstream (grid) team consuming this module.

Changes

Make silverstripe/htmleditor-tinymce optional (feedback #1)

Only GenerateTinyMCECombinedTask needs TinyMCE; a fixtures-only consumer should not drag it in. Moved from requirerequire-dev plus a suggest entry, and guarded the task body with class_exists() so it skips cleanly when the package is absent instead of fataling.

Note on the feedback's premise: the observation assumed "recipe-cms pulls it anyway" — that is not true for recipe-cms 6.x (verified: nothing in a recipe-cms project depends on htmleditor-tinymce). This is consistent with SS6 making the HTML editor pluggable. It does not change the decision to make the dep optional, but it does mean the container test harness must pull TinyMCE explicitly (see below).

Playwright client ergonomics (feedback #3, #4)

  • loadAndNavigate defaults request to page.request (which also shares the page's auth cookies). Breaking: signature changes from (page, request, fixture) to (page, fixture, request?).
  • New editorReadyTimeout option for the editor-ready wait (previously a fixed Playwright default).
  • reset() now checks the JSON success envelope, consistent with load()/loadAll().

Documentation (feedback #2, #3b)

  • Documented that the Playwright host needs the module's Composer deps installed (the client ships as a vendor deep-import, not on npm).
  • Documented composing load() + page.goto() for navigation outside the CMS pages screen, rather than parameterizing loadAndNavigate's hardcoded path.

Container test harness

The Docker harness installs the module as a path-repo dependency, and Composer never installs a dependency's require-dev. Combined with the finding above (recipe-cms doesn't pull TinyMCE), the optional-dependency change would leave the container without TinyMCE, so GenerateTinyMCECombinedTask would skip and its test would fail. Mirrored silverstripe/htmleditor-tinymce into .docker/app/composer.json's require-dev, matching how the other module dev tools are already duplicated there.

Verification (in-container)

  • Full PHP suite: 55/55 pass
  • PHPStan: clean
  • Coverage: 94.03% (≥90% gate)
  • tsc typecheck: pass

Only the generate-tinymce-combined CI task needs TinyMCE; fixtures-only
consumers should not have to drag it in. Move it from require to
require-dev (so this module's own tests still run) plus a suggest entry,
and guard the task with class_exists() so it skips cleanly when the
package is absent instead of fataling on the TinyMCE classes.
- loadAndNavigate defaults request to page.request (which also shares the
  page's auth cookies); the signature becomes (page, fixture, request?).
  This is a breaking change from (page, request, fixture).
- Add editorReadyTimeout option for the editor-ready wait (was a fixed
  Playwright default).
- reset() now checks the JSON success envelope, consistent with
  load()/loadAll().
- Document that the Playwright host needs the module's Composer deps
  installed (the client ships as a vendor deep-import, not on npm), and
  how to compose load() + page.goto() for non-pages navigation.
Now that the module declares silverstripe/htmleditor-tinymce as an
optional (require-dev + suggest) dependency, the containerised test
suite no longer receives it: the harness installs the module as a
path-repo dependency, and Composer never installs a dependency's
require-dev. recipe-cms does not pull it either (verified), so
GenerateTinyMCECombinedTask would skip and its test would fail.

Mirror the pin into .docker/app/composer.json's require-dev, matching
how the other module dev tools (phpstan, phpunit, rector, ...) are
already duplicated there, so the container can exercise the task.
@erikfrerejean
erikfrerejean merged commit f41606c into 6 Jul 7, 2026
6 checks passed
@erikfrerejean
erikfrerejean deleted the feat/optional-tinymce-and-client-ergonomics branch July 7, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant