首页 > 其他分享 >laravel_release notes

laravel_release notes

时间:2024-02-16 20:44:27浏览次数:26  
标签:laravel Laravel 10 notes 应用程序 版本 Pennant release new

参考网址:https://laravel.com/docs/10.x/releases

Release Notes

发行说明

Versioning Scheme

版本控制方案

Laravel and its other first-party packages follow Semantic Versioning. Major framework releases are released every year (~Q1),
while minor and patch releases may be released as often as every week.
Minor and patch releases should never contain breaking changes.

Laravel 及其其他第一方包遵循语义化版本控制。

主要的框架版本每年发布一次(~Q1),

而次要版本和补丁版本可能每周都会发布。

次要版本和补丁版本不应该包含破坏性更改。


“every year (~Q1)” 的意思是 Laravel 的主要版本每年发布一次,

通常是在每年的第一季度(Q1 代表 Quarter 1,即第一季度,通常是1月到3月)。

这里的“~Q1”是一个近似的指示,意味着发布时间可能在第一季度的某个时间点,

但不一定是在该季度的开始或结束。

When referencing the Laravel framework or its components from your application or package, you should always use a version constraint such as ^10.0, since major releases of Laravel do include breaking changes.

However, we strive to always ensure you may update to a new major release in one day or less.

当从您的应用程序或包中引用 Laravel 框架或其组件时,

您应该始终使用版本约束,如 ^10.0,

因为 Laravel 的主要版本确实包含破坏性更改。

但是,我们始终努力确保您可以在一天或更短的时间内更新到新的主要版本。

当从应用程序或包中引用 Laravel 框架或其组件时,应使用版本约束,

因为 Laravel 的主要版本包含破坏性更改。

这意味着,当 Laravel 发布新的主要版本时,您的代码可能需要一些修改才能与新版本兼容。

但是,Laravel 团队表示他们“始终努力确保”您可以在一天或更短的时间内完成这些更新,

这意味着他们致力于提供平滑的升级路径,使开发者能够

尽快地将其应用程序或包与新版本的 Laravel 兼容。

Named Arguments

命名参数

Named arguments are not covered by Laravel's backwards compatibility guidelines.

We may choose to rename function arguments when necessary in order to improve the Laravel codebase.

Therefore, using named arguments when calling Laravel methods should be done cautiously and with the understanding that the parameter names may change in the future.

命名参数不受 Laravel 的向后兼容性指南的约束。

我们可能会在必要时选择重命名函数参数,以改善 Laravel 的代码库。

因此,在调用 Laravel 方法时使用命名参数应该谨慎进行,

并了解参数名称可能会在未来发生变化。

参考命名参数

Support Policy

支持政策

For all Laravel releases, bug fixes are provided for 18 months and security fixes are provided for 2 years.

For all additional libraries, including Lumen, only the latest major release receives bug fixes.

In addition, please review the database versions supported by Laravel.

对于所有的 Laravel 版本,我们会提供 18 个月的错误修复和 2 年的安全修复。

对于所有的额外库,包括 Lumen,只有最新的主要版本会接收错误修复。

此外,请查阅 Laravel 支持的数据库版本。

有关于Lumen的介绍可以参考:lumen介绍

Laravel 10

Laravel 10

As you may know, Laravel transitioned to yearly releases with the release of Laravel 8.
Previously, major versions were released every 6 months.
This transition is intended to ease the maintenance burden on the community and challenge our development team to ship amazing, powerful new features without introducing breaking changes.
Therefore, we have shipped a variety of robust features to Laravel 9 without breaking backwards compatibility.

正如您所了解的,Laravel从Laravel 8开始过渡到每年发布一次主要版本。

在此之前,主要版本每6个月发布一次。

这次过渡的目的是减轻社区的维护负担,并挑战我们的开发团队,

在不引入破坏性更改的情况下提供令人惊叹、强大的新功能。

因此,我们在不破坏向后兼容性的情况下,向Laravel 9提供了多种强大的功能。

Therefore,
this commitment to ship great new features during the current release
will likely lead to future "major" releases being primarily used for "maintenance" tasks
such as upgrading upstream dependencies,
which can be seen in these release notes.

因此,在当前版本中承诺提供出色的新功能,

很可能会导致未来的“主要”版本主要用于“维护”任务,

