@dooboostore/simple-boot-http-server-ssr 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +98 -0
  2. package/dist/cjs/SimpleBootHttpSSRServer.js.map +2 -2
  3. package/dist/cjs/bundle-entry.js +46 -14
  4. package/dist/cjs/bundle-entry.js.map +2 -2
  5. package/dist/cjs/filters/SSRDomParserFilter.js +4 -3
  6. package/dist/cjs/filters/SSRDomParserFilter.js.map +2 -2
  7. package/dist/cjs/filters/SSRFilter.js +4 -3
  8. package/dist/cjs/filters/SSRFilter.js.map +2 -2
  9. package/dist/cjs/filters/{SSRLinkDomDomFilter.js → SSRLinkDomFilter.js} +11 -10
  10. package/dist/cjs/filters/SSRLinkDomFilter.js.map +7 -0
  11. package/dist/cjs/filters/SSRSimpleWebComponentDomParserFilter.js +81 -0
  12. package/dist/cjs/filters/SSRSimpleWebComponentDomParserFilter.js.map +7 -0
  13. package/dist/cjs/filters/SSRSimpleWebComponentFilter.js +158 -28
  14. package/dist/cjs/filters/SSRSimpleWebComponentFilter.js.map +2 -2
  15. package/dist/cjs/filters/index.js +9 -3
  16. package/dist/cjs/filters/index.js.map +2 -2
  17. package/dist/cjs/index.js +0 -2
  18. package/dist/cjs/index.js.map +2 -2
  19. package/dist/esm/SimpleBootHttpSSRServer.js.map +2 -2
  20. package/dist/esm/bundle-entry.js +22 -7
  21. package/dist/esm/bundle-entry.js.map +2 -2
  22. package/dist/esm/filters/SSRDomParserFilter.js +5 -4
  23. package/dist/esm/filters/SSRDomParserFilter.js.map +2 -2
  24. package/dist/esm/filters/SSRFilter.js +4 -3
  25. package/dist/esm/filters/SSRFilter.js.map +2 -2
  26. package/dist/esm/filters/{SSRLinkDomDomFilter.js → SSRLinkDomFilter.js} +7 -6
  27. package/dist/esm/filters/SSRLinkDomFilter.js.map +7 -0
  28. package/dist/esm/filters/SSRSimpleWebComponentDomParserFilter.js +58 -0
  29. package/dist/esm/filters/SSRSimpleWebComponentDomParserFilter.js.map +7 -0
  30. package/dist/esm/filters/SSRSimpleWebComponentFilter.js +148 -28
  31. package/dist/esm/filters/SSRSimpleWebComponentFilter.js.map +2 -2
  32. package/dist/esm/filters/index.js +4 -1
  33. package/dist/esm/filters/index.js.map +2 -2
  34. package/dist/esm/index.js +0 -1
  35. package/dist/esm/index.js.map +2 -2
  36. package/dist/esm-bundle/dooboostore-simple-boot-http-server-ssr.esm.js +57949 -20024
  37. package/dist/esm-bundle/dooboostore-simple-boot-http-server-ssr.esm.js.map +4 -4
  38. package/dist/types/SimpleBootHttpSSRServer.d.ts +1 -1
  39. package/dist/types/SimpleBootHttpSSRServer.d.ts.map +1 -1
  40. package/dist/types/bundle-entry.d.ts +11 -7
  41. package/dist/types/bundle-entry.d.ts.map +1 -1
  42. package/dist/types/filters/SSRDomParserFilter.d.ts +3 -3
  43. package/dist/types/filters/SSRDomParserFilter.d.ts.map +1 -1
  44. package/dist/types/filters/SSRFilter.d.ts.map +1 -1
  45. package/dist/types/filters/{SSRLinkDomDomFilter.d.ts → SSRLinkDomFilter.d.ts} +5 -5
  46. package/dist/types/filters/SSRLinkDomFilter.d.ts.map +1 -0
  47. package/dist/types/filters/SSRSimpleWebComponentDomParserFilter.d.ts +37 -0
  48. package/dist/types/filters/SSRSimpleWebComponentDomParserFilter.d.ts.map +1 -0
  49. package/dist/types/filters/SSRSimpleWebComponentFilter.d.ts +23 -3
  50. package/dist/types/filters/SSRSimpleWebComponentFilter.d.ts.map +1 -1
  51. package/dist/types/filters/index.d.ts +4 -1
  52. package/dist/types/filters/index.d.ts.map +1 -1
  53. package/dist/types/index.d.ts +0 -1
  54. package/dist/types/index.d.ts.map +1 -1
  55. package/dist/umd-bundle/dooboostore-simple-boot-http-server-ssr.umd.js +58543 -20621
  56. package/dist/umd-bundle/dooboostore-simple-boot-http-server-ssr.umd.js.map +4 -4
  57. package/package.json +20 -19
  58. package/src/SimpleBootHttpSSRServer.ts +2 -3
  59. package/src/bundle-entry.ts +16 -7
  60. package/src/filters/SSRDomParserFilter.ts +9 -8
  61. package/src/filters/SSRFilter.ts +4 -3
  62. package/src/filters/{SSRLinkDomDomFilter.ts → SSRLinkDomFilter.ts} +7 -6
  63. package/src/filters/SSRSimpleWebComponentDomParserFilter.ts +106 -0
  64. package/src/filters/SSRSimpleWebComponentFilter.ts +242 -39
  65. package/src/filters/index.ts +5 -2
  66. package/src/index.ts +0 -1
  67. package/README.MD +0 -167
  68. package/dist/cjs/decorators/LoadAroundBefore.js +0 -54
  69. package/dist/cjs/decorators/LoadAroundBefore.js.map +0 -7
  70. package/dist/cjs/decorators/SaveAroundAfter.js +0 -53
  71. package/dist/cjs/decorators/SaveAroundAfter.js.map +0 -7
  72. package/dist/cjs/decorators/index.js +0 -24
  73. package/dist/cjs/decorators/index.js.map +0 -7
  74. package/dist/cjs/filters/SSRLinkDomDomFilter.js.map +0 -7
  75. package/dist/esm/decorators/LoadAroundBefore.js +0 -31
  76. package/dist/esm/decorators/LoadAroundBefore.js.map +0 -7
  77. package/dist/esm/decorators/SaveAroundAfter.js +0 -29
  78. package/dist/esm/decorators/SaveAroundAfter.js.map +0 -7
  79. package/dist/esm/decorators/index.js +0 -3
  80. package/dist/esm/decorators/index.js.map +0 -7
  81. package/dist/esm/filters/SSRLinkDomDomFilter.js.map +0 -7
  82. package/dist/types/decorators/LoadAroundBefore.d.ts +0 -2
  83. package/dist/types/decorators/LoadAroundBefore.d.ts.map +0 -1
  84. package/dist/types/decorators/SaveAroundAfter.d.ts +0 -3
  85. package/dist/types/decorators/SaveAroundAfter.d.ts.map +0 -1
  86. package/dist/types/decorators/index.d.ts +0 -3
  87. package/dist/types/decorators/index.d.ts.map +0 -1
  88. package/dist/types/filters/SSRLinkDomDomFilter.d.ts.map +0 -1
  89. package/src/decorators/LoadAroundBefore.ts +0 -28
  90. package/src/decorators/SaveAroundAfter.ts +0 -27
  91. package/src/decorators/index.ts +0 -2
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/decorators/index.ts"],
4
- "sourcesContent": ["export * from './LoadAroundBefore';\nexport * from './SaveAroundAfter';"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,+BAAd;AACA,+BAAc,8BADd;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/filters/SSRLinkDomDomFilter.ts"],
4
- "sourcesContent": ["import { RequestResponse } from '@dooboostore/simple-boot-http-server/models/RequestResponse';\nimport { HttpHeaders } from '@dooboostore/simple-boot-http-server/codes/HttpHeaders';\nimport { SimpleBootHttpSSRFactory } from '../SimpleBootHttpSSRFactory';\nimport { ConstructorType, AsyncBlockingQueue, RandomUtils, MessageOperator, MessageInternal } from '@dooboostore/core';\nimport { JsdomInitializer } from '../initializers/JsdomInitializer';\nimport { Filter } from '@dooboostore/simple-boot-http-server/filters/Filter';\nimport { Mimes } from '@dooboostore/simple-boot-http-server/codes/Mimes';\nimport { HttpStatus } from '@dooboostore/simple-boot-http-server/codes/HttpStatus';\nimport { SimpleBootHttpServer } from '@dooboostore/simple-boot-http-server/SimpleBootHttpServer';\nimport { SimFrontOption } from '@dooboostore/simple-boot-front/option/SimFrontOption';\nimport { SimpleBootFront } from '@dooboostore/simple-boot-front/SimpleBootFront';\nimport * as JSDOM from 'jsdom';\nimport { NotFoundError } from '@dooboostore/simple-boot-http-server/errors/NotFoundError';\nimport { DomRenderProxy } from '@dooboostore/dom-render';\nimport { parseHTML } from 'linkedom';\nimport { LinkedomInitializer } from '../initializers/LinkedomInitializer';\n\nexport type FactoryAndParams = {\n frontDistPath: string;\n frontDistIndexFileName?: string;\n factorySimFrontOption: (window: any) => SimFrontOption;\n factory: SimpleBootHttpSSRFactory;\n poolOption: {\n max: number;\n min: number;\n clearIntervalTime?: number;\n };\n using: ConstructorType<any>[];\n domExcludes?: ConstructorType<any>[];\n ssrExcludeFilter?: (rr: RequestResponse) => boolean;\n simpleBootFront?: {\n notFoundError?: boolean;\n };\n};\n\nexport class SSRLinkDomDomFilter implements Filter {\n private simpleBootFrontPool: SimpleBootFront[] = [];\n private simpleBootFrontQueue = new AsyncBlockingQueue<SimpleBootFront>();\n // private indexHTML: string;\n private welcomUrl = 'http://localhost';\n private poolGeneration = 0;\n private intervalId?: NodeJS.Timeout;\n\n constructor(\n public config: FactoryAndParams,\n public otherInstanceSim?: Map<ConstructorType<any>, any>\n ) {\n config.frontDistIndexFileName = config.frontDistIndexFileName || 'index.html';\n // this.indexHTML = JsdomInitializer.loadFile(this.config.frontDistPath, config.frontDistIndexFileName);\n }\n\n async onInit(app: SimpleBootHttpServer) {\n for (let i = 0; i < this.config.poolOption.min; i++) {\n await this.pushQueue();\n }\n\n if (this.config.poolOption.clearIntervalTime && this.config.poolOption.clearIntervalTime > 0) {\n this.intervalId = setInterval(() => {\n this.poolGeneration++;\n }, this.config.poolOption.clearIntervalTime);\n }\n }\n\n async onDestroy() {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n // this.simpleBootFrontQueue.clear();\n this.simpleBootFrontPool.forEach(front => {\n (front as any).jsdom?.window.close();\n });\n this.simpleBootFrontPool = [];\n }\n\n async makePage() {\n return new LinkedomInitializer(\n this.config.frontDistPath,\n this.config.frontDistIndexFileName || 'index.html',\n { url: this.welcomUrl }\n ).run();\n // const jsdom = await new JsdomInitializer(\n // this.config.frontDistPath,\n // this.config.frontDistIndexFileName || 'index.html',\n // { url: this.welcomUrl }\n // ).run();\n // return jsdom;\n }\n\n async makeFront(window: Window) {\n const name = RandomUtils.uuid();\n (window as any).ssrUse = false;\n const option = this.config.factorySimFrontOption(DomRenderProxy.final(window));\n const simpleBootFront = await this.config.factory.create(option, this.config.using, this.config.domExcludes);\n simpleBootFront.run(this.otherInstanceSim);\n (simpleBootFront as any).generation = this.poolGeneration;\n return simpleBootFront;\n }\n\n enqueueFrontApp(simpleBootFront: SimpleBootFront) {\n // this.simpleBootFrontPool.set(simpleBootFront.option.name!, simpleBootFront);\n this.simpleBootFrontPool.push(simpleBootFront);\n this.simpleBootFrontQueue.enqueue(simpleBootFront);\n }\n async pushQueue() {\n if (this.simpleBootFrontPool.length < this.config.poolOption.max) {\n this.enqueueFrontApp(await this.makeFront(await this.makePage()));\n }\n }\n\n async proceedBefore({ rr, app }: { rr: RequestResponse; app: SimpleBootHttpServer; carrier: Map<string, any> }) {\n if (this.config.ssrExcludeFilter?.(rr)) {\n return false;\n }\n if (rr.reqHasAcceptHeader(Mimes.TextHtml) || rr.reqHasAcceptHeader(Mimes.All)) {\n if (this.simpleBootFrontQueue.isEmpty()) {\n await this.pushQueue();\n }\n const simpleBootFront = await this.simpleBootFrontQueue.dequeue();\n try {\n (simpleBootFront.option.window as any).ssrUse = true;\n delete (simpleBootFront.option.window as any).server_side_data;\n const url = rr.reqUrlObj({ host: 'localhost' });\n if (this.config.simpleBootFront?.notFoundError) {\n // intent router check first\n const intent = await simpleBootFront.routingRouterModule(url.pathname);\n // route\uB97C \uBABB\uCC3E\uC740\uC0C1\uD0DC\uC5D0\uC11C router path\uAE4C\uC9C0 \uC548\uB9DE\uC73C\uBA74 404 \uCC98\uB9AC\uD55C\uB2E4. route\uB791 router\uB791 \uB2E4\uB974\uB2C8\uAE50 \uD5DB\uAC08\uB9AC\uC9C0\uB9D0\uB3C4\uB85D\n if (intent.module === undefined && !intent.getRouterPathData(rr.reqUrlPathName)) {\n throw new NotFoundError({ message: `Not Found: ${rr.reqUrlPathName}` });\n }\n }\n\n // runRouting!!\n const targetUrl = url.toString();\n await simpleBootFront.goRouting(targetUrl);\n await new Promise(r => setTimeout(r, 0)); // <--\uC911\uC694: \uC774\uAC70 \uB123\uC5B4\uC57C\uC9C0 \uB450\uBC88\uBD88\uB7EC\uC9C0\uB294\uAC8C \uC5C6\uC5B4\uC9C0\uB294\uB4EF? \uBB50\uC9C0 event loop \uBCC0\uACBD\uB41C\uAC74\uAC00?\n\n\n // simpleBootFront.routingSubjectObservable.subscribe(it=>{\n // console.log('zzzzzzzzzzzzzzzzzzz', it);\n // if (it.triggerPoint==='end') {\n // console.log('zzz@@', it.routerModule.intent);\n // }\n // })\n\n const data = await MessageInternal.firstValueFrom(\n // @ts-ignore\n simpleBootFront.routingObservable.pipe(\n // @ts-ignore\n MessageOperator.filter(\n (it) =>\n it.triggerPoint === 'end' &&\n typeof it.routerModule.intent.uri === 'string' &&\n targetUrl.endsWith(it.routerModule.intent.uri)\n ),\n // delay(1000),\n MessageOperator.first()\n )\n );\n // console.log('???????done');\n const html = this.makeHTML(simpleBootFront);\n await this.writeOkHtmlAndEnd({ rr }, html);\n } finally {\n (simpleBootFront.option.window as any).ssrUse = false;\n delete (simpleBootFront.option.window as any).server_side_data;\n if ((simpleBootFront as any).generation < this.poolGeneration) {\n // Stale instance, destroy it\n const jsdom = (simpleBootFront as any).jsdom as JSDOM.JSDOM | undefined;\n jsdom?.window.close();\n const index = this.simpleBootFrontPool.indexOf(simpleBootFront);\n if (index > -1) {\n this.simpleBootFrontPool.splice(index, 1);\n }\n this.pushQueue();\n } else {\n // Current instance, return to queue\n this.simpleBootFrontQueue.enqueue(simpleBootFront);\n }\n }\n return false;\n } else {\n return true;\n }\n }\n\n makeHTML(simpleBootFront: SimpleBootFront) {\n (simpleBootFront.option.window as any).document.querySelectorAll('*').forEach((el:HTMLElement )=> {\n Array.from(el.attributes).forEach(attr => {\n if (/^dr-/.test(attr.name) || /^domstyle/.test(attr.name) || /this-path/.test(attr.name)) {\n el.removeAttribute(attr.name);\n }\n });\n });\n let html = simpleBootFront.option.window.document.documentElement.outerHTML;\n html = '<!DOCTYPE html>' + html;\n html = html.replace(/\\$\\{[\\s\\S]*?\\}\\$/g, '');\n const serverSideData = (simpleBootFront.option.window as any).server_side_data;\n if (serverSideData) {\n const data = Object.entries(serverSideData)\n .map(([k, v]) => {\n if (typeof v === 'string') {\n return `window.server_side_data.${k} = ${v}`;\n } else {\n return `window.server_side_data.${k} = ${JSON.stringify(v)}`;\n }\n })\n .join(';');\n if (data) {\n html = html.replace('</head>', `<script> window.server_side_data={}; ${data}; </script></head>`);\n }\n }\n return html;\n }\n async writeOkHtmlAndEnd({ rr, status = HttpStatus.Ok }: { rr: RequestResponse; status?: HttpStatus }, html: string) {\n rr.resStatusCode(status);\n rr.resSetHeader(HttpHeaders.ContentType, Mimes.TextHtml);\n await rr.resEnd(html);\n }\n\n async proceedAfter({ rr, app }: { rr: RequestResponse; app: SimpleBootHttpServer; carrier: Map<string, any> }) {\n return true;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAA4B;AAE5B,kBAAmG;AAGnG,mBAAsB;AACtB,wBAA2B;AAK3B,2BAA8B;AAC9B,wBAA+B;AAE/B,iCAAoC;AAoB7B,MAAM,oBAAsC;AAAA,EAQjD,YACS,QACA,kBACP;AAFO;AACA;AATT,SAAQ,sBAAyC,CAAC;AAClD,SAAQ,uBAAuB,IAAI,+BAAoC;AAEvE;AAAA,SAAQ,YAAY;AACpB,SAAQ,iBAAiB;AAOvB,WAAO,yBAAyB,OAAO,0BAA0B;AAAA,EAEnE;AAAA,EAEA,MAAM,OAAO,KAA2B;AACtC,aAAS,IAAI,GAAG,IAAI,KAAK,OAAO,WAAW,KAAK,KAAK;AACnD,YAAM,KAAK,UAAU;AAAA,IACvB;AAEA,QAAI,KAAK,OAAO,WAAW,qBAAqB,KAAK,OAAO,WAAW,oBAAoB,GAAG;AAC5F,WAAK,aAAa,YAAY,MAAM;AAClC,aAAK;AAAA,MACP,GAAG,KAAK,OAAO,WAAW,iBAAiB;AAAA,IAC7C;AAAA,EACF;AAAA,EAEA,MAAM,YAAY;AAChB,QAAI,KAAK,YAAY;AACnB,oBAAc,KAAK,UAAU;AAAA,IAC/B;AAEA,SAAK,oBAAoB,QAAQ,WAAS;AACxC,MAAC,MAAc,OAAO,OAAO,MAAM;AAAA,IACrC,CAAC;AACD,SAAK,sBAAsB,C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simple-boot/decorators/SimDecorator";
2
- import { AroundForceReturn } from "@dooboostore/simple-boot/decorators/aop/AOPDecorator";
3
- import { ReflectUtils } from "@dooboostore/core";
4
- const LoadAroundBefore = (obj, propertyKey, args) => {
5
- const simstanceManager = obj._SimpleBoot_simstanceManager;
6
- const simOption = obj._SimpleBoot_simOption;
7
- const config = getSim(obj);
8
- if (simstanceManager && simOption && config?.scheme) {
9
- const key = config.scheme + "_" + propertyKey;
10
- const type = ReflectUtils.getReturnType(obj, propertyKey);
11
- const isHas = key in (simOption.window.server_side_data ?? {});
12
- if (isHas) {
13
- const data = simOption.window.server_side_data?.[key];
14
- delete simOption.window.server_side_data?.[key];
15
- let rdata;
16
- if (type === Promise) {
17
- rdata = Promise.resolve(data);
18
- } else {
19
- rdata = data;
20
- }
21
- throw new AroundForceReturn(rdata);
22
- } else {
23
- return args;
24
- }
25
- }
26
- return args;
27
- };
28
- export {
29
- LoadAroundBefore
30
- };
31
- //# sourceMappingURL=LoadAroundBefore.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/decorators/LoadAroundBefore.ts"],
4
- "sourcesContent": ["import { getSim } from '@dooboostore/simple-boot/decorators/SimDecorator';\nimport { AroundForceReturn } from '@dooboostore/simple-boot/decorators/aop/AOPDecorator';\nimport { ReflectUtils } from '@dooboostore/core';\n\nexport const LoadAroundBefore = (obj: any, propertyKey: string, args: any[]) => {\n const simstanceManager = obj._SimpleBoot_simstanceManager;\n const simOption = obj._SimpleBoot_simOption;\n const config = getSim(obj);\n if (simstanceManager && simOption && config?.scheme) {\n const key = config.scheme + '_' + propertyKey;\n const type = ReflectUtils.getReturnType(obj, propertyKey);\n const isHas = (key in (simOption.window.server_side_data ?? {}))\n if (isHas) {\n const data = simOption.window.server_side_data?.[key];\n delete simOption.window.server_side_data?.[key];\n let rdata;\n if (type === Promise) {\n rdata = Promise.resolve(data);\n } else {\n rdata = data;\n }\n throw new AroundForceReturn(rdata);\n } else {\n return args;\n }\n }\n return args;\n}\n"],
5
- "mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAEtB,MAAM,mBAAmB,CAAC,KAAU,aAAqB,SAAgB;AAC5E,QAAM,mBAAmB,IAAI;AAC7B,QAAM,YAAY,IAAI;AACtB,QAAM,SAAS,OAAO,GAAG;AACzB,MAAI,oBAAoB,aAAa,QAAQ,QAAQ;AACjD,UAAM,MAAM,OAAO,SAAS,MAAM;AAClC,UAAM,OAAO,aAAa,cAAc,KAAK,WAAW;AACxD,UAAM,QAAS,QAAQ,UAAU,OAAO,oBAAoB,CAAC;AAC7D,QAAI,OAAO;AACP,YAAM,OAAO,UAAU,OAAO,mBAAmB,GAAG;AACpD,aAAO,UAAU,OAAO,mBAAmB,GAAG;AAC9C,UAAI;AACJ,UAAI,SAAS,SAAS;AAClB,gBAAQ,QAAQ,QAAQ,IAAI;AAAA,MAChC,OAAO;AACH,gBAAQ;AAAA,MACZ;AACA,YAAM,IAAI,kBAAkB,KAAK;AAAA,IACrC,OAAO;AACH,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO;AACX;",
6
- "names": []
7
- }
@@ -1,29 +0,0 @@
1
- import { getSim } from "@dooboostore/simple-boot/decorators/SimDecorator";
2
- const SaveAroundAfter = (obj, propertyKey, args, beforeReturn) => {
3
- const simstanceManager = obj._SimpleBoot_simstanceManager;
4
- const simOption = obj._SimpleBoot_simOption;
5
- const config = getSim(obj);
6
- if (simstanceManager && simOption && config?.scheme) {
7
- if (!simOption.window.server_side_data) {
8
- simOption.window.server_side_data = {};
9
- }
10
- const key = config.scheme + "_" + propertyKey;
11
- if (beforeReturn instanceof Promise) {
12
- beforeReturn.then((it) => {
13
- simOption.window.server_side_data[key] = JSON.stringify(it);
14
- return it;
15
- });
16
- } else {
17
- simOption.window.server_side_data[key] = JSON.stringify(beforeReturn);
18
- }
19
- }
20
- return beforeReturn;
21
- };
22
- const getStorage = (window) => {
23
- return window.aroundStorage;
24
- };
25
- export {
26
- SaveAroundAfter,
27
- getStorage
28
- };
29
- //# sourceMappingURL=SaveAroundAfter.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/decorators/SaveAroundAfter.ts"],
4
- "sourcesContent": ["import { getSim } from '@dooboostore/simple-boot/decorators/SimDecorator';\n\nexport const SaveAroundAfter = (obj: any, propertyKey: string, args: any[], beforeReturn: any) => {\n const simstanceManager = obj._SimpleBoot_simstanceManager;\n const simOption = obj._SimpleBoot_simOption;\n const config = getSim(obj);\n if (simstanceManager && simOption && config?.scheme) {\n if (!simOption.window.server_side_data) {\n simOption.window.server_side_data = {};\n }\n const key = config.scheme+'_'+propertyKey;\n if (beforeReturn instanceof Promise) {\n beforeReturn.then((it) => {\n simOption.window.server_side_data[key] = JSON.stringify(it);\n return it;\n });\n } else {\n simOption.window.server_side_data[key] = JSON.stringify(beforeReturn);\n }\n }\n return beforeReturn;\n}\n\n\nexport const getStorage = (window: Window) => {\n return (window as any).aroundStorage;\n}\n"],
5
- "mappings": "AAAA,SAAS,cAAc;AAEhB,MAAM,kBAAkB,CAAC,KAAU,aAAqB,MAAa,iBAAsB;AAC9F,QAAM,mBAAmB,IAAI;AAC7B,QAAM,YAAY,IAAI;AACtB,QAAM,SAAS,OAAO,GAAG;AACzB,MAAI,oBAAoB,aAAa,QAAQ,QAAQ;AACjD,QAAI,CAAC,UAAU,OAAO,kBAAkB;AACpC,gBAAU,OAAO,mBAAmB,CAAC;AAAA,IACzC;AACA,UAAM,MAAM,OAAO,SAAO,MAAI;AAC9B,QAAI,wBAAwB,SAAS;AACjC,mBAAa,KAAK,CAAC,OAAO;AACtB,kBAAU,OAAO,iBAAiB,GAAG,IAAI,KAAK,UAAU,EAAE;AAC1D,eAAO;AAAA,MACX,CAAC;AAAA,IACL,OAAO;AACH,gBAAU,OAAO,iBAAiB,GAAG,IAAI,KAAK,UAAU,YAAY;AAAA,IACxE;AAAA,EACJ;AACA,SAAO;AACX;AAGO,MAAM,aAAa,CAAC,WAAmB;AAC1C,SAAQ,OAAe;AAC3B;",
6
- "names": []
7
- }
@@ -1,3 +0,0 @@
1
- export * from "./LoadAroundBefore.js";
2
- export * from "./SaveAroundAfter.js";
3
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/decorators/index.ts"],
4
- "sourcesContent": ["export * from './LoadAroundBefore';\nexport * from './SaveAroundAfter';"],
5
- "mappings": "AAAA,cAAc;AACd,cAAc;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/filters/SSRLinkDomDomFilter.ts"],
4
- "sourcesContent": ["import { RequestResponse } from '@dooboostore/simple-boot-http-server/models/RequestResponse';\nimport { HttpHeaders } from '@dooboostore/simple-boot-http-server/codes/HttpHeaders';\nimport { SimpleBootHttpSSRFactory } from '../SimpleBootHttpSSRFactory';\nimport { ConstructorType, AsyncBlockingQueue, RandomUtils, MessageOperator, MessageInternal } from '@dooboostore/core';\nimport { JsdomInitializer } from '../initializers/JsdomInitializer';\nimport { Filter } from '@dooboostore/simple-boot-http-server/filters/Filter';\nimport { Mimes } from '@dooboostore/simple-boot-http-server/codes/Mimes';\nimport { HttpStatus } from '@dooboostore/simple-boot-http-server/codes/HttpStatus';\nimport { SimpleBootHttpServer } from '@dooboostore/simple-boot-http-server/SimpleBootHttpServer';\nimport { SimFrontOption } from '@dooboostore/simple-boot-front/option/SimFrontOption';\nimport { SimpleBootFront } from '@dooboostore/simple-boot-front/SimpleBootFront';\nimport * as JSDOM from 'jsdom';\nimport { NotFoundError } from '@dooboostore/simple-boot-http-server/errors/NotFoundError';\nimport { DomRenderProxy } from '@dooboostore/dom-render';\nimport { parseHTML } from 'linkedom';\nimport { LinkedomInitializer } from '../initializers/LinkedomInitializer';\n\nexport type FactoryAndParams = {\n frontDistPath: string;\n frontDistIndexFileName?: string;\n factorySimFrontOption: (window: any) => SimFrontOption;\n factory: SimpleBootHttpSSRFactory;\n poolOption: {\n max: number;\n min: number;\n clearIntervalTime?: number;\n };\n using: ConstructorType<any>[];\n domExcludes?: ConstructorType<any>[];\n ssrExcludeFilter?: (rr: RequestResponse) => boolean;\n simpleBootFront?: {\n notFoundError?: boolean;\n };\n};\n\nexport class SSRLinkDomDomFilter implements Filter {\n private simpleBootFrontPool: SimpleBootFront[] = [];\n private simpleBootFrontQueue = new AsyncBlockingQueue<SimpleBootFront>();\n // private indexHTML: string;\n private welcomUrl = 'http://localhost';\n private poolGeneration = 0;\n private intervalId?: NodeJS.Timeout;\n\n constructor(\n public config: FactoryAndParams,\n public otherInstanceSim?: Map<ConstructorType<any>, any>\n ) {\n config.frontDistIndexFileName = config.frontDistIndexFileName || 'index.html';\n // this.indexHTML = JsdomInitializer.loadFile(this.config.frontDistPath, config.frontDistIndexFileName);\n }\n\n async onInit(app: SimpleBootHttpServer) {\n for (let i = 0; i < this.config.poolOption.min; i++) {\n await this.pushQueue();\n }\n\n if (this.config.poolOption.clearIntervalTime && this.config.poolOption.clearIntervalTime > 0) {\n this.intervalId = setInterval(() => {\n this.poolGeneration++;\n }, this.config.poolOption.clearIntervalTime);\n }\n }\n\n async onDestroy() {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n // this.simpleBootFrontQueue.clear();\n this.simpleBootFrontPool.forEach(front => {\n (front as any).jsdom?.window.close();\n });\n this.simpleBootFrontPool = [];\n }\n\n async makePage() {\n return new LinkedomInitializer(\n this.config.frontDistPath,\n this.config.frontDistIndexFileName || 'index.html',\n { url: this.welcomUrl }\n ).run();\n // const jsdom = await new JsdomInitializer(\n // this.config.frontDistPath,\n // this.config.frontDistIndexFileName || 'index.html',\n // { url: this.welcomUrl }\n // ).run();\n // return jsdom;\n }\n\n async makeFront(window: Window) {\n const name = RandomUtils.uuid();\n (window as any).ssrUse = false;\n const option = this.config.factorySimFrontOption(DomRenderProxy.final(window));\n const simpleBootFront = await this.config.factory.create(option, this.config.using, this.config.domExcludes);\n simpleBootFront.run(this.otherInstanceSim);\n (simpleBootFront as any).generation = this.poolGeneration;\n return simpleBootFront;\n }\n\n enqueueFrontApp(simpleBootFront: SimpleBootFront) {\n // this.simpleBootFrontPool.set(simpleBootFront.option.name!, simpleBootFront);\n this.simpleBootFrontPool.push(simpleBootFront);\n this.simpleBootFrontQueue.enqueue(simpleBootFront);\n }\n async pushQueue() {\n if (this.simpleBootFrontPool.length < this.config.poolOption.max) {\n this.enqueueFrontApp(await this.makeFront(await this.makePage()));\n }\n }\n\n async proceedBefore({ rr, app }: { rr: RequestResponse; app: SimpleBootHttpServer; carrier: Map<string, any> }) {\n if (this.config.ssrExcludeFilter?.(rr)) {\n return false;\n }\n if (rr.reqHasAcceptHeader(Mimes.TextHtml) || rr.reqHasAcceptHeader(Mimes.All)) {\n if (this.simpleBootFrontQueue.isEmpty()) {\n await this.pushQueue();\n }\n const simpleBootFront = await this.simpleBootFrontQueue.dequeue();\n try {\n (simpleBootFront.option.window as any).ssrUse = true;\n delete (simpleBootFront.option.window as any).server_side_data;\n const url = rr.reqUrlObj({ host: 'localhost' });\n if (this.config.simpleBootFront?.notFoundError) {\n // intent router check first\n const intent = await simpleBootFront.routingRouterModule(url.pathname);\n // route\uB97C \uBABB\uCC3E\uC740\uC0C1\uD0DC\uC5D0\uC11C router path\uAE4C\uC9C0 \uC548\uB9DE\uC73C\uBA74 404 \uCC98\uB9AC\uD55C\uB2E4. route\uB791 router\uB791 \uB2E4\uB974\uB2C8\uAE50 \uD5DB\uAC08\uB9AC\uC9C0\uB9D0\uB3C4\uB85D\n if (intent.module === undefined && !intent.getRouterPathData(rr.reqUrlPathName)) {\n throw new NotFoundError({ message: `Not Found: ${rr.reqUrlPathName}` });\n }\n }\n\n // runRouting!!\n const targetUrl = url.toString();\n await simpleBootFront.goRouting(targetUrl);\n await new Promise(r => setTimeout(r, 0)); // <--\uC911\uC694: \uC774\uAC70 \uB123\uC5B4\uC57C\uC9C0 \uB450\uBC88\uBD88\uB7EC\uC9C0\uB294\uAC8C \uC5C6\uC5B4\uC9C0\uB294\uB4EF? \uBB50\uC9C0 event loop \uBCC0\uACBD\uB41C\uAC74\uAC00?\n\n\n // simpleBootFront.routingSubjectObservable.subscribe(it=>{\n // console.log('zzzzzzzzzzzzzzzzzzz', it);\n // if (it.triggerPoint==='end') {\n // console.log('zzz@@', it.routerModule.intent);\n // }\n // })\n\n const data = await MessageInternal.firstValueFrom(\n // @ts-ignore\n simpleBootFront.routingObservable.pipe(\n // @ts-ignore\n MessageOperator.filter(\n (it) =>\n it.triggerPoint === 'end' &&\n typeof it.routerModule.intent.uri === 'string' &&\n targetUrl.endsWith(it.routerModule.intent.uri)\n ),\n // delay(1000),\n MessageOperator.first()\n )\n );\n // console.log('???????done');\n const html = this.makeHTML(simpleBootFront);\n await this.writeOkHtmlAndEnd({ rr }, html);\n } finally {\n (simpleBootFront.option.window as any).ssrUse = false;\n delete (simpleBootFront.option.window as any).server_side_data;\n if ((simpleBootFront as any).generation < this.poolGeneration) {\n // Stale instance, destroy it\n const jsdom = (simpleBootFront as any).jsdom as JSDOM.JSDOM | undefined;\n jsdom?.window.close();\n const index = this.simpleBootFrontPool.indexOf(simpleBootFront);\n if (index > -1) {\n this.simpleBootFrontPool.splice(index, 1);\n }\n this.pushQueue();\n } else {\n // Current instance, return to queue\n this.simpleBootFrontQueue.enqueue(simpleBootFront);\n }\n }\n return false;\n } else {\n return true;\n }\n }\n\n makeHTML(simpleBootFront: SimpleBootFront) {\n (simpleBootFront.option.window as any).document.querySelectorAll('*').forEach((el:HTMLElement )=> {\n Array.from(el.attributes).forEach(attr => {\n if (/^dr-/.test(attr.name) || /^domstyle/.test(attr.name) || /this-path/.test(attr.name)) {\n el.removeAttribute(attr.name);\n }\n });\n });\n let html = simpleBootFront.option.window.document.documentElement.outerHTML;\n html = '<!DOCTYPE html>' + html;\n html = html.replace(/\\$\\{[\\s\\S]*?\\}\\$/g, '');\n const serverSideData = (simpleBootFront.option.window as any).server_side_data;\n if (serverSideData) {\n const data = Object.entries(serverSideData)\n .map(([k, v]) => {\n if (typeof v === 'string') {\n return `window.server_side_data.${k} = ${v}`;\n } else {\n return `window.server_side_data.${k} = ${JSON.stringify(v)}`;\n }\n })\n .join(';');\n if (data) {\n html = html.replace('</head>', `<script> window.server_side_data={}; ${data}; </script></head>`);\n }\n }\n return html;\n }\n async writeOkHtmlAndEnd({ rr, status = HttpStatus.Ok }: { rr: RequestResponse; status?: HttpStatus }, html: string) {\n rr.resStatusCode(status);\n rr.resSetHeader(HttpHeaders.ContentType, Mimes.TextHtml);\n await rr.resEnd(html);\n }\n\n async proceedAfter({ rr, app }: { rr: RequestResponse; app: SimpleBootHttpServer; carrier: Map<string, any> }) {\n return true;\n }\n}\n"],
5
- "mappings": "AACA,SAAS,mBAAmB;AAE5B,SAA0B,oBAAoB,aAAa,iBAAiB,uBAAuB;AAGnG,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAK3B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAE/B,SAAS,2BAA2B;AAoB7B,MAAM,oBAAsC;AAAA,EAQjD,YACS,QACA,kBACP;AAFO;AACA;AATT,SAAQ,sBAAyC,CAAC;AAClD,SAAQ,uBAAuB,IAAI,mBAAoC;AAEvE;AAAA,SAAQ,YAAY;AACpB,SAAQ,iBAAiB;AAOvB,WAAO,yBAAyB,OAAO,0BAA0B;AAAA,EAEnE;AAAA,EAEA,MAAM,OAAO,KAA2B;AACtC,aAAS,IAAI,GAAG,IAAI,KAAK,OAAO,WAAW,KAAK,KAAK;AACnD,YAAM,KAAK,UAAU;AAAA,IACvB;AAEA,QAAI,KAAK,OAAO,WAAW,qBAAqB,KAAK,OAAO,WAAW,oBAAoB,GAAG;AAC5F,WAAK,aAAa,YAAY,MAAM;AAClC,aAAK;AAAA,MACP,GAAG,KAAK,OAAO,WAAW,iBAAiB;AAAA,IAC7C;AAAA,EACF;AAAA,EAEA,MAAM,YAAY;AAChB,QAAI,KAAK,YAAY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;AAAA,EAEA,MAAM,aAAa,EAAE,IAAI,IAAI,GAAkF;AAC7G,WAAO;AAAA,EACT;AACF;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- export declare const LoadAroundBefore: (obj: any, propertyKey: string, args: any[]) => any[];
2
- //# sourceMappingURL=LoadAroundBefore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadAroundBefore.d.ts","sourceRoot":"","sources":["../../../src/decorators/LoadAroundBefore.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAAI,KAAK,GAAG,EAAE,aAAa,MAAM,EAAE,MAAM,GAAG,EAAE,UAuB1E,CAAA"}
@@ -1,3 +0,0 @@
1
- export declare const SaveAroundAfter: (obj: any, propertyKey: string, args: any[], beforeReturn: any) => any;
2
- export declare const getStorage: (window: Window) => any;
3
- //# sourceMappingURL=SaveAroundAfter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SaveAroundAfter.d.ts","sourceRoot":"","sources":["../../../src/decorators/SaveAroundAfter.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI,KAAK,GAAG,EAAE,aAAa,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,cAAc,GAAG,QAmB5F,CAAA;AAGD,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,QAExC,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './LoadAroundBefore';
2
- export * from './SaveAroundAfter';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SSRLinkDomDomFilter.d.ts","sourceRoot":"","sources":["../../../src/filters/SSRLinkDomDomFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,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K;IAC3B,OAAO,CAAC,UAAU,CAAC,CAAiB;gBAG3B,MAAM,EAAE,gBAAgB,EACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAMpD,MAAM,CAAC,GAAG,EAAE,oBAAoB;IAYhC,SAAS;IAWT,QAAQ;IAcR,SAAS,CAAC,MAAM,EAAE,MAAM;IAU9B,eAAe,CAAC,eAAe,EAAE,eAAe;IAK1C,SAAS;IAMT,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;QAAE,EAAE,EAAE,eAAe,CAAC;QAAC,GAAG,EAAE,oBAAoB,CAAC;QAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE;IA2E9G,QAAQ,CAAC,eAAe,EAAE,eAAe;IA4BnC,iBAAiB,CAAC,EAAE,EAAE,EAAE,MAAsB,EAAE,EAAE;QAAE,EAAE,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAA;KAAE,EAAE,IAAI,EAAE,MAAM;IAM5G,YAAY,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;QAAE,EAAE,EAAE,eAAe,CAAC;QAAC,GAAG,EAAE,oBAAoB,CAAC;QAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE;CAG9G"}
@@ -1,28 +0,0 @@
1
- import { getSim } from '@dooboostore/simple-boot/decorators/SimDecorator';
2
- import { AroundForceReturn } from '@dooboostore/simple-boot/decorators/aop/AOPDecorator';
3
- import { ReflectUtils } from '@dooboostore/core';
4
-
5
- export const LoadAroundBefore = (obj: any, propertyKey: string, args: any[]) => {
6
- const simstanceManager = obj._SimpleBoot_simstanceManager;
7
- const simOption = obj._SimpleBoot_simOption;
8
- const config = getSim(obj);
9
- if (simstanceManager && simOption && config?.scheme) {
10
- const key = config.scheme + '_' + propertyKey;
11
- const type = ReflectUtils.getReturnType(obj, propertyKey);
12
- const isHas = (key in (simOption.window.server_side_data ?? {}))
13
- if (isHas) {
14
- const data = simOption.window.server_side_data?.[key];
15
- delete simOption.window.server_side_data?.[key];
16
- let rdata;
17
- if (type === Promise) {
18
- rdata = Promise.resolve(data);
19
- } else {
20
- rdata = data;
21
- }
22
- throw new AroundForceReturn(rdata);
23
- } else {
24
- return args;
25
- }
26
- }
27
- return args;
28
- }
@@ -1,27 +0,0 @@
1
- import { getSim } from '@dooboostore/simple-boot/decorators/SimDecorator';
2
-
3
- export const SaveAroundAfter = (obj: any, propertyKey: string, args: any[], beforeReturn: any) => {
4
- const simstanceManager = obj._SimpleBoot_simstanceManager;
5
- const simOption = obj._SimpleBoot_simOption;
6
- const config = getSim(obj);
7
- if (simstanceManager && simOption && config?.scheme) {
8
- if (!simOption.window.server_side_data) {
9
- simOption.window.server_side_data = {};
10
- }
11
- const key = config.scheme+'_'+propertyKey;
12
- if (beforeReturn instanceof Promise) {
13
- beforeReturn.then((it) => {
14
- simOption.window.server_side_data[key] = JSON.stringify(it);
15
- return it;
16
- });
17
- } else {
18
- simOption.window.server_side_data[key] = JSON.stringify(beforeReturn);
19
- }
20
- }
21
- return beforeReturn;
22
- }
23
-
24
-
25
- export const getStorage = (window: Window) => {
26
- return (window as any).aroundStorage;
27
- }
@@ -1,2 +0,0 @@
1
- export * from './LoadAroundBefore';
2
- export * from './SaveAroundAfter';