Skip to content

V2 - Replace with the CacheWerk bridge #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 76 commits into from
Mar 14, 2023
Merged

V2 - Replace with the CacheWerk bridge #94

merged 76 commits into from
Mar 14, 2023

Conversation

mnapoli
Copy link
Member

@mnapoli mnapoli commented Mar 10, 2023

Version 2.0 of this Bref-Laravel bridge will be radically different.

Indeed, we are importing all the code and git history of this alternative bridge by CacheWerk: https://github.com/cachewerk/bref-laravel-bridge This bridge is better maintained and supports Laravel far better.

This pull request will be merged once Bref 2.0 is released: the v2.0 of the Laravel bridge will be released at the same time.

What is this PR?

This PR:

  • removed all the code from the master branch
  • then imported all the git commits from https://github.com/cachewerk/bref-laravel-bridge (via a git merge, rebasing everything would have been too risky and not worth it I think)
  • then restored the Composer package & namespace to be the one that exist on master

Related docs PR: brefphp/bref#1424

What's new?

What will change with v2.0:

  • Octane support!
  • Automatically caches the config (if not already cached) on Lambda cold start
  • Supports a Maintenance mode
  • Moves the entire storage directory to /tmp (fixes Missing override path for "real-time" facades #8)
  • Optionally serves basic assets (e.g. favicon.ico and robots.txt) from PHP on Lambda
  • Automatically fixes the config of AWS credentials to support the AWS_SESSION_TOKEN variable
  • Automatically sets app.mix_url from app.asset_url
  • Automatically adds the X-Request-ID header to the log context

And more importantly, it changes how SQS queues are handled (this is the most significant breaking change).

  • Laravel bridge 1.x adapts Laravel Queues to SQS: the retry strategy and storing of failed messages are handled by SQS via serverless.yml. All SQS features are supported, but only a fraction of Laravel Queues features are supported.
  • Laravel bridge 2.0 follows the official behavior of Laravel Queues instead. Only a fraction of SQS features are supported, but all features of Laravel Queues are supported (e.g. job retry, delay, rate limiting, storing failed messages…).

The reason for this choice is:

  • Laravel Queues simply has better features for job/queue management.
  • Over time, we've seen many Laravel developers confused because most Laravel Queues feature were not working.
  • Laravel users will be able to port existing projects to Lambda without code changes.

FAQ

What about the v1 of this bridge?

The v1 will still be available on GitHub (we'll create a v1 branch) and Composer. It will continue to work, however we will not maintain it anymore (unless for critical security issues).

What about https://github.com/cachewerk/bref-laravel-bridge ?

The CacheWerk bridge will be deprecated in favor of this bridge. The creators and maintainers of the CacheWerk bridge (@tillkruss & @georgeboot) will join this repository as maintainers. The entire git/code history of https://github.com/cachewerk/bref-laravel-bridge is imported into this bridge as v2.0.

TODO

szepeviktor and others added 15 commits February 2, 2023 08:47
* Improve CI

* Do not export Codespell config

* Fix Spelling workflow

* rename

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
* Improve logs and error handling on directory creation

* formatting

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
* Do not enable the S3 filesystem by default

See #79 (comment)

Setting the S3 filesystem by default could be confusing because it won't work (the S3 bucket needs to be created and configured).

* Document how to use the S3 filesystem in the example `serverless.yml`
* Support Laravel 10

* monolog 3

* Support both monolog v2 and v3
* Provide a default `serverless.yml` with FPM by default

* Move Bref initialization code in the service provider so that it applies to all runtime types

* Enable direct deployments by default because they are faster

* Remove the population of env vars from SSM parameters

This is a native Bref feature since Bref 2.0.

* Remove `deploymentMethod` as it is set by default in Bref 2.0

* Run `config:cache` on cold starts using the new Bref hooks

* Simplify the Octane handler

* Simplify the Octane runtime usage

* Make sure file handlers are still supported

* flatten

* inline

* formatting

* fix

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
* Make sure the OctaneHandler is not created by the Laravel kernel

Indeed, Octane boots Laravel (not the other way around)

* sort

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
@mnapoli
Copy link
Member Author

mnapoli commented Mar 14, 2023

Branch 1.x created, let's go!

@mnapoli mnapoli merged commit 70def2a into master Mar 14, 2023
@mnapoli mnapoli deleted the v2 branch March 14, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing override path for "real-time" facades
4 participants