Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6ed899c
feat: copy source code from laravel
bluehaha Oct 15, 2025
d78e603
feat: change namespace from Illuminate to Hypervel
bluehaha Oct 15, 2025
09555f8
feat: add type hints
bluehaha Oct 15, 2025
a2a12fb
feat: copy test from Laravel
bluehaha Oct 15, 2025
2902396
feat: use Hypervel namespace
bluehaha Oct 15, 2025
32d63b5
feat: use strict type
bluehaha Oct 15, 2025
c02c360
feat: add view package in composer
bluehaha Oct 15, 2025
327d7fb
feat: add contracts
bluehaha Oct 15, 2025
cbb8e28
style: remove useless type hint
bluehaha Oct 31, 2025
8286d7a
test: beautify test
bluehaha Oct 31, 2025
7efe459
Merge branch 'main' into feature/view
bluehaha Nov 3, 2025
d4103ac
fix: fix namespace
bluehaha Nov 5, 2025
333f59f
refactor: add type hint
bluehaha Nov 5, 2025
66321b0
feat: migrate compilers and engines
bluehaha Nov 5, 2025
4d4c6f2
refactor: add type hints
bluehaha Nov 5, 2025
29531a3
feat: migrate Compilers
bluehaha Nov 13, 2025
4d9bae7
feat: migrate Laravel view
bluehaha Nov 28, 2025
0be9324
feat: use constructor property promotion
bluehaha Nov 28, 2025
5a81433
feat: migrate Laravel view
bluehaha Dec 17, 2025
011c576
feat: migrate Laravel view
bluehaha Dec 22, 2025
2eaebe3
feat: return Html component
bluehaha Dec 22, 2025
df3daa6
feat: migrate Laravel view
bluehaha Dec 22, 2025
117b966
feat: migrate Laravel view
bluehaha Dec 23, 2025
e5ee166
Merge branch 'main' into feature/view
bluehaha Dec 29, 2025
860a552
feat: migrate Laravel view
bluehaha Dec 29, 2025
e6ca111
fix: fix cs
bluehaha Dec 29, 2025
34806cc
fix: need to save session
bluehaha Dec 31, 2025
368eb28
fix: fix phpstan for PHP 8.2
bluehaha Jan 5, 2026
3315b29
fix test
bluehaha Jan 5, 2026
4fc9dc4
Merge branch 'main' into feature/view
bluehaha Jan 7, 2026
1f4fc8d
feat: need to save session even if an exception occurs
bluehaha Jan 7, 2026
236a25e
feat: use explicit expressions
bluehaha Jan 7, 2026
3d44095
feat: use the `get` method to retrieve the created object
bluehaha Jan 7, 2026
7df96fc
feat: use Facade Documenter to generate PHP document
bluehaha Jan 7, 2026
e3dab7c
feat: replace hyperf view with hypervel view
bluehaha Jan 13, 2026
4070c33
refactor: simplify View render method and make type hint more logic
bluehaha Jan 15, 2026
7ddc47c
fix: prevent null value
bluehaha Jan 15, 2026
66d9f03
feat: override request method
bluehaha Jan 16, 2026
a7ca621
feat: add vite
bluehaha Jan 22, 2026
61acdaa
feat: add AddLinkHeadersForPreloadedAssets middleware
bluehaha Jan 23, 2026
292c74e
refactor: fix cs and phpstan
bluehaha Jan 23, 2026
80ab2b7
test: fix test
bluehaha Jan 23, 2026
5d4e160
fix: fix phpstan
bluehaha Jan 23, 2026
cefc481
feat: add destroy function
bluehaha Jan 23, 2026
59d711b
fix: fix test
bluehaha Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"Hypervel\\Translation\\": "src/translation/src/",
"Hypervel\\Validation\\": "src/validation/src/",
"Hypervel\\Permission\\": "src/permission/src/",
"Hypervel\\Sentry\\": "src/sentry/src/"
"Hypervel\\Sentry\\": "src/sentry/src/",
"Hypervel\\View\\": "src/view/src/"
},
"files": [
"src/auth/src/Functions.php",
Expand Down Expand Up @@ -182,7 +183,8 @@
"hypervel/translation": "self.version",
"hypervel/validation": "self.version",
"hypervel/permission": "self.version",
"hypervel/sentry": "self.version"
"hypervel/sentry": "self.version",
"hypervel/view": "self.version"
},
"suggest": {
"hyperf/redis": "Required to use redis driver. (^3.1).",
Expand Down Expand Up @@ -261,7 +263,8 @@
"providers": [
"Hypervel\\Notifications\\NotificationServiceProvider",
"Hypervel\\Telescope\\TelescopeServiceProvider",
"Hypervel\\Sentry\\SentryServiceProvider"
"Hypervel\\Sentry\\SentryServiceProvider",
"Hypervel\\View\\ViewServiceProvider"
]
},
"branch-alias": {
Expand Down
3 changes: 0 additions & 3 deletions src/core/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
use Hyperf\Database\Commands\Migrations\StatusCommand;
use Hyperf\Database\Migrations\MigrationCreator as HyperfMigrationCreator;
use Hyperf\Database\Model\Factory as HyperfDatabaseFactory;
use Hyperf\ViewEngine\Compiler\CompilerInterface;
use Hypervel\Database\Console\SeedCommand;
use Hypervel\Database\Eloquent\Factories\LegacyFactoryInvoker as DatabaseFactoryInvoker;
use Hypervel\Database\Migrations\MigrationCreator;
use Hypervel\Database\TransactionListener;
use Hypervel\View\CompilerFactory;

class ConfigProvider
{
Expand All @@ -31,7 +29,6 @@ public function __invoke(): array
'dependencies' => [
HyperfDatabaseFactory::class => DatabaseFactoryInvoker::class,
HyperfMigrationCreator::class => MigrationCreator::class,
CompilerInterface::class => CompilerFactory::class,
],
'listeners' => [
TransactionListener::class,
Expand Down
5 changes: 5 additions & 0 deletions src/core/src/Context/RequestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
namespace Hypervel\Context;

use Hyperf\Context\RequestContext as HyperfRequestContext;
use Psr\Http\Message\ServerRequestInterface;

class RequestContext extends HyperfRequestContext
{
public static function destroy(?int $coroutineId = null): void
{
Context::destroy(ServerRequestInterface::class, $coroutineId);
}
}
30 changes: 0 additions & 30 deletions src/core/src/View/CompilerFactory.php

This file was deleted.

35 changes: 0 additions & 35 deletions src/core/src/View/Compilers/BladeCompiler.php

This file was deleted.

24 changes: 0 additions & 24 deletions src/core/src/View/Compilers/Concerns/CompilesHelpers.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/core/src/View/Events/ViewRendered.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/core/src/View/Middleware/ShareErrorsFromSession.php

This file was deleted.

10 changes: 8 additions & 2 deletions src/devtool/src/Generator/ComponentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Hypervel\Devtool\Generator;

use Hyperf\Devtool\Generator\GeneratorCommand;
use Hypervel\Support\Str;

class ComponentCommand extends GeneratorCommand
{
Expand All @@ -27,7 +28,7 @@ protected function getStub(): string

protected function getDefaultNamespace(): string
{
return $this->getConfig()['namespace'] ?? 'App\View\Component';
return $this->getConfig()['namespace'] ?? 'App\View\Components';
}

protected function buildClass(string $name): string
Expand All @@ -37,7 +38,12 @@ protected function buildClass(string $name): string

protected function replaceView(string $stub, string $name): string
{
$view = lcfirst(str_replace($this->getNamespace($name) . '\\', '', $name));
$view = str_replace($this->getDefaultNamespace() . '\\', '', $name);
$view = array_map(
fn ($part) => Str::snake($part),
explode('\\', $view)
);
$view = implode('.', $view);

return str_replace(
['%VIEW%'],
Expand Down
6 changes: 3 additions & 3 deletions src/devtool/src/Generator/stubs/view-component.stub
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ declare(strict_types=1);
namespace %NAMESPACE%;

use Closure;
use Hyperf\ViewEngine\Component\Component;
use Hyperf\ViewEngine\Contract\ViewInterface;
use Hypervel\View\Component;
use Hypervel\View\Contracts\View as ViewContract;
use Hypervel\Support\Facades\View;

class %CLASS% extends Component
Expand All @@ -22,7 +22,7 @@ class %CLASS% extends Component
/**
* Get the view / contents that represent the component.
*/
public function render(): ViewInterface|Closure|string
public function render(): ViewContract|Closure|string
{
return %VIEW%;
}
Expand Down
22 changes: 22 additions & 0 deletions src/filesystem/src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Hypervel\Filesystem;

use Hyperf\Support\Filesystem\Filesystem as HyperfFilesystem;
use Hypervel\Http\Exceptions\FileNotFoundException;

class Filesystem extends HyperfFilesystem
{
Expand All @@ -17,4 +18,25 @@ public function ensureDirectoryExists(string $path, int $mode = 0755, bool $recu
$this->makeDirectory($path, $mode, $recursive);
}
}

/**
* Get the returned value of a file.
*
* @throws FileNotFoundException
*/
public function getRequire(string $path, array $data = [[]])
{
if ($this->isFile($path)) {
$__path = $path;
$__data = $data;

return (static function () use ($__path, $__data) {
extract($__data, EXTR_SKIP);

return require $__path;
})();
}

throw new FileNotFoundException("File does not exist at path {$path}.");
}
}
4 changes: 2 additions & 2 deletions src/foundation/src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ protected function registerCoreContainerAliases(): void
'url',
\Hypervel\Router\UrlGenerator::class,
],
\Hyperf\ViewEngine\Contract\FactoryInterface::class => ['view'],
\Hyperf\ViewEngine\Compiler\CompilerInterface::class => ['blade.compiler'],
\Hypervel\View\Contracts\Factory::class => ['view'],
\Hypervel\View\Compilers\CompilerInterface::class => ['blade.compiler'],
\Hypervel\Session\Contracts\Factory::class => [
'session',
\Hypervel\Session\SessionManager::class,
Expand Down
10 changes: 5 additions & 5 deletions src/foundation/src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
use Exception;
use Hyperf\Collection\Arr;
use Hyperf\Context\Context;
use Hyperf\Contract\MessageBag as MessageBagContract;
use Hyperf\Contract\MessageProvider;
use Hyperf\Contract\SessionInterface;
use Hyperf\Database\Model\ModelNotFoundException;
use Hyperf\ExceptionHandler\ExceptionHandler;
use Hyperf\HttpMessage\Base\Response as BaseResponse;
use Hyperf\HttpMessage\Exception\HttpException as HyperfHttpException;
use Hyperf\HttpMessage\Upload\UploadedFile;
use Hyperf\Support\MessageBag;
use Hyperf\ViewEngine\ViewErrorBag;
use Hypervel\Auth\Access\AuthorizationException;
use Hypervel\Auth\AuthenticationException;
use Hypervel\Foundation\Contracts\Application as Container;
Expand All @@ -33,10 +29,14 @@
use Hypervel\Router\Contracts\UrlGenerator as UrlGeneratorContract;
use Hypervel\Session\Contracts\Session as SessionContract;
use Hypervel\Session\TokenMismatchException;
use Hypervel\Support\Contracts\MessageBag as MessageBagContract;
use Hypervel\Support\Contracts\MessageProvider;
use Hypervel\Support\Contracts\Responsable;
use Hypervel\Support\Facades\Auth;
use Hypervel\Support\MessageBag;
use Hypervel\Support\Reflector;
use Hypervel\Support\Traits\ReflectsClosures;
use Hypervel\Support\ViewErrorBag;
use Hypervel\Validation\ValidationException;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -461,7 +461,7 @@ protected function finalizeRenderedResponse(Request $request, ResponseInterface

if ($callbacks = $this->afterResponseCallbacks()) {
foreach ($callbacks as $callback) {
$response = $callback($response, $e, $request);
$response = $callback($response, $e, $request) ?: $response;
}
}

Expand Down
Loading