feat(chunks): keep chunk code in files, deprecate the database column - #2447
Open
elcreator wants to merge 1 commit into
Open
feat(chunks): keep chunk code in files, deprecate the database column#2447elcreator wants to merge 1 commit into
elcreator wants to merge 1 commit into
Conversation
A chunk's code now lives in views/chunks/<name>.html. The file is the chunk if it exists; the site_htmlsnippets column is what a chunk nobody has saved since holds, and the mirror the manager's search still reads. Both readers - the parser on demand and the site cache builder, which short circuits it - go through one rule, so a cached chunk does not render the stale column. No column, no setting and no migration: a site crosses over one save at a time and one that saves nothing keeps rendering what it always did. Every database path is marked @deprecated since 3.5.8 with @todo [remove@3.7], so `artisan deprecated:list` collects them. Under views/, not assets/: the root .htaccess passes ^assets/ straight to the filesystem, and chunks are where older extras keep configuration. Verified against Apache - a file under assets/chunks came back 200 with its contents, the same file under views/ came back 403. The directory ships with deny guards, and the store writes them wherever it is pointed. Chunk names are prose, so hazardous bytes are percent-encoded rather than the name refused, and decoded back exactly: "nav/main" is nav%2Fmain.html, "CON" is %43ON.html, "Кнопка" stays readable. What encoding cannot fix is refused with a reason - invalid UTF-8, not NFC, too long once escaped, or a name that would share one file with another chunk on a case-insensitive filesystem. The form previews the same encoding the store applies. Renaming or deleting a chunk takes its files with it; one left behind would be adopted silently by the next chunk named the same. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P9k7KBwVFZ6PSWH27ePZuJ
This file contains hidden or 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
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.
A chunk's code now lives in views/chunks/.html. The file is the chunk if it exists; the site_htmlsnippets column is what a chunk nobody has saved since holds, and the mirror the manager's search still reads. Both readers - the parser on demand and the site cache builder, which short circuits it - go through one rule, so a cached chunk does not render the stale column.
No column, no setting and no migration: a site crosses over one save at a time and one that saves nothing keeps rendering what it always did. Every database path is marked @deprecated since 3.5.8 with @todo [remove@3.7], so
artisan deprecated:listcollects them.Under views/, not assets/: the root .htaccess passes ^assets/ straight to the filesystem, and chunks are where older extras keep configuration. Verified against Apache - a file under assets/chunks came back 200 with its contents, the same file under views/ came back 403. The directory ships with deny guards, and the store writes them wherever it is pointed.
Chunk names are prose, so hazardous bytes are percent-encoded rather than the name refused, and decoded back exactly: "nav/main" is nav%2Fmain.html, "CON" is %43ON.html, "Кнопка" stays readable. What encoding cannot fix is refused with a reason - invalid UTF-8, not NFC, too long once escaped, or a name that would share one file with another chunk on a case-insensitive filesystem. The form previews the same encoding the store applies.
Renaming or deleting a chunk takes its files with it; one left behind would be adopted silently by the next chunk named the same.