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 Optimization #53

Merged
merged 6 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/
npm-debug.log
junit/
config.php
bundle-stats.json
9 changes: 8 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ export function run(pid, canEdit, jsonAssetUrls) {
new Vue({
el: '.vizr-container',
components: { Vizr },
Copy link
Member Author

Choose a reason for hiding this comment

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

The root component is the only one with a template string (all the others are single-file components processed by vue-loader), which is why the template compiler was required at runtime. This equivalent render function allows removing the compiler from our bundle.

This change could also be made to phenotypr-body.

template: '<Vizr :pid="pid" :can-edit="canEdit"/>',
render(createElement) {
return createElement(Vizr, {
props: {
pid: this.pid,
canEdit: this.canEdit
}
});
},
data: {
pid,
canEdit
Expand Down
Loading