Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFD: shall we make Drab JS static? #132

Open
grych opened this issue May 29, 2018 · 2 comments
Open

RFD: shall we make Drab JS static? #132

grych opened this issue May 29, 2018 · 2 comments

Comments

@grych
Copy link
Owner

grych commented May 29, 2018

Now Drab injects its javascript directly into the page. This is why:

  1. 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.

  2. 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.

  3. 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?

@grych grych added this to the 1.0.0 milestone May 29, 2018
@guidotripaldi
Copy link
Contributor

KISS, imho

@grych grych modified the milestones: 1.0.0, 2.0.0 Jun 20, 2018
@grych
Copy link
Owner Author

grych commented Jul 20, 2018

@grych grych changed the title RFD: shall we move Drab JS to npm? RFD: shall we make Drab JS static? Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants