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.
Some weeks ago I fixed a broken compatibility of basset with @loadOnce directives in #122
That fixed the reported issue but left other cases un-handled, like @loadOnce blocks.
A search across our repos, I see we left some @loadOnce behind in PRO package. https://github.com/search?q=org%3ALaravel-Backpack+%40loadOnce%28&type=code
In some way, it kind of makes sense having some @loadOnce, since we didn't tell users to remove the loadOnce and use @basset as we did for most of our code, people who had published files with @loadOnce would expect them to still work.
As you see we only use @loadOnce for blocks of javascript, ence this fix is targeted at that. To expand the scope of this to support either css or js like bassetBlock does, we would need to parse the
buffer
(ob_get_clean()) and maybe search for<script>
or<style>
tags.I could have also changed the @loadOnce directives we have in our code to @bassetBlocks, but that would still be a BC for users that have published those buttons before.
I think this gives us the better compatibility until we remove loadOnce completely in next version as we should have done when launching basset. 🤷 it is what it is.