Skip to content

Commit ce31007

Browse files
committed
docs: prepare release 1.2.1
Demo FrankenPHP mode via FRANKENPHP_MODE; align changelog and upgrading notes.
1 parent ef045f3 commit ce31007

9 files changed

Lines changed: 84 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
Symfony bundle: **`Ckeditor5EditorType`** stores HTML in a textarea while **CKEditor 5 classic** (GPL open-source plugins only) runs in the browser. YAML profiles (FOS-style), **Vite** IIFE build (`ckeditor5-editor.js`) under `src/Resources/public/`.
88

9-
**FrankenPHP worker mode:** Supported for production-style demo runs (worker-enabled `Caddyfile`). Development demos use classic `php_server` without `worker` so PHP/Twig changes apply on refresh — see [docs/DEMO-FRANKENPHP.md](docs/DEMO-FRANKENPHP.md).
9+
**FrankenPHP:** Demo runtime is selected with **`FRANKENPHP_MODE`** (`worker` default, or `classic` for per-request PHP / hot-reload). See [docs/DEMO-FRANKENPHP.md](docs/DEMO-FRANKENPHP.md).
1010

1111
## Features
1212

demo/symfony8/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ PORT=8021
44
###> symfony/framework-bundle ###
55
APP_ENV=dev
66
APP_DEBUG=1
7+
8+
# FRANKENPHP_MODE: FrankenPHP runtime mode — `classic` (one process per request) or `worker` (long-lived workers).
9+
# Default: worker. Set classic for per-request PHP / easier hot-reload. Recreate with `docker compose up -d` after change.
10+
FRANKENPHP_MODE=worker
711
APP_SECRET=change_this_secret_key_to_a_random_value
812
###< symfony/framework-bundle ###
913

demo/symfony8/Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,10 @@ ENV PATH="/app/vendor/bin:${PATH}"
1717
ENV SERVER_NAME=:80
1818

1919
COPY docker/frankenphp/Caddyfile /etc/frankenphp/Caddyfile
20+
COPY docker/frankenphp/Caddyfile /etc/frankenphp/Caddyfile.worker
2021
COPY docker/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile.dev
2122

22-
RUN echo '#!/bin/sh' > /usr/local/bin/docker-entrypoint.sh && \
23-
echo 'set -e' >> /usr/local/bin/docker-entrypoint.sh && \
24-
echo 'git config --global --add safe.directory /app 2>/dev/null || true' >> /usr/local/bin/docker-entrypoint.sh && \
25-
echo 'git config --global --add safe.directory /var/ckeditor5-editor-bundle 2>/dev/null || true' >> /usr/local/bin/docker-entrypoint.sh && \
26-
echo 'mkdir -p /app/var/cache /app/var/log' >> /usr/local/bin/docker-entrypoint.sh && \
27-
echo 'chmod -R 777 /app/var 2>/dev/null || true' >> /usr/local/bin/docker-entrypoint.sh && \
28-
echo 'if [ "${APP_ENV:-prod}" = "dev" ]; then cp /etc/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile; fi' >> /usr/local/bin/docker-entrypoint.sh && \
29-
echo 'exec frankenphp run --config /etc/frankenphp/Caddyfile --adapter caddyfile' >> /usr/local/bin/docker-entrypoint.sh && \
30-
chmod +x /usr/local/bin/docker-entrypoint.sh
23+
COPY docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
24+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
3125

3226
ENTRYPOINT ["docker-entrypoint.sh"]

demo/symfony8/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CKEditor 5 Editor Bundle — Demo (Symfony 8.1)
22

3-
This demo runs with **FrankenPHP** (Caddy, HTTP on port 80 inside the container). In **dev** (`APP_ENV=dev`), worker mode is disabled so each request runs in a new PHP process and **code/template changes are visible on refresh** without restarting the container.
3+
This demo runs with **FrankenPHP** (Caddy, HTTP on port 80 inside the container). Runtime mode is **`FRANKENPHP_MODE`** in `.env` (default **`worker`**). Set **`classic`** for per-request PHP so **code/template changes are visible on refresh**, then recreate the container (`docker compose up -d` / `make up`). `APP_ENV=dev` still enables the Web Profiler.
44

