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

Fix Bootstrap + fix/remove jQuery #110

Closed
jgaehring opened this issue Jul 26, 2018 · 2 comments
Closed

Fix Bootstrap + fix/remove jQuery #110

jgaehring opened this issue Jul 26, 2018 · 2 comments

Comments

@jgaehring
Copy link
Member

The way we originally imported Bootstrap and jQuery was less than ideal for our bundling system, since by just including the libraries in the root folder, we can't leverage Webpack's abilities to minimize the size of these libraries. I was going to postpone this until after we completed the Observations feature, since bundle size isn't so critical for native deployment, but with some new issues cropping up related to this, I think it may need to be resolved sooner.

Bootstrap just doesn't seem to have all the assets it needs, like the font files for glyphicons, and I'm not sure it's getting all the CSS and JavaScript behaviors it needs either; in fact, I'm not even sure if it's getting anything more than the set of CSS from Bootswatch, since I haven't seen enough of its features in action yet within the app. I want to look into better ways to import Bootstrap with npm, to jive better with our Webpack setup, and perhaps revisit the possibility of using Bootstrap-Vue, which may be a more effective means to pull in the parts of Bootstrap we need and only what we need.

As for jQuery.... This goes hand-in-hand with Bootstrap, since Bootstrap requires it, so I'll probably need to address the issues we're having with that too. It's just hard to tell what parts of the app have access to it now, since it's only living in the native repo's root (which is probably effecting Bootstrap, which lives in the client repo). I was really hoping we could eliminate it entirely (another good argument for Bootstrap-Vue, which is a Bootstrap implementation sans jQuery), because apart from Bootstrap, we're only using it for ajax, for which we could use a much smaller library (eg, axios) or no library at all (eg, fetch), without pulling in all the unneeded bloat that comes with jQuery. Its ajax method was implicitly handling cookies for us in the authentication procedure, but it should be easy enough to replicate that with axios or fetch.

@jgaehring
Copy link
Member Author

I've removed the unnecessary Bootstrap files in the native repo at 3699ad5. The only thing we're including now is the css, with the combined Bootstrap/Simplex stylesheet residing in the client repo, where it should be. The bootstrap.js file was, in fact, not being used anyways, so this won't effect the current behavior at all, just the package size.

I'm going to close this issue now so I can track the removal of jQuery in a separate issue in the native repo.

@mstenta mstenta transferred this issue from farmOS-legacy/farmOS-client Feb 19, 2019
@mstenta
Copy link
Member

mstenta commented Feb 19, 2019

(Transferring all issues from old repository. See #92)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants