From bba2a171c708ea369e9532c3abbb6d7cf8b84e6f Mon Sep 17 00:00:00 2001 From: dskvr Date: Mon, 22 Apr 2024 15:47:06 +0200 Subject: [PATCH] hotfix: even looser component loading --- package.json | 2 +- src/lib/core/MRPBlockLoader.ts | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 864d0da..b39e9ed 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "myrelay.site", "type": "module", - "version": "0.2.7", + "version": "0.2.8", "main": "index.js", "repository": "git@github.com:sandwichfarm/myrelay.site.git", "author": "dskvr ", diff --git a/src/lib/core/MRPBlockLoader.ts b/src/lib/core/MRPBlockLoader.ts index adaf116..7f3dc6a 100644 --- a/src/lib/core/MRPBlockLoader.ts +++ b/src/lib/core/MRPBlockLoader.ts @@ -35,7 +35,7 @@ export class BlockLoader extends MRPData { async init(){ if(this.isPending) return this.begin() - await this.loadAllComponents().catch(BlockLoader.errorHandler) + this.loadAllComponents().catch(BlockLoader.errorHandler) } async loadComponentOptions(key: string): Promise { @@ -64,16 +64,16 @@ export class BlockLoader extends MRPData { } async loadAllComponents(){ - await this.loadUniqueComponents().catch(BlockLoader.errorHandler) - await this.loadRepeatableComponents().catch(BlockLoader.errorHandler) - await this.loadRemoteComponents().catch(BlockLoader.errorHandler) + this.loadUniqueComponents().catch(BlockLoader.errorHandler) + this.loadRepeatableComponents().catch(BlockLoader.errorHandler) + // this.loadRemoteComponents().catch(BlockLoader.errorHandler) } async loadUniqueComponents(){ for (let key in this.config.event.blocks){ + if(this.isRepeatable(key)) continue if(this._components?.[key] !== undefined) continue; - if(this.config.event.blocks[key].custom === true) continue; - await this.loadUniqueComponent(key).catch(BlockLoader.errorHandler) + this.loadUniqueComponent(key).catch(BlockLoader.errorHandler) } } @@ -129,9 +129,8 @@ export class BlockLoader extends MRPData { private async loadUniqueComponent(key: string): Promise { const block = this.config.event.blocks?.[key] - const isUnique = !this.isRepeatable(key) let $component; - if(block && isUnique){ + if(block){ $component = await import(`../components/blocks/unique/${key}/${key}.svelte`).catch(BlockLoader.errorHandler) this._components[key] = $component?.default? $component.default: $component }