55
The app pins **Symfony 8.1.*** via `extra.symfony.require` in `composer.json`. **Symfony 8** requires **PHP ≥8.4** (see the demo Dockerfile / Compose PHP image). Symfony **6.4** / **7.x** compatibility is covered by the CI PHPUnit matrix.
66

demo/symfony8/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
- APP_ENV=dev
2222
- APP_DEBUG=1
2323
- APP_SECRET=${APP_SECRET:-demo-secret}
24+
- FRANKENPHP_MODE=${FRANKENPHP_MODE:-worker}
2425
# Mitigate Docker/WSL DNS failures resolving repo.packagist.org (composer curl error 6).
2526
dns:
2627
- 8.8.8.8

demo/symfony8/docker/entrypoint.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# FRANKENPHP_MODE: classic | worker (REQ-DEMO-010). Default: worker.
5+
# Set via .env / Compose only — not baked into the image ENV.
6+
MODE="${FRANKENPHP_MODE:-worker}"
7+
case "$MODE" in
8+
classic)
9+
if [ -f /app/docker/frankenphp/Caddyfile.dev ]; then
10+
cp /app/docker/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile
11+
elif [ -f /etc/frankenphp/Caddyfile.dev ]; then
12+
cp /etc/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile
13+
fi
14+
;;
15+
worker)
16+
if [ -f /app/docker/frankenphp/Caddyfile ]; then
17+
cp /app/docker/frankenphp/Caddyfile /etc/frankenphp/Caddyfile
18+
elif [ -f /etc/frankenphp/Caddyfile.worker ]; then
19+
cp /etc/frankenphp/Caddyfile.worker /etc/frankenphp/Caddyfile
20+
fi
21+
# else keep image default Caddyfile (worker enabled at build time)
22+
;;
23+
*)
24+
echo "Unknown FRANKENPHP_MODE=$MODE (expected classic|worker)" >&2
25+
exit 1
26+
;;
27+
esac
28+
echo "FrankenPHP mode: $MODE"
29+
30+
git config --global --add safe.directory /app 2>/dev/null || true
31+
git config --global --add safe.directory /var/ckeditor5-editor-bundle 2>/dev/null || true
32+
mkdir -p /app/var/cache /app/var/log
33+
chmod -R 777 /app/var 2>/dev/null || true
34+
35+
exec frankenphp run --config /etc/frankenphp/Caddyfile --adapter caddyfile

docs/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.2.1] - 2026-07-22
11+
12+
### Changed
13+
14+
- Demo FrankenPHP: select runtime with **`FRANKENPHP_MODE`** (`worker` default / `classic`) via `.env` + Compose; extract `docker/entrypoint.sh` (no longer inline in the Dockerfile).
15+
- Documentation: [`DEMO-FRANKENPHP.md`](DEMO-FRANKENPHP.md), demo README, and root README aligned with `FRANKENPHP_MODE` (no longer implies `APP_ENV=dev` alone disables workers).
16+
1017
## [1.2.0] - 2026-07-18
1118