如升级上游依赖项,这些可以在这些发行说明中看到。

Laravel 10 continues the improvements made in Laravel 9.x
by introducing argument and return types to all application skeleton methods,
as well as all stub files used to generate classes throughout the framework.

In addition, a new, developer-friendly abstraction layer has been introduced for starting and interacting with external processes.

Further, Laravel Pennant has been introduced to
provide a wonderful approach to managing your application's "feature flags".

Laravel 10通过
向所有应用程序骨架方法和用于在框架中生成类所有存根文件
引入参数和返回类型,
继续了Laravel 9.x的改进。

此外,
还引入了一个新的、对开发人员友好的抽象层
用于启动和与外部进程交互。

此外,
Laravel Pennant的引入为管理应用程序的“功能标志”提供了一种出色的方法。

有关于stub文件的简单介绍,可以参考stub简介

有关于laravel的骨架方法的简单介绍,可以参考骨架方法

PHP 8.1

Laravel 10.x requires a minimum PHP version of 8.1.

Laravel 10.x 需要的最低 PHP 版本为 8.1。

Types

Application skeleton and stub type-hints were contributed by Nuno Maduro.

应用程序骨架和存根的类型提示由 Nuno Maduro 提供。

On its initial release, Laravel utilized all of the type-hinting features available in PHP at the time.

However, many new features have been added to PHP in the subsequent years, including additional primitive type-hints, return types, and union types.

在首次发布时,

Laravel 使用了当时 PHP 中所有可用的类型提示功能。

然而,在随后的几年中,PHP 增加了许多新功能,包括额外的原始类型提示返回类型联合类型

Laravel 10.x thoroughly updates the application skeleton and all stubs utilized by the framework to introduce argument and return types to all method signatures.

In addition, extraneous "doc block" type-hint information has been deleted.

Laravel 10.x 彻底更新了应用程序骨架和框架使用的所有存根,

以在所有方法签名中引入参数和返回类型。

此外,还删除了多余的“doc block”类型提示信息。

This change is entirely backwards compatible with existing applications.

Therefore, existing applications that do not have these type-hints will continue to function normally.

此更改与现有应用程序完全向后兼容。

因此,没有这些类型提示的现有应用程序将继续正常运行。

Laravel Pennant

Laravel Pennant was developed by Tim MacDonald.

Laravel Pennant 由 Tim MacDonald 开发。

A new first-party package, Laravel Pennant, has been released.

Laravel Pennant offers a light-weight, streamlined approach to managing your application's feature flags.

Out of the box, Pennant includes an in-memory array driver and a database driver for persistent feature storage.

一个新的第一方包 Laravel Pennant 已经发布。

Laravel Pennant 提供了一种轻量级、简化的方法来管理您应用程序的功能标志。

开箱即用,Pennant 包括一个内存数组驱动程序和一个用于持久功能存储的数据库驱动程序。

Features can be easily defined via the Feature::define method:

可以通过 Feature::define 方法轻松定义功能:

use Laravel\Pennant\Feature;
use Illuminate\Support\Lottery;
 
Feature::define('new-onboarding-flow', function () {
    return Lottery::odds(1, 10);
});

这段代码定义了一个名为 new-onboarding-flow 的功能标志,并设置了它被激活的概率为 10%。

在应用程序的其他部分,开发者可以使用这个功能标志来决定是否显示或启用与“新用户引导流程”相关的功能。

这样做的好处是,开发者可以在不更改代码的情况下,通过简单地修改功能标志的设置来切换功能的激活状态。

Once a feature has been defined, you may easily determine if the current user has access to the given feature:

一旦定义了某个功能,您可以轻松确定当前用户是否有权访问给定的功能:

if (Feature::active('new-onboarding-flow')) {
    // ...
}

Of course, for convenience, Blade directives are also available:

当然,为了方便起见,Blade 指令也是可用的:

@feature('new-onboarding-flow')
    <div>
        <!-- ... -->
    </div>
@endfeature

Pennant offers a variety of more advanced features and APIs.

For more information, please consult the comprehensive Pennant documentation.

Pennant 提供了许多更高级的功能和 API。如需了解更多信息,请参考完整的 Pennant 文档。

Process Interaction

进程交互

The process abstraction layer was contributed by Nuno Maduro and Taylor Otwell.

