-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Leaf MVC v4.0 #36
Draft
mychidarko
wants to merge
243
commits into
master
Choose a base branch
from
v4.x
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Leaf MVC v4.0 #36
Conversation
This file contains 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
This commit fixes an inconsistency between: - User model (using 'fullname') - Migration template (using 'name') - Schema JSON example (using 'name') This ensures consistent field naming across the framework.
…ency fix: Change User model fillable field from 'fullname' to 'name'
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.
What kind of change does this PR introduce? (pls check at least one)
Description
This was a bit unexpected even for me, I started of working on the changes suggested in the last blog post which talked about how Leaf MVC had grown in bloat, but the goal was to quickly clean up the bloat and push out a v3.8 which had no breaking changes. While this was done, other fixes like re-organizing the view layer which was carried over from v1 of Leaf MVC added a number of breaking changes. While there were ways to keep the changes subtle, they would have unnecessary costs for performance.
So yes v4 of Leaf MVC. This major version is going to focus on the usability part of Leaf MVC. Building on what what written in the post, we are going to move a lot of things away from the Laravel/Ruby on Rails way of doing things, and it will be a completely different, but natural way of thinking about your applications.
While it introduces a different way of thinking about your applications, your code will look a lot like what you are already used to, so there's no need to panic about relearning everything you already know. Well, let's look at the major changes you can expect in the upcoming version.
Leaner directory structure
As mentioned, we are going to cut down on the number of files and folders which are shipped with Leaf MVC by default. This will make it easier to keep track of everything in your application without toggling folders and going through tons of files. This will also make it easier for beginners to catch on to what's actually going on since they won't have any useless directories distracting them.
So we'll move from a directory structure that looks like this:
to one which looks like this:
Smarter loading of files/modules
v3 of Leaf MVC had some installation commands which were different from the ones used in Leaf, and that was a source of confusion for some developers. v4 is solving this by allowing Leaf MVC auto-configure modules so you don't have to use any funny commands to do all of that anymore.
In addition to modules, files like console commands and custom libraries are automatically loaded into your application and no longer require you to add or remove any lines from any file
This also applies to view engines
Revamped view engine layer
Leaf MVC has always allowed you to add any view engine of your choice, but Leaf MVC v4 does this without you having to go through the trouble of attaching the engine to Leaf first. This means you only need to set up the
config/view.php
with your custom engine and Leaf MVC will handle everything else for you, including attaching the engine to Leaf.Beyond that, the entire view layer has been re-written to include things like view engine and view config caching which have lead to an almost 100% performance gain
Auto configuration
Leaf MVC v3 relied on the config files present in the
config
folder and would throw errors if an expected file was not found. v4 moves away from this by relying on internal configuration before looking for any user-added config files. While this is slightly less performant, it offers a better experience and allows v4 to run without any visible config files further cutting down the clutter in your applications.A lot more of the config is adjustable using your
.env
file which means it's easier to separate your configuration between different environments.Lean starter
Leaf MVC v3 followed Laravel's batteries-included philosophy, but we believe it's much easier to incrementally add to your applications than to deal with features you don't need taking up space in your application. To be fair, every feature you need is one
leaf install
away.Once installed, Leaf will automatically set up any module and will allow you to publish config files for that module if needed.
DB Schema files
Going back to how we are moving away from the Ruby on Rails/Laravel way of doing things, we are exploring a better way to set up your databases without having multiple files for each table which can quickly get out of hand. We promised this will be our christmas gift to our community, so we are going to keep it sealed until the first RC of Leaf MVC v4
Does this PR introduce a breaking change? (check one)
Related Issue