Comments (5)
Hello !
First of all, I am very proud and happy to talk to you.
It's only been 6 months since I started Symfony through your lessons on Symfonycasts.
In datatables.net we have many datatables themes , and i want to give the developer the possiblity to choices the theme easy by passe the name of theme to the Datatable object.
to use the object later in TwigExtension to render the datatable and import the theme in the same time.
The current solution is like what you said :
What is the condition? It is likely that you will need 2 different controllers for the 2 different situations. And the user chooses which to use somehow.
separate the themes using empty controllers by import the theme js & css file inside .
I don't know if it's the best pratique ?
from webpack-encore-bundle.
Thanks for your time !
Unfortunately, the themes is contians JS & CSS files.
so i think in this is situation we have one solution :
separate the themes using empty controllers by import the theme js & css file inside .
from webpack-encore-bundle.
Hi!
Do you still have this issue? I know what bundle you're referring to now :).
maybe that impossible because webpack needs to build files before
Yes, Webpack needs to know all of the files at build time - that part can't change at runtime.
i need to import js file with this is view, the js file can changed base on condition.
What is the condition? It is likely that you will need 2 different controllers for the 2 different situations. And the user chooses which to use somehow.
Cheers!
from webpack-encore-bundle.
Thanks for your kind words ❤️ . And congrats for coming so far in just 6 months!
In datatables.net we have many datatables themes , and i want to give the developer the possiblity to choices the theme easy by passe the name of theme to the Datatable object
Unfortunately, while this makes sense from a user perspective, Webpack needs to know "at build time" which CSS files to include. So, this config needs to live in some file that Webpack parses - e.g. controllers.json. There's not going to be a great way to handle this in Symfony config or when the user renders the data table.
If changing from one theme to another is only a matter of using one CSS file vs another CSS file, then the best way to handle this is using autoimport
in controllers.json
. I'd recommend shipping with one CSS file enabled by default, then maybe a few other CSS files in autoimport
for other themes, which are disabled by default. Example: https://github.com/symfony/ux/blob/b7f636b1c22cc8dd8bcf3a7785bff96e8eb5b64c/src/Autocomplete/assets/package.json#L15-L18
Cheers!
from webpack-encore-bundle.
I agree - cheers!
from webpack-encore-bundle.
Related Issues (20)
- Webpack Encore context directory issue
- Yarn warning when updating webpack-cli to v5 HOT 1
- Missing entrypoints.json when installing from scratch on Symfony HOT 1
- Unknown "encore_entry_link_tags" function HOT 4
- Add Twig function and filter for Stimulus Outlets integration HOT 2
- Move Stimulus helpers to UX repository HOT 1
- Unable to preload links: feature not supported HOT 4
- 2.0 not usable with symfony 5.4 (twig-bundle conflict) HOT 1
- recipe update not working HOT 3
- Error when reusing Symfony web server SSL certificate HOT 1
- preload + integrity hash + cloudflare HOT 2
- assets base_path parameter not considered by encore_entry_link_tags and encore_entry_script_tags functions HOT 5
- TagRenderer EntrypointLookupCollectionInterface , encore_entry_script_tag issue HOT 4
- PreloadAssetsEventListener does not use integrity hashes HOT 6
- Package installation is broken on SF 5.4 is broken HOT 1
- Deprecation with Symfony 6.4: Symfony\WebpackEncoreBundle\CacheWarmer\EntrypointCacheWarmer::doWarmUp() ... HOT 2
- package.json not updated
- ock content hash
- encore_entry_link_tags incorrectly querying manifest.json
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-encore-bundle.