Skip to content

Commit

Permalink
Merge pull request #6320 from cernbox/up_performance_simpler
Browse files Browse the repository at this point in the history
Up performance simpler
  • Loading branch information
kulmann authored Jan 27, 2022
2 parents b400217 + c2a0253 commit 1e7b1a1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
9 changes: 6 additions & 3 deletions packages/web-app-files/src/views/Personal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ export default {
})
// Load quota
const user = yield ref.$client.users.getUser(ref.user.id)
ref.SET_QUOTA(user.quota)
const promiseUser = ref.$client.users.getUser(ref.user.id)
// The semicolon is important to separate from the previous statement
;(async () => {
const user = await promiseUser
ref.SET_QUOTA(user.quota)
})()
} catch (error) {
ref.SET_CURRENT_FOLDER(null)
console.error(error)
Expand Down
12 changes: 9 additions & 3 deletions packages/web-container/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
<title><%= data.title %></title>
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
<% Object.keys(data.bundle.css).forEach((s) => { %>
<link href="<%- data.bundle.css[s] %>" rel="stylesheet">
<link href="<%- data.bundle.css[s] %>?<%= data.compilationTimestamp %>" rel="stylesheet">
<% }); %>
<script src="js/require.js"></script>
<% if (data.config.cdn) { %>
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script>if (typeof requirejs === 'undefined') { document.write('<script src="js/require.js?<%= data.compilationTimestamp %>">\x3C/script>') }</script>
<% } else { %>
<script src="js/require.js?<%= data.compilationTimestamp %>"></script>
<% } %>
<style>
.splash-banner {
display: flex;
Expand Down Expand Up @@ -68,7 +73,8 @@
} else {
requirejs.config({
baseUrl: <%- JSON.stringify(data.roots.js) %>,
paths: <%- JSON.stringify(data.bundle.js) %>
paths: <%- JSON.stringify(data.bundle.js) %>,
...<%- JSON.stringify(data.config.requirejs) %>
})
requirejs(['web-runtime'], function (runtime) {
Expand Down
13 changes: 12 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ import inject from '@rollup/plugin-inject'
const production = !process.env.ROLLUP_WATCH
const sourcemap = process.env.SOURCE_MAP === 'true'
const { version } = require('./package.json')
const compilationTimestamp = new Date().getTime()

const config = {
requirejs: {},
cdn: process.env.CDN === 'true'
}
if (process.env.REQUIRE_TIMEOUT) {
config.requirejs.waitSeconds = parseInt(process.env.REQUIRE_TIMEOUT)
}

const plugins = [
del({
Expand Down Expand Up @@ -146,7 +155,9 @@ const plugins = [
roots: {
css: 'css',
js: 'js'
}
},
config: config,
compilationTimestamp: compilationTimestamp
}
},
{},
Expand Down

0 comments on commit 1e7b1a1

Please sign in to comment.