进程抽象层由 Nuno Maduro 和 Taylor Otwell 提供。

Laravel 10.x introduces a beautiful abstraction layer for starting and interacting with external processes via a new Process facade:

Laravel 10.x 通过一个新的 Process 门面引入了一个漂亮的抽象层,用于启动和与外部进程进行交互:

use Illuminate\Support\Facades\Process;
 
$result = Process::run('ls -la');
 
return $result->output();

Processes may even be started in pools, allowing for the convenient execution and management of concurrent processes:

甚至可以在池中启动进程,从而方便执行和管理并发进程:

use Illuminate\Process\Pool;
use Illuminate\Support\Facades\Process;
 
[$first, $second, $third] = Process::concurrently(function (Pool $pool) {
    $pool->command('cat first.txt');
    $pool->command('cat second.txt');
    $pool->command('cat third.txt');
});
 
return $first->output();

In addition, processes may be faked for convenient testing:

此外,为了方便测试,还可以伪造进程:

Process::fake();
 
// ...
 
Process::assertRan('ls -la');

For more information on interacting with processes, please consult the comprehensive process documentation.

有关与进程交互的更多信息,请参阅全面的进程文档。

Test Profiling - 测试分析

Test profiling was contributed by Nuno Maduro.

测试分析是由 Nuno Maduro 贡献的。

The Artisan test command has received a new --profile option that allows you to easily identify the slowest tests in your application:

Artisan 测试命令已经接收到了一个新的 --profile 选项,该选项允许您轻松识别应用程序中最慢的测试

php artisan test --profile

For convenience, the slowest tests will be displayed directly within the CLI output:

为了方便起见,最慢的测试将直接在 CLI 输出中显示:

Pest Scaffolding - Pest 脚手架

New Laravel projects may now be created with Pest test scaffolding by default.

To opt-in to this feature, provide the --pest flag when creating a new application via the Laravel installer:

现在,新的 Laravel 项目默认可以使用 Pest 测试脚手架来创建。

若要使用此功能,请在通过 Laravel 安装程序创建新应用程序时提供 --pest 标志:

laravel new example-application --pest

Generator CLI Prompts

Generator CLI prompts were contributed by Jess Archer.

生成器 CLI 提示是由 Jess Archer 贡献的。

To improve the framework's developer experience, all of Laravel's built-in make commands no longer require any input.

If the commands are invoked without input, you will be prompted for the required arguments:

为了改善框架的开发体验,Laravel 的所有内置 make 命令现在都不再需要任何输入

如果命令在没有输入的情况下被调用,您将收到有关所需参数的提示:

换句话说,Laravel 的 make 命令现在变得更加智能和方便。

开发者只需要简单地运行命令,系统就会自动询问他们需要哪些参数,而不需要提前手动指定。

这样的设计使得开发者在使用 Laravel 框架时,可以更加高效和轻松地创建和管理他们的代码和资源。

php artisan make:controller

Horizon / Telescope Facelift - 焕然一新

Horizon and Telescope have been updated with a fresh, modern look including improved typography, spacing, and design:

HorizonTelescope 已经更新为清新现代的外观,包括改进的字体、间距和设计:

Horizon它通常用来描述地平线,即天与地的交界线,或者是视线所及的最远之处。

“Telescope”的含义是“望远镜”。


在Laravel框架中,Horizon和Telescope是两个非常重要的扩展包,分别提供了队列监控应用程序调试的功能。


Horizon是Laravel官方出品的Redis队列管理工具

它提供了一个直观的仪表盘,可以显示队列任务的实时状态、监控和管理工具。

开发者可以使用Horizon轻松地监控队列任务的执行情况、重试失败的任务以及管理队列的工作进程。

此外,Horizon还提供了代码配置选项,使得开发者可以更加灵活地对其进行设置和调整。

通过Horizon,开发者可以更加清晰地了解队列任务的吞吐量执行时间以及任务失败情况等关键指标,从而更好地优化应用程序的性能。


另一方面,Telescope是Laravel框架的优雅调试助手,

它提供了对进入应用程序的请求、异常、日志条目、数据库查询、排队的作业、邮件、通知、缓存操作、定时计划任务、变量转储等的深入了解。

