Releases: brefphp/bref
0.5.0-beta1
First beta release for v0.5. This is a "major" version without BC break, but with major changes that affect the usage of Bref.
This is a beta version, please test and report any problem. Note that the new documentation hasn't been published yet because this is not a stable release.
Switching from SAM to Serverless
AWS SAM is being replaced by Serverless as the tool to configure and deploy applications.
This is a major change because:
- Bref now recommends Serverless instead of SAM
- the documentation has been rewritten around Serverless
- tooling has been added around Serverless
SAM will continue to work with Bref, just like CloudFormation, Terraform, Now (#368), etc. Bref layers are independent of the tooling used. If you have created applications with SAM, you can keep using it. Most of the time however migrating template.yaml
to serverless.yml
is not too complex (migrating a production stack may be more effort).
Why?
Serverless offers a configuration format (serverless.yml
) that is much simpler and more concise (#320). Sometimes serverless.yml
is twice less YAML than template.yaml
for the same application.
Another major simplification is that the stack name and the region are configured inside serverless.yml
. Deploying no longer take 3 steps and 10 lines of code, but only 2 words:
# Before
aws s3 mb s3://<bucket-name>
sam package \
--output-template-file .stack.yaml \
--region eu-west-1 \
--s3-bucket <bucket-name>
sam deploy \
--template-file .stack.yaml \
--region eu-west-1 \
--capabilities CAPABILITY_IAM \
--stack-name <stack-name>
# After
serverless deploy
On top of that, Serverless offers a plugin system that lets us simplify a lot of things, especially around Bref (#351). For example, using Bref layers is now much simpler:
# Before
functions:
foo:
handler: index.php
layers:
- 'arn:aws:lambda:us-east-1:209497400698:layer:php-73:7'
# After
functions:
foo:
handler: index.php
layers:
- ${bref:layer.php-73}
Layer version numbers are now tied to a specific Bref version, and we no longer need to mess with the AWS region name. Upgrading layers is now as simple as upgrading Bref via Composer.
Additionally, serverless deploy
can deploy the same application in multiple stages.
Finally, Serverless offers a lot of plugins: https://serverless.com/plugins/
Other changes
0.4.1
Following the 0.4.0 release the runtimes need to be updated (see https://runtimes.bref.sh/ for the latest versions).
This release updates the version of the runtimes when using bref init
to start a project.
0.4.0
Bref has moved on GitHub and Packagist to its own organization:
- the project is now at https://github.com/brefphp/bref on GitHub
- the Composer package has been renamed from
mnapoli/bref
tobref/bref
To update to future releases you need to change your dependency in composer.json
to replace mnapoli/bref
with bref/bref
.
Other than that this 0.4.0 release contains no BC break.
Features
- #262, #263, #338: ALB is now supported as an alternative to API Gateway: this can be useful for applications with high traffic as ALB is cheaper than API Gateway at scale. (by @atrope)
- #269: Using a database is now documented at https://bref.sh/docs/environment/database.html (by @mnapoli)
- #334: Bref can now keep your HTTP lambdas warm using a scheduled event, this is documented here: https://bref.sh/docs/runtimes/http.html#cold-starts (by @thibaudlemaire)
- #335: The
bref deployment
command will now display the CloudFormation outputs. This makes it easier to retrieve the URL of the websites/APIs we deploy. (by @mnapoli)
Other changes
0.3.9
-
Fixed #316 (random FastCGI errors) with #319 by replacing the underlying library for FastCGI communication (we now use hollodotme/fast-cgi-client).
This brings a performance improvement as well (around 1ms shaved of HTTP responses, which is a 40% improvement).
-
#301 New PHP extension available:
sockets
(update to the latest runtimes) -
#311 The AWS Lambda context is now available in PHP as the second parameter for handlers, see https://bref.sh/docs/runtimes/function.html#context for the complete documentation. Example:
lambda(function (array $event, Context $context) { return /* response */; });
-
Fixed #323 Better handling of errors in
bref init
-
Fixed #275 with #321: avoid filling up
/tmp
with PHP-FPM core dumps -
#308 New
bref deployment
command to debug what went wrong with the last deploymentvendor/bin/bref deployment <stack-name>
0.3.8
0.3.7
- Fix #292 with #293: add the
bcmath
extension - Fix #294: add the
mysqli
extension - Fix #283 with #289: add the
soap
extension - Fix #290 with #291: populate
$_ENV
- #298: runtime optimization by reusing the curl handler
Thanks to all contributors to this release: @TiagoBrito, @jsamouh, @jenschude, @lhilton.
New runtimes have been published: see runtimes.bref.sh for the new versions.
Performances are tested via brefphp/bref-benchmark