Skip to content

[ZEPPELIN-2519] Disable watchers not in viewport#2326

Closed
vipul1409 wants to merge 8 commits into
apache:masterfrom
vipul1409:ZEPPELIN-2519
Closed

[ZEPPELIN-2519] Disable watchers not in viewport#2326
vipul1409 wants to merge 8 commits into
apache:masterfrom
vipul1409:ZEPPELIN-2519

Conversation

@vipul1409
Copy link
Copy Markdown

What is this PR for?

Currently all the watchers are enabled by default. I came across this github project https://github.com/wix/angular-viewport-watch to disable watchers not in viewport. This reduces number of watchers in notebooks with large number of paragraphs.

What type of PR is it?

[Improvement]

Todos

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-2519

How should this be tested?

Outline the steps to test the PR here.

Screenshots (if appropriate)

Questions:

  • Does the licenses files need update?
    Not sure of this part. This is under MIT license. Project link

  • Is there breaking changes for older versions?
    No

  • Does this needs documentation?
    No

@1ambda
Copy link
Copy Markdown
Member

1ambda commented May 9, 2017

Thanks for the contribution @vipul1409

  1. It is required to update bin_license/LICENSE when you want to add a new library.
  1. Could you restart the failed jobs in travis? If they are flaky tests, it will pass otherwise you need to fix them.
  1. Is it possible to load angular-viewport-watcher using commonjs (webpack) instead of bower?

@vi
Copy link
Copy Markdown

vi commented May 9, 2017

Probably meant "Thanks for the contribution @vipul1409"

@1ambda
Copy link
Copy Markdown
Member

1ambda commented May 9, 2017

Oops. autocompletion didn't work. Sorry for confusing.

@vipul1409
Copy link
Copy Markdown
Author

I checked Jenkins Job. The sub job failing is https://travis-ci.org/vipul1409/zeppelin/jobs/230634157 It is failing because of some git access issues. Any suggestions on what could be the issue?

Comment thread zeppelin-web/src/index.html Outdated
<script src="bower_components/MathJax/MathJax.js"></script>
<script src="bower_components/clipboard/dist/clipboard.js"></script>
<script src="bower_components/ngclipboard/dist/ngclipboard.js"></script>
<script src="bower_components/scrollMonitor/scrollMonitor.js"></script>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use scrollMonitor without installing it? it's not added to bower.js.

Comment thread zeppelin-web/bower.json Outdated
"MathJax": "2.7.0",
"ngclipboard": "^1.1.1"
"ngclipboard": "^1.1.1",
"angular-viewport-watch": "^0.1.35"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nicer to install angular-viewport-watch using npm instead of bower. Since we are trying to move npm from bower.

Here is one example.

@vipul1409
Copy link
Copy Markdown
Author

Addressed review comments and moved the dependency to npm. One jenkins job is failing but looks unrelated to my changes. I also see build is marked as failed in master, just double checking if master build is also broken.

@vipul1409
Copy link
Copy Markdown
Author

vipul1409 commented May 11, 2017

Even latest master is breaking with exactly same error. I am not able to figure out the issue. Any help or suggestions will be great.
https://travis-ci.org/apache/zeppelin/jobs/229852218

Comment thread zeppelin-web/src/index.js Outdated
* limitations under the License.
*/

import 'angular-viewport-watch/angular-viewport-watch.js'
Copy link
Copy Markdown
Member

@1ambda 1ambda May 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for update! It would be nicer to move import stmt into app.js where the library is actually used.

@1ambda
Copy link
Copy Markdown
Member

1ambda commented May 11, 2017

Additionally, Zeppelin supports angular API both in backend, frontend.

Could you make sure that this PR doesn't break existing features?

@vipul1409
Copy link
Copy Markdown
Author

vipul1409 commented May 16, 2017

Sorry for delayed response.
Rerun of failed job passed. I have also addressed all the PR comments.
https://travis-ci.org/vipul1409/zeppelin

@1ambda
Copy link
Copy Markdown
Member

1ambda commented May 18, 2017

You can close and reopen this PR to trigger jenkins again (not travis).

I will test and comment soon. Thanks for updating.

@vipul1409 vipul1409 closed this May 19, 2017
@vipul1409 vipul1409 reopened this May 19, 2017
@1ambda
Copy link
Copy Markdown
Member

1ambda commented May 19, 2017

Your travis job failed at

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 125.713 sec - in org.apache.zeppelin.integration.AuthenticationIT

Results :

Tests in error: 
  InterpreterIT.testShowDescriptionOnInterpreterCreate:69 » ElementNotVisible El...

Tests run: 23, Failures: 0, Errors: 1, Skipped: 0

@vipul1409
Copy link
Copy Markdown
Author

vipul1409 commented May 21, 2017

Fixed all the issues and the tests have also passed. Please let me know if any more details are needed.
@1ambda

@1ambda
Copy link
Copy Markdown
Member

1ambda commented May 23, 2017

Tested and works well (both in frontend, backend angular APIs).

LGTM.

@Leemoonsoo
Copy link
Copy Markdown
Member

Thanks @vipul1409 for great contribution.
Thanks @1ambda for the review.

Merge to master if no further discussions.

@asfgit asfgit closed this in 21e702c May 25, 2017
@1ambda
Copy link
Copy Markdown
Member

1ambda commented Jun 2, 2017

Hi @vipul1409, This PR occurs an error like

TypeError: Cannot read property 'create' of undefined
    at Object.link (http://localhost:9001/app.bundle.js:9662:52)
    at http://localhost:9001/bower_components/angular/angular.js:1240:18
    at invokeLinkFn (http://localhost:9001/bower_components/angular/angular.js:9814:9)
    at nodeLinkFn (http://localhost:9001/bower_components/angular/angular.js:9215:11)
    at compositeLinkFn (http://localhost:9001/bower_components/angular/angular.js:8510:13)
    at publicLinkFn (http://localhost:9001/bower_components/angular/angular.js:8390:30)
    at lazyCompilation (http://localhost:9001/bower_components/angular/angular.js:8728:25)
    at boundTranscludeFn (http://localhost:9001/bower_components/angular/angular.js:8527:16)
    at controllersBoundTransclude (http://localhost:9001/bower_components/angular/angular.js:9265:20)
    at ngRepeatAction (http://localhost:9001/bower_components/angular/angular.js:29607:15) <div id="{{currentParagraph.id}}_paragraphColumn_main" ng-repeat="currentParagraph in note.paragraphs" ng-controller="ParagraphCtrl" ng-init="init(currentParagraph, note)" ng-class="columnWidthClass(currentParagraph.config.colWidth)" style="margin: 0; padding: 0;" viewport-watch="" class="ng-scope" data-ng-animate="1">

When I remove viewport-watch directive from notebook.html, there is no error.
Could you fix it?

image

@vipul1409
Copy link
Copy Markdown
Author

vipul1409 commented Jun 3, 2017 via email

@1ambda
Copy link
Copy Markdown
Member

1ambda commented Jul 27, 2017

Hi @vipul1409 , Could you check #2505?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants