-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Sage 10 Cleanup #2171
Sage 10 Cleanup #2171
Conversation
Enable preflight by default Bump version to 10.0.0 in package.json and style.css Change PHP requirement to 7.1.3 Upgrade roots/sage-installer Remove deprecated qwp6t/acorn repository from composer.json Add some sane optimizations to composer.json Remove excessive linebreaks from helpers.php Make config linebreaking uniform Add missing space to ! conditionals to stay consistent with PSR-1/2 Update the file structure in README.md and add the new sponsor Revert to shorthand @php() Add aside markup to sidebar and wrap it in @hasSection Add a document wrapper Add ARIA roles to the document, main, aside, header, nav, and footer wrappers Change entry-meta conditional in content-search.blade.php to an @includeWhen Add some sane linebreaks throughout the views and codebase to increase readability Add docblocks to the example Title.php composer
I'm not sure if I'm on board with wrapping the header and footer elements. ARIA role for main and aside are redundant since those are already their default roles, and when direct descendants of the body, the default roles for header and footer are banner and contentinfo, respectively. The document role is unnecessary since web pages are treated as documents by default. It would only be necessary if the parent element had a different role, such as a widget or an application. |
That's fair. I'll scrap them. |
I see a mixture of In resources/views/partials/comments.blade.php, you have: <li class="next">{!! get_next_comments_link(__('Newer comments →', 'sage')) !!}</li> In resources/views/layouts/app.blade.php, you have: <html @php(language_attributes())> I think we should be consistent here. I'm cool with either one, but I slightly lean toward |
config/app.php
Outdated
'preflight' => false, | ||
|
||
'preflight' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a compromise, I would say to have preflight set to WP_ENV !== 'production' or something so that by default it's not enabled in production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess one afterthought I have on this is the default location of the cache
being in uploads
– perhaps this might be problematic for those who are just pushing updates to their base theme and not pushing the new cache up?
If so, would putting cache
in resources
maybe be more sane?
Remove roots/wp-blade-check until we decide on where to put it Only enable preflight when not in production
I agree on the consistency. I did it in this case out of somewhat personal appeal as we are stuck with using Nonetheless I reverted it for now. |
thanks for all this @Log1x! merging this now since it fixes the missing search view we can address any other concerns in a new branch/PR (like the cache folder) |
No problem. Sounds good. |
This PR turned into a little more than I originally anticipated, but I will follow some more opinionated changes with my reasoning and we can go from there.
Changelog
Enhancements
preflight
by defaultwhen not in production.@php
and@endphp
to@php()
@php()
still works perfectly fine. The only caveat is it can not be mixed with@endphp
in the same template. With the addition of Composers, not only should using@php
be avoided at all costs, but@php(...)
works perfectly fine when multi-lined.@php()
is considerably more aesthetic, easier to read, cleaner, and doesn't break syntax highlighting in editors such as VSCode.helpers.php
.!
conditionals to stay consistent with PSR-1/2.aside
markup to sidebar and wrap it in@hasSection
.Add a document wrapper with an ID ofapp
.Not only necessary for ARIA compliance (role="document"
) – but useful to have in place for Vue, etc.Add ARIA roles to the document,main
,aside
,header
,nav
, andfooter
wrappers.entry-meta
conditional incontent-search.blade.php
to an@includeWhen
.Title.php
composer.Add WP Blade Check to alert users of publicly viewable Blade files.10.0.0
inpackage.json
andstyle.css
.roots/sage-installer
to^1.6
.^7.1.3
to match Acorn (and Laravel).qwp6t/acorn
repository fromcomposer.json
.composer.json
(courtesy of Laravel).README.md
.trim_trailing_whitespace
tofalse
for*.md
files to allow linebreaks in markdown files.Bugfixes
form.search
view.$title
where used.