Skip to content

Commit

Permalink
Merge branch 'hotfix/v1.7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Igloczek committed Jan 31, 2019
2 parents 5d380d4 + 87ad832 commit e2e8c33
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ config/local.json
var
build/config.json
core/build/config.json
core/build/cache-version.json
theme.js
desktop.ini
src/themes/catalog/resource/i18n.json
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.7.3] - 2019.01.31
### Fixed
- Output cache between build, cache versioning added - @igloczek (#2309)
- Missing `no-ssr` wrapper around user specific content, which leads to broken app in production mode - @igloczek (#2314)

## [1.7.2] - 2019.01.28
### Fixed
- clear search filters on mobile - @patzick (#2282)
Expand Down
12 changes: 12 additions & 0 deletions core/build/webpack.server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ const merge = require('webpack-merge')
const base = require('./webpack.base.config')
const VueSSRPlugin = require('vue-ssr-webpack-plugin')

// when output cache is enabled generate cache version key
const config = require('config')
const fs = require('fs')
const path = require('path')
const uuid = require('uuid/v4')
if (config.server.useOutputCache) {
fs.writeFileSync(
path.join(__dirname, 'cache-version.json'),
JSON.stringify(uuid())
)
}

module.exports = merge(base, {
mode: 'development',
target: 'node',
Expand Down
1 change: 1 addition & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"lru-cache": "^4.0.1",
"redis-tag-cache": "^1.2.1",
"remove-accents": "^0.4.2",
"uuid": "^3.3.2",
"vue": "^2.5.17",
"vue-carousel": "^0.6.9",
"vue-i18n": "^8.0.0",
Expand Down
12 changes: 9 additions & 3 deletions core/scripts/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,28 @@ let config = require('config')
const TagCache = require('redis-tag-cache').default
const utils = require('./server/utils')
const compile = require('lodash.template')

const compileOptions = {
escape: /{{([^{][\s\S]+?[^}])}}/g,
interpolate: /{{{([\s\S]+?)}}}/g
}

const isProd = process.env.NODE_ENV === 'production'
process.noDeprecation = true

const app = express()

let cache
if (config.server.useOutputCache) {
const cacheKey = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'build', 'cache-version.json')) || '')
const redisConfig = Object.assign(config.redis, { keyPrefix: cacheKey })

cache = new TagCache({
redis: config.redis,
defaultTimeout: config.server.outputCacheDefaultTtl // Expire records after a day (even if they weren't invalidated)
redis: redisConfig,
defaultTimeout: config.server.outputCacheDefaultTtl
})
console.log('Redis cache set', config.redis)

console.log('Redis cache set', redisConfig)
}

const templatesCache = {}
Expand Down
39 changes: 24 additions & 15 deletions src/themes/default/components/core/blocks/Header/AccountIcon.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
<template>
<div class="inline-flex relative dropdown"
data-testid="accountButton"
@click.self="goToAccount">
<div
class="inline-flex relative dropdown"
data-testid="accountButton"
@click.self="goToAccount"
>
<button
type="button"
class="bg-cl-transparent brdr-none p0"
:aria-label="$t('Open my account')"
>
<i class="material-icons block">account_circle</i>
</button>
<div v-if="currentUser" class="dropdown-content bg-cl-primary align-left sans-serif lh20 weight-400">
<div class="py5">
<div v-for="(page, index) in navigation" :key="index" @click="notify(page.title)">
<router-link class="no-underline block py10 px15" :to="localizedRoute(page.link)">
{{ page.title }}
</router-link>

<no-ssr>
<div v-if="currentUser" class="dropdown-content bg-cl-primary align-left sans-serif lh20 weight-400">
<div class="py5">
<div v-for="(page, index) in navigation" :key="index" @click="notify(page.title)">
<router-link class="no-underline block py10 px15" :to="localizedRoute(page.link)">
{{ page.title }}
</router-link>
</div>
</div>
<div class="py5 brdr-top-1 brdr-cl-bg-secondary">
<a href="#" class="no-underline block py10 px15" @click.prevent="logout">
{{ $t('Logout') }}
</a>
</div>
</div>
<div class="py5 brdr-top-1 brdr-cl-bg-secondary">
<a href="#" class="no-underline block py10 px15" @click.prevent="logout">
{{ $t('Logout') }}
</a>
</div>
</div>
</no-ssr>
</div>
</template>

<script>
import NoSSR from 'vue-no-ssr'
import AccountIcon from '@vue-storefront/core/compatibility/components/blocks/Header/AccountIcon'
export default {
mixins: [AccountIcon],
components: {
'no-ssr': NoSSR
},
data () {
return {
navigation: [
Expand Down
1 change: 0 additions & 1 deletion storefront-ui
Submodule storefront-ui deleted from 57c41a

0 comments on commit e2e8c33

Please sign in to comment.