Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
[up] work around bugs in @akryum/vue-cli-plugin-ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Apr 10, 2020
1 parent 6fde049 commit 07b8a4c
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 15 deletions.
15 changes: 8 additions & 7 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
"vuex": "^3.1.2"
},
"devDependencies": {
"@akryum/vue-cli-plugin-ssr": "~0.6.0",
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-e2e-nightwatch": "~4.2.0",
"@vue/cli-plugin-pwa": "~4.2.0",
"@vue/cli-plugin-router": "~4.2.0",
"@vue/cli-plugin-unit-mocha": "~4.2.0",
"@vue/cli-plugin-vuex": "~4.2.0",
"@akryum/vue-cli-plugin-ssr": "git://github.com/phil294/vue-cli-plugin-ssr.git#d19fb4f",
"@types/gapi.auth2": "^0.0.51",
"@vue/cli-plugin-babel": "~4.2.3",
"@vue/cli-plugin-e2e-nightwatch": "~4.2.3",
"@vue/cli-plugin-pwa": "~4.2.3",
"@vue/cli-plugin-router": "~4.2.3",
"@vue/cli-plugin-unit-mocha": "~4.2.3",
"@vue/cli-plugin-vuex": "~4.2.3",
"@vue/cli-service": "^4.2.3",
"@vue/test-utils": "1.0.0-beta.31",
"chai": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/MultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
small.disabled empty selection
.selected-options.row.justify-center.children-spacing
.selected-option.row.center.box v-for="selected_option in selected_options"
button.name.remove title="Remove this option" @click=remove(selected_option.value) $selected_option.name ×
button.name.remove title="Remove this option" @click=remove(selected_option.value) $selected_option.name
</template>

<script lang="coffee">
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/Popup.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<template lang="slm">
modal @close=close
main.box.padding-xl
button#close @click=close 🗙
button#close @click=close
slot
</template>

<script lang="coffee">
export default Vue.extend
name: 'Popup'
methods:
close: -> @$emit 'close'
close: ->
@$store.dispatch 'offer_focus'
@$emit 'close'
</script>

<style lang="stylus" scoped>
Expand Down
8 changes: 8 additions & 0 deletions web/src/store/root-store.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export create_store = =>
loading_counter: 0
authenticate_popup: false
global_error_message: ''
default_focus_target: null
mutations:
toggle_authenticate_popup: (state, show) ->
state.authenticate_popup = show
Expand All @@ -23,6 +24,8 @@ export create_store = =>
state.loading_counter--
set_global_error_message: (state, msg) ->
state.global_error_message = msg
set_default_focus_target: (state, el) ->
state.default_focus_target = el
actions:
show_authenticate_popup: ({ commit }) ->
commit 'toggle_authenticate_popup', true
Expand All @@ -32,6 +35,11 @@ export create_store = =>
commit 'set_global_error_message', 'Server unreachable!'
server_reachable: ({ commit }) ->
commit 'set_global_error_message', ''
set_default_focus_target: ({ commit }, el) ->
commit 'set_default_focus_target', el
offer_focus: ({ state }) ->
if state.default_focus_target
state.default_focus_target.focus()
modules:
session: session_module
# When adding here, see ssr docs. Global submodules *seem* to need a factory wrapper too
13 changes: 13 additions & 0 deletions web/unicode characters comparison.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Comparison of unicode characters across different browsers

y = ok
n = looks rather weird
N = wrong icon or custom style or entirely missing

character × ╳ ☓ ✕ ✖ ❌ ❎ ⨉ ⨯ 🗙 🗴 🞩

linux chromium y y n y y N N y y y n y
linux firefox y y n y y N N y y y n y
windows firefox y y n y y N N y y y n y
android 4 firefox y y N y y N N N N N N N
android 4 chrome y y N y y N N
18 changes: 17 additions & 1 deletion web/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ process.env.VUE_APP_APP_VERSION = require('./package.json').version;

module.exports = {
productionSourceMap: true, // doesnt work: https://github.com/Akryum/vue-cli-plugin-ssr/issues/84
css: {
extract: true,
sourceMap: true,
},
chainWebpack: (config) => {
config.resolve.extensions
.add('.coffee')
Expand Down Expand Up @@ -59,7 +63,19 @@ module.exports = {
ssr: {
port: 8080,
defaultTitle: 'MEVN Base Title',
criticalCSS: false
criticalCSS: false,
host: '0.0.0.0',
copyUrlOnStart: false,
clustered: true, // untested todo
lruCacheOptions: {
// See https://ssr.vuejs.org/guide/caching.html
// TODO
},
onError: error => {
// TODO
},
// TODO in public?
// error500Html: path.resolve(__dirname, './dist/500.html'),
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# yarn lockfile v1


"@akryum/vue-cli-plugin-ssr@~0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@akryum/vue-cli-plugin-ssr/-/vue-cli-plugin-ssr-0.6.0.tgz#1e63dc16dee38fc3c4c1979a19d8b4d10689105f"
integrity sha512-5vJ6xWbD/VOM4GUbGejBOF+/LQ6839hSN3nIv3H6j2h7A9Qt7OiMmGbK14l0IDAwfmnCsk6XnNj0o6etLVuxZQ==
"@akryum/vue-cli-plugin-ssr@git://github.com/phil294/vue-cli-plugin-ssr.git#d19fb4f":
version "0.5.0"
resolved "git://github.com/phil294/vue-cli-plugin-ssr.git#d19fb4f21553e01a83a7709d5c2aeb3c47817275"
dependencies:
chalk "^2.4.2"
clipboardy "^2.1.0"
Expand Down

0 comments on commit 07b8a4c

Please sign in to comment.