You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now Drab injects its javascript directly into the page. This is why:
Drab’s JS are dynamic (EEx), they depends on the configuration: for example they injects only the parts of used Drab Modules, so if you don’t want to use Drab.Live, it does not inject that part of javascript. Also, there are configuration options which changes the generation of the JS part.
The JS generation function (Drab.Client.run/2) passes some information from conn to the client, for example - the controller name, in the token, which is checked on each execution of the event handler.
Personally, I find npm and friends a nightmare.
I could extract all Drab JS and put it as an npm package, changing Drab.Client.run/2 to pass all the configuration options and modules to use. I could even split it into individual packages, so you could decide if you want Drab.Live or not.
Is it worth the effort?
The text was updated successfully, but these errors were encountered:
Now Drab injects its javascript directly into the page. This is why:
Drab’s JS are dynamic (EEx), they depends on the configuration: for example they injects only the parts of used Drab Modules, so if you don’t want to use Drab.Live, it does not inject that part of javascript. Also, there are configuration options which changes the generation of the JS part.
The JS generation function (
Drab.Client.run/2
) passes some information from conn to the client, for example - the controller name, in the token, which is checked on each execution of the event handler.Personally, I find npm and friends a nightmare.
I could extract all Drab JS and put it as an npm package, changing Drab.Client.run/2 to pass all the configuration options and modules to use. I could even split it into individual packages, so you could decide if you want
Drab.Live
or not.Is it worth the effort?
The text was updated successfully, but these errors were encountered: