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 #7004: Move jinja dependencies_html to webpack #7350

Merged
merged 40 commits into from
Aug 27, 2019

Conversation

jameesjohn
Copy link
Contributor

@jameesjohn jameesjohn commented Aug 10, 2019

Explanation

Fixes #7004: This PR removed dependencies html by sending them to the pages that need it via ajax (Exploration editor and exploration player).
Pages that load the question interactions (Review_tests, practice session) do not actually have any dependencies so they were just removed.
Skill editor and topic editor require just one dependency: codemirror and it is required via webpack to the pages.

UI-CodeMirror package has some known issues when it comes to minification and the package is no longer maintained, so I forked the repo, fixed the issue there and used it here instead.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR has an appropriate "PROJECT: ..." label (Please add this label for the first-pass review of the PR).
  • The PR has an appropriate "CHANGELOG: ..." label (If you are unsure of which label to add, ask the reviewers for guidance).
  • The PR follows the style guide.
  • The PR addresses the points mentioned in the codeowner checks for the files/folders changed. (See the codeowner's wiki page.)
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer and don't tick this checkbox.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue. Do not only request the review but also add the reviewer as an assignee.

@jameesjohn
Copy link
Contributor Author

Note: I am still testing topic editor and skill editor pages. However, I think this should start getting reviewed.

@jameesjohn jameesjohn requested a review from kevinlee12 as a code owner August 10, 2019 12:58
@seanlip
Copy link
Member

seanlip commented Aug 10, 2019

Please note that most of the automated CI checks are failing.

Copy link
Contributor

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

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

Overall looks good. If I understand this correctly we load most of the dependencies by AJAX except for the ones that are needed on angular module initialization.

@codecov
Copy link

codecov bot commented Aug 11, 2019

Codecov Report

Merging #7350 into develop will decrease coverage by 11.83%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           develop    #7350       +/-   ##
============================================
- Coverage       83%   71.17%   -11.83%     
============================================
  Files         1064      836      -228     
  Lines        57131    33630    -23501     
  Branches      2660     2655        -5     
============================================
- Hits         47420    23936    -23484     
+ Misses        9067     9050       -17     
  Partials       644      644
Flag Coverage Δ
#backend ?
#frontend 71.17% <ø> (-0.3%) ⬇️
Impacted Files Coverage Δ
...d/domain/collection/collection-domain.constants.ts 100% <0%> (ø) ⬆️
.../head/pages/library-page/library-page.constants.ts 100% <0%> (ø) ⬆️
.../components/state-editor/state-editor.constants.ts 100% <0%> (ø) ⬆️
...main/topic_viewer/topic-viewer-domain.constants.ts 100% <0%> (ø) ⬆️
.../templates/dev/head/services/services.constants.ts 100% <0%> (ø) ⬆️
...s/interactions/interactions-extension.constants.ts 100% <0%> (ø) ⬆️
.../head/domain/question/question-domain.constants.ts 100% <0%> (ø) ⬆️
...s/story-editor-page/story-editor-page.constants.ts 100% <0%> (ø) ⬆️
...dashboard-page/creator-dashboard-page.constants.ts 100% <0%> (ø) ⬆️
...s/topic-editor-page/topic-editor-page.constants.ts 100% <0%> (ø) ⬆️
... and 242 more

@codecov
Copy link

codecov bot commented Aug 11, 2019

Codecov Report

Merging #7350 into develop will decrease coverage by 0.02%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #7350      +/-   ##
===========================================
- Coverage    83.34%   83.32%   -0.02%     
===========================================
  Files         1089     1089              
  Lines        62879    62818      -61     
  Branches      3620     3619       -1     
===========================================
- Hits         52401    52340      -61     
- Misses        9323     9324       +1     
+ Partials      1155     1154       -1
Flag Coverage Δ
#backend 100% <ø> (ø) ⬇️
#frontend 73.05% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
core/controllers/editor.py 100% <ø> (ø) ⬆️
core/controllers/base.py 100% <ø> (ø) ⬆️
.../directives/OppiaInteractiveLogicProofDirective.ts 13.16% <ø> (+0.77%) ⬆️
core/controllers/review_tests.py 100% <ø> (ø) ⬆️
core/controllers/skill_editor.py 100% <ø> (ø) ⬆️
core/controllers/reader.py 100% <ø> (ø) ⬆️
core/controllers/practice_sessions.py 100% <ø> (ø) ⬆️
core/controllers/topic_editor.py 100% <ø> (ø) ⬆️
core/controllers/creator_dashboard.py 100% <ø> (ø) ⬆️
...d-editors/schema-based-unicode-editor.directive.ts 13.64% <100%> (+2.01%) ⬆️
... and 15 more

@oppiabot
Copy link

oppiabot bot commented Aug 12, 2019

Hi @Jamesjay4199. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@jameesjohn
Copy link
Contributor Author

If I understand this correctly we load most of the dependencies by AJAX except for the ones that are needed on angular module initialization.

Yes.

@jameesjohn
Copy link
Contributor Author

Comments have been addressed. PTAL @seanlip.

@jameesjohn jameesjohn changed the title Remove jinja dependencies_html Fix #7004: Move jinja dependencies_html to webpack Aug 25, 2019
@oppiabot
Copy link

oppiabot bot commented Aug 25, 2019

Hi @Jamesjay4199. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@oppiabot
Copy link

oppiabot bot commented Aug 25, 2019

Hi @Jamesjay4199. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

LGTM. Please fix merge conflicts.

@jameesjohn
Copy link
Contributor Author

LGTM. Please fix merge conflicts.

Done

@oppiabot
Copy link

oppiabot bot commented Aug 26, 2019

Hi @Jamesjay4199. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@seanlip
Copy link
Member

seanlip commented Aug 26, 2019

@Jamesjay4199 Lint tests fail, and I think this is introduced by your PR. Please check.

@jameesjohn
Copy link
Contributor Author

@seanlip, I've fixed the lint issue.

@seanlip
Copy link
Member

seanlip commented Aug 27, 2019

Sounds good, I'll merge, thanks.

Also, @lilithxxx -- FYI, I'm really starting to doubt codecov's reliability as a check. See this screenshot:

Screenshot from 2019-08-26 23-49-35

@seanlip seanlip merged commit 9f127ab into oppia:develop Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate dependencies into webpack
10 participants