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

Bundle AngularJS with Piwik #4691

Closed
mattab opened this issue Feb 17, 2014 · 29 comments
Closed

Bundle AngularJS with Piwik #4691

mattab opened this issue Feb 17, 2014 · 29 comments
Labels
Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 17, 2014

The goal of this ticket is to gather all good ideas on how we could use AngularJS within Piwik and make the most of it.

  • Introduce AngularJS and define some best practices
    • Good / bad practices
    • ~~When AngularJS can or should be used ~~
    • ~~Some examples ~~
    • Links to some good blog posts / videos, eg. AngularJS Recipes
    • What to consider for IE8 compatibility
    • ...
  • Define / change file structure of AngularJS widgets (the earlier the better)
    • Instead of grouping files into javascript, stylesheet, templates, ... folder we could separate them by use case. Meaning under a plugin there is a folder per feature such as "siteselector" which contains all related files. For instance siteselector(-contorller.js), sitecontroller-directive.js, sitecontroller.html, sitecontroller-filter.html
    • ~~There might be especially under CoreHome plugin a folder such as "common" where files are grouped into folders "filter", "service", "directive", ... for commonly used code. ~~
  • For Piwik core package: use a Package manager for Javascript such as bower.io
    • This would be used by plugins to define their JS dependencies
    • This would allow Piwik to load a given library only once, when two plugins or more require such JS lib
    • Document in developer.piwik.org this new workflow
    • Marketplace when packaging plugins, will resolve JS dependencies.
    • Builds.piwik.org when building Piwik, will resolve core JS dependencies.
  • ~~We could use Karma (http://karma-runner.github.io/0.10/index.html) + MochaJS ~~(http://visionmedia.github.io/mocha/) to run and write tests.
    • Provide a karma config and write a howto setup
    • Write some test examples
  • Grunt.js (http://gruntjs.com/) can be used to simplify some common tasks
    • Might be interesting for the build process as well
    • Features like Live-reload are interesting
  • Documentation

See also:

Documentation

@gaumondp
Copy link

Just wanted to add some input on user case when the Piwik server doesn't get access to the internet :

Please take into consideration that those nice installers/packages managers don't make sense to few of your users if they don't have a master configuration to set a local directory instead of external URLs.

Same apply for the Marketplace or GeoIP download.

Dali

@tsteur
Copy link
Member

tsteur commented Feb 17, 2014

@daliDev those tools are meant for development, not production

@gaumondp
Copy link

Everything is ok then !

@mattab
Copy link
Member Author

mattab commented Mar 11, 2014

Increasing priority of tickets in alignment with our vision of a powerful open platform

@tsteur
Copy link
Member

tsteur commented Mar 12, 2014

In a553312: refs #4691 moved components temporarily into a folder named angularjs

@tsteur
Copy link
Member

tsteur commented Mar 12, 2014

In cae443f: refs #4691 fixing filenames

@tsteur
Copy link
Member

tsteur commented Mar 12, 2014

Documentation is partly available under https://github.com/piwik/developer-documentation/blob/master/docs/angularjs-getting-started.md

File structure is defined as well, see https://github.com/piwik/developer-documentation/blob/master/docs/angularjs-getting-started.md#code-organization--file-structure . It is not ideal yet for sure but we will hopefully fix this medium-term once we have more AngularJS based components. All components should be ideally directly under the plugins directory.

@mattab
Copy link
Member Author

mattab commented Mar 27, 2014

A great candidate for an AngularJS rewrite would also be the segment editor.

@tsteur
Copy link
Member

tsteur commented Mar 29, 2014

In 9e9441e: refs #4691 started to add support for unit tests by using karma + mochajs +chai/expect.js

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 25f7c2c: refs #4691 use chai instead of expect.js, run tests by default only in PhantomJS, added missing node modules

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 70eeacc: refs #4691 wondering if we can easily enable travis for angularjs tests

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 11acb3f: refs #4691 install npm before running tests

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 9164d29: refs #4691 added missing version field

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 1b7e42b: refs #4691 should make sure we have latest node version

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 53e4de5: refs #4691 updated doc

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 7c1a73d: refs #4691 assume yes to all queries

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 329a293: refs #4691 added more test cases

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 275b6b0: refs #4691 make sure to install correct package

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In ad5de13: refs #4691 fix file name

@tsteur
Copy link
Member

tsteur commented Mar 30, 2014

In 18a35b3: refs #4691 log only errors

@tsteur
Copy link
Member

tsteur commented Mar 31, 2014

In 735c091: refs #4691 added more example tests and fixed a bug found because of the tests

@tsteur
Copy link
Member

tsteur commented Mar 31, 2014

Read more about how to run and write tests here: https://github.com/piwik/piwik/blob/master/tests/angularjs/README.md

@tsteur
Copy link
Member

tsteur commented Mar 31, 2014

Removing yoeman for now, not really needed at the moment

@tsteur
Copy link
Member

tsteur commented Mar 31, 2014

In cd043e6: refs #4691 use spec and mocha reporter, prepared usage of jshint

@tsteur
Copy link
Member

tsteur commented Mar 31, 2014

In 5c326f6: refs #4691 make sure mocha reporter is there

@tsteur
Copy link
Member

tsteur commented Mar 31, 2014

In c62423b: refs #4691 _test.js => _spec.js

@julienmoumne
Copy link
Member

ref #3838

@tsteur
Copy link
Member

tsteur commented May 5, 2014

I'm closing this ticket for now. We can create tickets for the not yet resolved items once we need/want/decide to use them.

@mattab
Copy link
Member Author

mattab commented May 6, 2014

Great effort Thomas!

Letting users and developers modify the interface via JavaScript will be a great achievement, and much needed for our vision to build the best open platform for analytics.

@mattab mattab added this to the 2.2.1 - Piwik 2.2.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

4 participants