Browse Source

webpack working + more

develop
dskvr 2 years ago
parent
commit
325a123c0e
  1. 2
      package.json
  2. 24
      src/components/relays/tasks/RefreshTask.vue
  3. 4
      vue.config.js
  4. 579
      yarn.lock

2
package.json

@ -40,6 +40,7 @@
"pinia-plugin-persistedstate-2": "2.0.8",
"pinia-shared-state": "0.2.10",
"postcss-apply": "0.12.0",
"postcss-import": "15.1.0",
"requests": "0.3.0",
"stream-browserify": "3.0.0",
"vue": "^3.2.45",
@ -48,6 +49,7 @@
"vue-router": "4.1.6",
"vue-tailwind": "2.5.1",
"vue3-storage": "0.1.11",
"webpack": "5.75.0",
"write-yaml-file": "4.2.0"
},
"devDependencies": {

24
src/components/relays/tasks/RefreshTask.vue

@ -111,7 +111,11 @@ const localMethods = {
this.store.tasks.startProcessing('relays')
const relays = this.relays.filter( relay => !this.store.tasks.isProcessed('relays', relay) )
let relays
if(this.store.relays.isProcessing('relays'))
relays = this.relays.filter( relay => !this.store.tasks.isProcessed('relays', relay) )
else
relays = [...this.relays]
//console.log('filtered relays', relays)
@ -125,8 +129,7 @@ const localMethods = {
await this.check(single)
}
else {
//console.log('multiple relays', single)
// const processed = new Set()
console.log('multiple relays', relays)
for(let index = 0; index < relays.length; index++) {
const relay = relays[index]
//console.log('checking relay', relay)
@ -136,14 +139,14 @@ const localMethods = {
if(this.store.tasks.isProcessed('relays', relay))
return
//console.log('unique check', relay)
console.log('unique check', relay)
this.store.tasks.addProcessed('relays', result.uri)
this.results[result.uri] = result
this.setCache(result)
//console.log('cache set', result.uri, result)
console.log('cache set', result.uri, result)
if(this.store.tasks.getProcessed('relays').length >= this.relays.length)
this.completeAll()
@ -171,6 +174,7 @@ const localMethods = {
check: async function(relay){
//console.log('this.averageLatency', this.averageLatency)
await this.delay(this.averageLatency)
return new Promise( (resolve, reject) => {
@ -241,23 +245,13 @@ export default defineComponent({
},
created(){
clearInterval(this.interval)
// document.addEventListener("visibilitychange", () => {
// if(document.visibilityState == 'visible')
// this.store.layout.setActiveTab(this.$tabid)
// // if
// // document.title = document.hidden ? "I'm away" : "I'm here";
// });
document.body.onfocus = () => {
// alert('tab focused')
//console.log(`tab #${this.$tabId} is active`)
}
document.addEventListener('visibilitychange', this.handleVisibility, false)
},
unmounted(){
clearInterval(this.interval)
// document.removeEventListener("visibilitychange", this.handleVisibility, false);
},
beforeMount(){
this.untilNext = this.timeUntilRefresh()

4
vue.config.js

@ -1,7 +1,7 @@
const { defineConfig } = require('@vue/cli-service')
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
// const CompressionPlugin = require("compression-webpack-plugin")
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = defineConfig({
transpileDependencies: true,
@ -18,7 +18,7 @@ module.exports = defineConfig({
// new CompressionPlugin({
// test: /\.js(\?.*)?$/i,
// }),
new BundleAnalyzerPlugin()
// new BundleAnalyzerPlugin()
],
optimization: {
splitChunks: {

579
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save