{{ message }}
Repository navigation
Conversation
Collaborator
Contributor
Author
|
don't worry, I am testing this is personal apps and it works as expected, both old and new syntax... |
Use per-render instance state for component style/script dedupe in View::fetch so assets are deduped within a render without leaking across tests or subsequent renders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend View component rendering tests to cover functional and class components receiving props via variadic and individual parameters, and update View callable invocation to map template data into callable arguments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow class components to return full <style> or <script> tags from css() and js(), while preserving default wrapping for raw CSS/JS strings. Add data-provider coverage and fixtures for both custom style and custom script tag behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a reusable “component tag” system to Flight’s template rendering by extending flight\template\View to detect and render <f-... /> tags (including nested components), and introduces a flight\template\Component base class for class-based components. It also updates/expands the test suite and fixtures to validate the new rendering behavior.
Changes:
- Introduces
flight\template\Componentand extendsView::fetch()to support functional (callable) and class-based components, plus one-time CSS/JS injection per component. - Adds component-tag parsing (
<prefix-component ... />) with prop extraction and recursive rendering. - Modernizes/expands view tests and adds many new test fixture templates/components.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 24 comments.
Show a summary per file
fadrian06
marked this pull request as draft
June 25, 2026 22:32
fadrian06
force-pushed
the
580-view-class-steroids
branch
3 times, most recently
from
June 25, 2026 23:38
ee7b496 to
48035d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pull request introduces a major enhancement to the template rendering system by adding support for reusable components, along with several improvements to the
Viewclass and its tests. The changes include the introduction of a newComponentbase class, significant refactoring and expansion of theViewclass to support component rendering, and modernizations to the test suite for better reliability and clarity.Key highlights:
Viewclass now supports rendering component tags (e.g.,<f-component-name />) with automatic property passing, CSS/JS injection, and improved template resolution.Componentbase class is introduced for reusable UI elements.Component System Enhancements
Componentbase class inflight/template/Component.php, which provides a structure for reusable template components withhtml(),css(), andjs()methods.Viewto support component rendering: detects custom component tags, parses their properties, and renders them recursively, including their CSS and JS, ensuring each style/script is only included once.View Class Improvements
Viewconstructor to acceptcomponentPrefixandcomponentsPathfor flexible component tag naming and location. Improved template variable management, file path resolution, and error handling.set,clear,exists, andgetTemplatemethods for better type safety and clarity. Added utility methods for argument resolution and style/script rendering. [1] [2] [3]Test Suite Modernization
tests/ViewTest.phpto useself::assert*methods, improved output normalization, and added/updated tests to cover new component and template features. [1] [2] [3]Miscellaneous Improvements
composer.jsonto use HTTPS..editorconfigrules to apply to all files undertests/views/recursively.