From 823e3a256df7b3ae2cb2b44c66717871f2160af7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 13 Oct 2020 20:39:59 +0200 Subject: [PATCH 1/6] Improve build times * Fix bulma/buefy being imported many (many !!!) times * Remove javascript-time-ago because date-fns pretty much does the same thing * Make sure languages are loaded asynchronously Signed-off-by: Thomas Citharel --- js/package.json | 2 - js/src/common.scss | 4 ++ js/src/components/Account/ActorCard.vue | 2 - js/src/components/Account/ParticipantCard.vue | 1 - js/src/components/Admin/Followers.vue | 5 +- js/src/components/Admin/Followings.vue | 5 +- js/src/components/Comment/Comment.vue | 27 +++----- .../Discussion/DiscussionComment.vue | 24 ++++--- .../Discussion/DiscussionListItem.vue | 12 +++- js/src/components/Editor.vue | 2 - js/src/components/Event/DateCalendarIcon.vue | 8 +-- js/src/components/Event/EventCard.vue | 2 - js/src/components/Event/EventListCard.vue | 2 - js/src/components/Event/EventListViewCard.vue | 2 - .../components/Event/EventMetadataBlock.vue | 2 - js/src/components/Footer.vue | 2 - js/src/components/Group/GroupSection.vue | 2 - js/src/components/Group/InvitationCard.vue | 4 +- js/src/components/Logo.vue | 4 +- js/src/components/NavBar.vue | 2 - js/src/components/Post/PostListItem.vue | 10 ++- js/src/components/Resource/FolderItem.vue | 2 - js/src/components/Resource/ResourceItem.vue | 2 - .../components/Resource/ResourceSelector.vue | 2 - .../components/Settings/SettingMenuItem.vue | 2 - .../Settings/SettingMenuSection.vue | 2 - js/src/components/Tag.vue | 2 - js/src/components/Utils/Subtitle.vue | 2 - js/src/components/Utils/VerticalDivider.vue | 4 +- js/src/filters/index.ts | 2 +- js/src/i18n/fr_FR.json | 2 +- js/src/i18n/index.ts | 43 ------------- js/src/i18n/langs.json | 11 +--- js/src/main.ts | 16 ----- js/src/mixins/relay.ts | 21 +------ js/src/plugins/dateFns.ts | 6 +- js/src/plugins/notifier.ts | 21 ++++--- js/src/utils/i18n.ts | 62 +++++++++++++++++-- js/src/variables.scss | 4 -- js/src/views/About.vue | 2 - js/src/views/About/AboutInstance.vue | 2 - js/src/views/About/AboutMobilizon.vue | 2 - js/src/views/About/Privacy.vue | 2 - js/src/views/About/Rules.vue | 2 - js/src/views/Account/Profile.vue | 5 -- js/src/views/Account/Register.vue | 1 - js/src/views/Admin/Settings.vue | 2 - js/src/views/Admin/Users.vue | 3 +- js/src/views/Event/Edit.vue | 2 - js/src/views/Event/Event.vue | 2 - js/src/views/Event/MyEvents.vue | 2 - js/src/views/Event/Participants.vue | 4 +- js/src/views/Group/Group.vue | 2 - js/src/views/Group/MyGroups.vue | 2 - js/src/views/Home.vue | 2 - js/src/views/Interact.vue | 2 - js/src/views/Moderation/Report.vue | 2 - js/src/views/Posts/Post.vue | 2 - js/src/views/Search.vue | 2 - js/src/views/Settings/AccountSettings.vue | 2 - js/src/views/Settings/Notifications.vue | 2 - js/src/views/Settings/Preferences.vue | 38 +++++------- js/src/views/User/Register.vue | 3 - js/tsconfig.json | 1 + js/vue.config.js | 12 ++++ js/yarn.lock | 17 ----- 66 files changed, 167 insertions(+), 283 deletions(-) delete mode 100644 js/src/i18n/index.ts diff --git a/js/package.json b/js/package.json index 0bfcdb343..cabd2a04d 100644 --- a/js/package.json +++ b/js/package.json @@ -30,7 +30,6 @@ "graphql": "^15.0.0", "graphql-tag": "^2.10.3", "intersection-observer": "^0.11.0", - "javascript-time-ago": "^2.0.4", "leaflet": "^1.4.0", "leaflet.locatecontrol": "^0.72.0", "lodash": "^4.17.11", @@ -54,7 +53,6 @@ }, "devDependencies": { "@types/chai": "^4.2.11", - "@types/javascript-time-ago": "^2.0.1", "@types/leaflet": "^1.5.2", "@types/leaflet.locatecontrol": "^0.60.7", "@types/lodash": "^4.14.141", diff --git a/js/src/common.scss b/js/src/common.scss index 2178b6398..cf93afa73 100644 --- a/js/src/common.scss +++ b/js/src/common.scss @@ -1,5 +1,9 @@ @import "variables.scss"; +@import "~bulma"; +@import "~bulma-divider"; +@import "~buefy/src/scss/buefy"; + // a { // color: $violet-2; // } diff --git a/js/src/components/Account/ActorCard.vue b/js/src/components/Account/ActorCard.vue index 4f910e534..0141a639a 100644 --- a/js/src/components/Account/ActorCard.vue +++ b/js/src/components/Account/ActorCard.vue @@ -46,8 +46,6 @@ export default class ActorCard extends Vue { diff --git a/js/src/views/Account/Register.vue b/js/src/views/Account/Register.vue index 1b7a62536..99fb4b2fc 100644 --- a/js/src/views/Account/Register.vue +++ b/js/src/views/Account/Register.vue @@ -168,7 +168,6 @@ export default class Register extends mixins(identityEditionMixin) {