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

minimal installation #16

Open
mtangoo opened this issue Apr 17, 2017 · 14 comments
Open

minimal installation #16

mtangoo opened this issue Apr 17, 2017 · 14 comments
Assignees
Labels
Milestone

Comments

@mtangoo
Copy link

mtangoo commented Apr 17, 2017

I have found there are a lot of things that are just waste and somone can install what he want (all plotting stuffs et al,) plus duplication of things like Jquery which Yii2 already bundles. I suggest they get removed and instruction on how to add them for anyone in need will be handy.

I wanted to make pull request but unfortunately have not found time to do so

@fps01
Copy link
Member

fps01 commented May 12, 2017

Hello @mtangoo !
yii2-gentelella requires only nesessary packages for layout displaying. For example, original Gentelella theme has many charts. We don't include it.
The extension uses a Yii jquery bundle and doesn't download any another.
Please describe an issue more informative.

@fps01 fps01 self-assigned this May 12, 2017
@fps01 fps01 added the question label May 12, 2017
@fps01 fps01 added this to the 1.3.0 milestone May 12, 2017
@mtangoo
Copy link
Author

mtangoo commented May 12, 2017

@fps01
That is what I expected. However looking at the vendor directory after installation there are all those files am talking about. The issue is easy to reproduce:

  1. install extension
  2. check files in extension folder

@nelsonpoon
Copy link

Oh , yeah ... i have check it
the location is @webroot/vendor/bower/gentelella/vendors ...
there is about 93MB

@fps01
Copy link
Member

fps01 commented Jun 19, 2017

So it's a structure of a theme repository. I know that a bigger part of it does not used but I do not see a pretty solution.
@nelsonpoon , @mtangoo Can you suggest solution?

P.S. A way with a fork of the theme repository is bad idea.

@mtangoo
Copy link
Author

mtangoo commented Jun 19, 2017

The first thing that came in my mind is don't install any of bower packages. Yii2 already provides JQuery, bootstrap and Jquery UI. You can provide a bower package which user can use to install packages (after editing out what he need). Only core bundles that are essential should be included by default.

I would split asset class into two, Basic and Advanced. The basic one will have core stuffs and advanced will extend core with extras (which user will have to download somehow).

TL;DR - Install core assets and let user extend asset bundle and add whatever extra asset he wants

@fps01
Copy link
Member

fps01 commented Jun 19, 2017

@mtangoo The repository that's used as theme already contains installed bower packages. I can't download all directories excluding a vendor. Or didn't I understand you?

@nelsonpoon
Copy link

@fps01 @mtangoo I am a newber of yii2 and yii2 extension , I have no idea to how to remove the JQuery from Yii2-gentelella ,but i think the following packages might be removed that was exists
*1.1M jquery (@webroot/vendor/bower/jquery/)
*1.1M jquery.inputmask (@webroot/vendor/bower/jquery.inputmask/)
*1.3M font-awesome (@webroot/vendor/fortawesome/font-awesome)
*2.5M bootstrap (@webroot/vendor/yiisoft/yii2-bootstrap)

@mtangoo
Copy link
Author

mtangoo commented Jun 19, 2017

@fps01
The file installs all those packages see this and that can be avoided by (as far as I see) by removing the bower dependency on composer.json. The Widget seems to depend only on three js files and two css files (reading from asset classes). That can be easily included with widget and updated only when tagging new releases or when some big bug is fixed on original repo. That way we can avoid the problem.

@nelsonpoon do not remove all those (except may be font-awesome which is dependency of this widget). They are Yii core part

@fps01
Copy link
Member

fps01 commented Jun 20, 2017

@mtangoo this solution will be work. But we have to observe updates of the main reporitory and pull changes by hands.
Let's vote (add reaction to this post). Add +1 - remove dependency or -1 - stay as is.

@mtangoo
Copy link
Author

mtangoo commented Jun 20, 2017

@fps01 it does not have to be manual work, simple PHP callback downloading latest versions can be added to composer for post-install command. see the composer docs on that

@mtangoo
Copy link
Author

mtangoo commented Jun 20, 2017

Here is a sample command that should not be hard to adopt

{
    "scripts": {
        "post-install-packaging": [
            "php -r \"copy('https://github.com/puikinsh/gentelella/blob/master/src/js/custom.js', '@vendor/.../js/custom.js');\""
        ]
    }
}

@fps01
Copy link
Member

fps01 commented Jun 20, 2017

@mtangoo An automatic copying can produce collisions between different versions of extensions.
For example,

  1. we have a working yii2-gentelella package (ver. 1.a.b) with gentelella package (ver. 1.x.y)
  2. the gentelella is updated (ver 1.x.y+1 or ver 1.x+1.0) and this version has a functional with critical changes
  3. the yii2-gentelella downloads new version and it breaks down some functional

Also we can create an issue at gentelella repository to remove vendor directory. I think it's a prefer way to minify size)

@mtangoo
Copy link
Author

mtangoo commented Jun 20, 2017

In that case the script have to download the release package (version will be locked in there per each release), extract the zip and copy necessary files and then delete the folder. That way we can avoid all those issues and few KBs is better than 90+MB (as those others will be deleted)

But still the idea of not including verndor and let user download them via bower/npm is better so I second opening an issue there

@fps01
Copy link
Member

fps01 commented Jul 12, 2017

@mtangoo , @nelsonpoon Work in progress (ColorlibHQ/gentelella#348)

@fps01 fps01 modified the milestones: 1.3.0, 1.4.0 Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants