Replies: 6 comments
-
Hmm... that's interesting. It would be a good solution for #2118 I think. Thank you for the suggestion @SamSebastien ! |
Beta Was this translation helpful? Give feedback.
-
@tabacitu I think this is worth, do you see this as a Best, |
Beta Was this translation helpful? Give feedback.
-
I noted in the #2118 you mentioned how large the file would be. The use case I had in mind for this is when you know you only need say "text field, simplemde field, image field, select2" and all the other fields are not in use. If you had a pre-generated webpack file, you could just comment out the lines you don't want to use and the bundle would be very small in comparison to the whole field set. |
Beta Was this translation helpful? Give feedback.
-
Exactly. This would, however, need changes in ALL fields, so they no longer load the JS inside the field. So it probably needs an asset pipeline too. Or a toggle somewhere between the webpack-generated bundle and individual JS files. Which would litter the blade view with if statements, and make it even more difficult to maintain so many field types. But I think it's a great idea to explore nonetheless. Let's think about this some more, see where it takes us. One idea is to implement this in Backpack 5, when we split it into BackpackLite (MIT License - free and open source) and BackpackPro (same YuMMY license as now, paid, closed source):
|
Beta Was this translation helpful? Give feedback.
-
Thinking about the issue with the One potential solution would be to let the user specify in the config file (as an array) which fields they have chosen to compile / enable. This way when the Controller script runs it could simply check the config file to ensure the specified field is enabled, and if not, fallback to Then the Blade View can assume that it has the required JS assets available and simply attempt to run as normal? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be awesome to have the option in
php artisan backpack:install
to disable publishing assets to public folder and include a webpack file that lets the user compile them to single files such asbackpack.css
andbackpack.js
.I can see this would also need to add some sort of config variable that lets the field blade files not attempt to load the individual assets, but it would definitely keep the public director a lot neater!
Beta Was this translation helpful? Give feedback.
All reactions