通过Telescope,开发者可以更加全面地了解应用程序的运行情况,从而更好地进行调试和优化。

此外,Telescope还提供了清晰的界面和灵活的配置选项,使得开发者可以更加方便地使用它进行应用程序的调试工作。

它是本地Laravel开发环境的绝佳伴侣,可以帮助开发者更加高效地开发和调试Laravel应用程序。


总的来说,Horizon和Telescope都是Laravel框架中非常重要的扩展包,

它们提供了队列监控和应用程序调试的功能,帮助开发者更加清晰地了解应用程序的运行情况,并优化其性能。

标签:laravel,Laravel,10,notes,应用程序,版本,Pennant,release,new
From: https://www.cnblogs.com/gnuzsx/p/18017458

相关文章

  • 开源免费的专注于建立大型个人知识库推荐-Trilium Notes
        TriliumNotes是一个分层的笔记应用程序,专注于建立大型个人知识库。支持相当丰富的markdown,包括mermaid和latex,而且即时渲染,和typora一样。支持代码类型的笔记,有高亮。 Trilium与其说是笔记软件,不如说是个人wiki。个人知识数据库、收藏夹、代码块、手账、思......
  • Oracle Java SE Product Releases
    1.gotothemainpage[https://www.oracle.com/]2.thenclick'Products'tochoosetheJavaicon3.clickthe'OracleJavaSEPlatform'icon[https://www.oracle.com/java/]4.repeattheactionasbelow[https://www.oracle.com/java/t......
  • OpenHarmony——4.1release代码走读——dsoftbus/core/discovery/coap
    这是dsoftbus/core/discovery/coap目录的结构.├──common│  ├──include│  │  └──disc_coap_parser.h│  └──src│  └──disc_coap_parser.c├──disc_coap.gni├──interface│  ├──disc_coap.h│  └──disc_......
  • 如何实现Laravel的服务容器
    1.容器的本质服务容器本身就是一个数组,键名就是服务名,值就是服务。服务可以是一个原始值,也可以是一个对象,可以说是任意数据。服务名可以是自定义名,也可以是对象的类名,也可以是接口名。//服务容器$container=[//原始值'text'=>'这是一个字符串',//自定义服务......
  • laravel8 生成pdf
    privatestaticfunctioncreatePdfSendEmail($job_notes_id){#信息$recruit_job_notes_auth=DB::table('notes_auth')->select(["mobile","job_id"])->find($job_notes_id);if(!$recruit_job_note......
  • Laravel中toArray()方法使用驼峰变量
    前言不知道大家在用Laravel开发过程中有没有遇到过模型查询时,with中使用驼峰命名变量名,但是使用toArray方法后,变量名变成了蛇形命名;比如说这样的一条查询语句:WorkflowModel::query()->with(['workflowsInfo'])->get()->toArray();查询出来的结果可能就是这样的:查询出来关联......
  • laravel生成二维码,并添加背景图片,图标logo
    1、安装组件composerrequiresimplesoftwareio/simple-qrcode1.3.*在 config/app.php 注册服务提供者:SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class同样在 config/app.php 添加 QrCode 门面:'QrCode'=>SimpleSoftwareIO\QrCode\Facades\QrCode::class2......
  • Err: http://packages.ros.org/ros2/ubuntu jammy InRelease Clearsigned file isn't
    问题描述Ubuntu22.04已安装ros2终端报错内容:jackie@MS-7E06:~/z_ws_ros2$sudoaptupdate[sudo]passwordforjackie:Get:1file:/var/cuda-repo-ubuntu2204-12-1-localInRelease[1,572B]Get:1file:/var/cuda-repo-ubuntu2204-12-1-localInRelease[1,572B]......
  • laravel 跨域
    laravel怎么设置跨域(两种方法)在前后端分离的项目中,前端请求后端接口时可能会遇到跨域的问题。其中,一个典型的场景是:前端项目运行在http://localhost:8080,而后端项目运行在http://localhost:8000,这时候就需要设置跨域。在Laravel中,要设置跨域可以采用以下两种方法。1、中间......
  • laravel collect结果集group分组合并数据
    1、需求将相同apply_id的apply_remark用;拼接$r=[['apply_id'=>1,'apply_remark'=>'xxx'],['apply_id'=>1,'apply_remark'=>'xxx2'],['apply_id'=>2......