chore: add webview demo app and dev architecture docs#19
chore: add webview demo app and dev architecture docs#19developersharif merged 1 commit intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request establishes the core architecture and implementation roadmap for a PHP GUI framework, introducing a streamlined V1 blueprint that emphasizes a zero-dependency model with both Tcl/Tk and WebView engines. The changes include detailed design documents, a technical plan for a WebView helper process, and a functional todo application for testing. Review feedback suggests improving the robustness of the test application by handling potential file read failures and utilizing strict comparisons, as well as clarifying the status of a superseded architecture document that contains rejected design patterns.
| $html = file_get_contents(__DIR__ . '/index.html'); | ||
| $webview->setHtml($html); |
There was a problem hiding this comment.
file_get_contents returns false on failure. Since setHtml expects a string, passing false will trigger a TypeError in PHP 8.0+. It is safer to handle the potential failure explicitly.
$html = file_get_contents(__DIR__ . '/index.html') ?: throw new \RuntimeException("index.html not found");
$webview->setHtml($html);| $data = json_decode($args, true); | ||
| $id = $data[0] ?? ''; | ||
| foreach ($todos as &$todo) { | ||
| if ($todo['id'] == $id) { |
| $webview->bind('deleteTodo', function(string $reqId, string $args) use ($webview, &$todos) { | ||
| $data = json_decode($args, true); | ||
| $id = $data[0] ?? ''; | ||
| $todos = array_filter($todos, fn($todo) => $todo['id'] != $id); |
| @@ -0,0 +1,410 @@ | |||
| # PHP GUI Framework — Architecture Plan | |||
There was a problem hiding this comment.
The filename coreframeowrkv1.md contains a typo ('frameowrk'). Furthermore, this document appears to describe an architecture (proposing DI containers and plugin managers) that was explicitly rejected in FRAMEWORK_ARCHITECTURE_REVIEW.md and omitted from the final blueprint in CORE_FRAMEWORK_ARCHITECTURE.md. To avoid confusion for future contributors, this file should be renamed (e.g., ARCHIVED_ORIGINAL_PLAN.md) and updated with a note explaining its status as a superseded proposal.
No description provided.