diff --git a/src/client/js/util/Interceptor/LsxPostRenderInterceptor.js b/src/client/js/util/Interceptor/LsxPostRenderInterceptor.js index e50dee6..c70a3fe 100644 --- a/src/client/js/util/Interceptor/LsxPostRenderInterceptor.js +++ b/src/client/js/util/Interceptor/LsxPostRenderInterceptor.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import { BasicInterceptor } from 'growi-commons'; -import LsxContext from 'growi-plugin-lsx/src/client/js/util/LsxContext'; +import LsxContext from '../LsxContext'; import Lsx from '../../components/Lsx'; /** @@ -34,15 +34,13 @@ export default class LsxPostRenderInterceptor extends BasicInterceptor { process(contextName, ...args) { const context = Object.assign(args[0]); // clone - // forEach keys of tagContextMap - Object.keys(context.tagContextMap).forEach((domId) => { + // forEach keys of lsxContextMap + Object.keys(context.lsxContextMap).forEach((domId) => { const elem = document.getElementById(domId); if (elem) { - // get TagContext instance from context - const tagContext = context.tagContextMap[domId] || {}; - // create LsxContext instance - const lsxContext = new LsxContext(tagContext); + // instanciate LsxContext from context + const lsxContext = new LsxContext(context.lsxContextMap[domId] || {}); lsxContext.fromPagePath = context.currentPagePath; this.renderReactDOM(lsxContext, elem); diff --git a/src/client/js/util/Interceptor/LsxPreRenderInterceptor.js b/src/client/js/util/Interceptor/LsxPreRenderInterceptor.js index 8acc712..f78fe8e 100644 --- a/src/client/js/util/Interceptor/LsxPreRenderInterceptor.js +++ b/src/client/js/util/Interceptor/LsxPreRenderInterceptor.js @@ -19,6 +19,13 @@ export default class LsxPreRenderInterceptor extends BasicInterceptor { ); } + /** + * @inheritdoc + */ + isProcessableParallel() { + return false; + } + /** * @inheritdoc */ @@ -27,13 +34,11 @@ export default class LsxPreRenderInterceptor extends BasicInterceptor { const parsedHTML = context.parsedHTML; this.initializeCache(contextName); - context.lsxContextMap = {}; - const tagPattern = /ls|lsx/; const result = customTagUtils.findTagAndReplace(tagPattern, parsedHTML); context.parsedHTML = result.html; - context.tagContextMap = result.tagContextMap; + context.lsxContextMap = result.tagContextMap; // resolve return Promise.resolve(context);