1219
### Changed
@@ -109,7 +116,8 @@ First semver release (documented stable line, CI and Packagist aligned with tag
109116
- PHPUnit: integration suite + unit test for `upload_url` CSRF branch (**100%** PHP Clover on `src/`).
110117
- PHP-CS-Fixer finder excludes generated integration fixture cache and `tests/Fixtures/app/config/reference.php`.
111118

112-
[Unreleased]: https://github.com/nowo-tech/Ckeditor5EditorBundle/compare/v1.2.0...HEAD
119+
[Unreleased]: https://github.com/nowo-tech/Ckeditor5EditorBundle/compare/v1.2.1...HEAD
120+
[1.2.1]: https://github.com/nowo-tech/Ckeditor5EditorBundle/compare/v1.2.0...v1.2.1
113121
[1.2.0]: https://github.com/nowo-tech/Ckeditor5EditorBundle/compare/v1.1.4...v1.2.0
114122
[1.1.4]: https://github.com/nowo-tech/Ckeditor5EditorBundle/compare/v1.1.3...v1.1.4
115123
[1.1.3]: https://github.com/nowo-tech/Ckeditor5EditorBundle/compare/v1.1.2...v1.1.3

docs/DEMO-FRANKENPHP.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Demo applications with FrankenPHP (development and production)
22

3-
This document describes how the **CKEditor 5 Editor Bundle** demos run under **FrankenPHP** in Docker: development (no worker, changes on refresh) vs production-style (worker). Reuse the same pattern in other Symfony bundles with FrankenPHP demos.
3+
This document describes how the **CKEditor 5 Editor Bundle** demos run under **FrankenPHP** in Docker: **`classic`** (no worker, changes on refresh) vs **`worker`** (production-style). Switch with **`FRANKENPHP_MODE`**. Reuse the same pattern in other Symfony bundles with FrankenPHP demos.
44

55
## Contents
66

@@ -9,6 +9,7 @@ This document describes how the **CKEditor 5 Editor Bundle** demos run under **F
99
- [Development](#development)
1010
- [Production / worker mode](#production--worker-mode)
1111
- [Ports and URLs](#ports-and-urls)
12+
- [Switching classic vs worker (`FRANKENPHP_MODE`)](#switching-classic-vs-worker-frankenphp_mode)
1213
- [Troubleshooting](#troubleshooting)
1314

1415
## Overview
@@ -20,7 +21,7 @@ Each demo uses:
2021
- **FrankenPHP** (Caddy + PHP) in one container.
2122
- **Docker Compose** mounting the demo app and the parent bundle at **`/var/ckeditor5-editor-bundle`** for the Composer **path** repository.
2223
- **`Caddyfile`** (production-oriented, worker) and **`Caddyfile.dev`** (development, classic `php_server`).
23-
- An **entrypoint** that, when running in dev, activates `Caddyfile.dev` so Twig and bundle changes are visible without restarting workers.
24+
- An **entrypoint** that selects the Caddyfile from **`FRANKENPHP_MODE`** (`worker` or `classic`). Use **`classic`** so Twig and bundle changes are visible without restarting workers.
2425

2526
There is one demo: **`demo/symfony8`** (Symfony **8.1.***, default HTTP port **8021**). From the bundle root:
2627

@@ -40,15 +41,16 @@ The bundle under test is **`nowo-tech/ckeditor5-editor-bundle`**, installed from
4041

4142
### FrankenPHP worker mode (compatibility)
4243

43-
**FrankenPHP worker mode:** Supported for production-style runs (worker-enabled `Caddyfile`, e.g. `worker /app/public/index.php 2` inside `php_server`). The **bundle itself** is a form widget + static JS; it does not require workers. Development demos intentionally **disable** worker mode so PHP/Twig changes apply on refresh — see each demo’s `docker/frankenphp/` files (`Caddyfile` vs `Caddyfile.dev`).
44+
**FrankenPHP worker mode:** Supported for production-style runs (worker-enabled `Caddyfile`, e.g. `worker /app/public/index.php 2` inside `php_server`). The **bundle itself** is a form widget + static JS; it does not require workers. For local editing with refresh, set **`FRANKENPHP_MODE=classic`** — see each demo’s `docker/frankenphp/` files (`Caddyfile` vs `Caddyfile.dev`).
4445

4546
## Development
4647

4748
Goal: edit PHP, Twig, YAML, or bundle sources and see changes after a browser refresh.
4849

49-
- Use **`Caddyfile.dev`**: classic **`php_server`** without **`worker`** inside `php_server`.
50+
- Set **`FRANKENPHP_MODE=classic`** in the demo `.env` (entrypoint activates **`Caddyfile.dev`**: classic **`php_server`** without **`worker`**).
51+
- Recreate the container after changing `.env` (`docker compose up -d` / `make up`); a plain restart does not reload env.
5052
- **`docker/php-dev.ini`**: short OPcache revalidation interval for dev.
51-
- **`APP_ENV=dev`**, **`APP_DEBUG=1`** in Compose (see each demo’s `docker-compose.yml`).
53+
- **`APP_ENV=dev`**, **`APP_DEBUG=1`** in Compose (see each demo’s `docker-compose.yml`) for Profiler / debug tooling.
5254
- **DNS**: Compose sets **`dns: 8.8.8.8` / `8.8.4.4`** so Composer can resolve Packagist inside Docker/WSL.
5355

5456
Start from **`demo/symfony8`** with `make up` (see **`demo/README.md`**).
@@ -57,8 +59,8 @@ Start from **`demo/symfony8`** with `make up` (see **`demo/README.md`**).
5759

5860
For production-like behaviour:
5961

60-
- Use **`APP_ENV=prod`**, **`APP_DEBUG=0`**, and the **`Caddyfile`** that enables FrankenPHP workers.
61-
- Warm Symfony cache and follow deployment hardening for `var/` and secrets.
62+
- Keep **`FRANKENPHP_MODE=worker`** (default) so the entrypoint uses the worker **`Caddyfile`**.
63+
- Optionally use **`APP_ENV=prod`**, **`APP_DEBUG=0`**, warm Symfony cache, and follow deployment hardening for `var/` and secrets.
6264

6365
Compare **`Caddyfile`** vs **`Caddyfile.dev`** in `demo/symfony8/docker/frankenphp/`.
6466

@@ -70,8 +72,19 @@ Compare **`Caddyfile`** vs **`Caddyfile.dev`** in `demo/symfony8/docker/frankenp
7072

7173
Override `PORT` in the demo `.env` (from `.env.example`) if ports clash.
7274

75+
## Switching classic vs worker (`FRANKENPHP_MODE`)
76+
77+
Demos select the FrankenPHP runtime via **`FRANKENPHP_MODE`** in `.env` / `.env.example` (not a Dockerfile `ENV`):
78+
79+
| Value | Behaviour |
80+
| --- | --- |
81+
| **`worker`** (default) | Keep the worker Caddyfile (`php_server { worker ... }`) |
82+
| **`classic`** | Entrypoint copies `Caddyfile.dev` (plain `php_server`, hot-reload friendly) |
83+
84+
Compose passes `FRANKENPHP_MODE=${FRANKENPHP_MODE:-worker}` into the PHP service. After changing `.env`, run `docker compose up -d` (or `make up`) so the container is **recreated** — a plain `restart` does not reload env. No image rebuild is required.
85+
7386
## Troubleshooting
7487

7588
- **Composer cannot resolve `repo.packagist.org`**: Ensure Docker DNS is set (this repo’s compose files include public DNS). On corporate networks you may need internal DNS forwarders.
76-
- **Changes not visible**: Confirm you are in **dev** with **`Caddyfile.dev`** (no worker). Restart the container after switching Caddyfiles.
89+
- **Changes not visible**: Set **`FRANKENPHP_MODE=classic`** and recreate the container so **`Caddyfile.dev`** is active (no worker).
7790
- **Bundle not updating**: Run **`make update-bundle`** in the demo or `composer update nowo-tech/ckeditor5-editor-bundle` inside the container after editing the path-mounted bundle.

docs/UPGRADING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ nowo_ckeditor5_editor:
127127

128128
See [`CHANGELOG.md`](CHANGELOG.md) (section **1.2.0**) and [`CONFIGURATION.md`](CONFIGURATION.md).
129129

130+
## To 1.2.1 from 1.2.0
131+
132+
Patch release: FrankenPHP **demo** runtime switch via **`FRANKENPHP_MODE`** and documentation alignment. No bundle API, YAML, or runtime behaviour changes for applications.
133+
134+
- **Contributors / local demos**: default is **`worker`**. For hot-reload on refresh, set **`FRANKENPHP_MODE=classic`** in `demo/symfony8/.env` and recreate the container (`docker compose up -d` / `make up`). See [`DEMO-FRANKENPHP.md`](DEMO-FRANKENPHP.md).
135+
- **Composer**: `composer update nowo-tech/ckeditor5-editor-bundle` only if you pin an exact patch (e.g. `1.2.0`); with `^1.0` or `^1.2`, **1.2.1** is included on update.
136+
137+
See [`CHANGELOG.md`](CHANGELOG.md) (section **1.2.1**).
138+
130139
## To 1.x (first documented stable line)
131140

132141
When upgrading from snapshots without semver tags in your project:

0 commit comments

Comments
 (0)