@spinajs/templates-puppeteer 2.0.481 → 2.0.482
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.
- package/README.md +35 -0
- package/lib/cjs/asset-server.d.ts +32 -0
- package/lib/cjs/asset-server.d.ts.map +1 -0
- package/lib/cjs/asset-server.js +125 -0
- package/lib/cjs/asset-server.js.map +1 -0
- package/lib/cjs/browser-pool.d.ts +31 -0
- package/lib/cjs/browser-pool.d.ts.map +1 -0
- package/lib/cjs/browser-pool.js +83 -0
- package/lib/cjs/browser-pool.js.map +1 -0
- package/lib/cjs/index.d.ts +84 -19
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +203 -182
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/progress.d.ts +41 -0
- package/lib/cjs/progress.d.ts.map +1 -0
- package/lib/cjs/progress.js +179 -0
- package/lib/cjs/progress.js.map +1 -0
- package/lib/mjs/asset-server.d.ts +32 -0
- package/lib/mjs/asset-server.d.ts.map +1 -0
- package/lib/mjs/asset-server.js +118 -0
- package/lib/mjs/asset-server.js.map +1 -0
- package/lib/mjs/browser-pool.d.ts +31 -0
- package/lib/mjs/browser-pool.d.ts.map +1 -0
- package/lib/mjs/browser-pool.js +76 -0
- package/lib/mjs/browser-pool.js.map +1 -0
- package/lib/mjs/index.d.ts +84 -19
- package/lib/mjs/index.d.ts.map +1 -1
- package/lib/mjs/index.js +190 -180
- package/lib/mjs/index.js.map +1 -1
- package/lib/mjs/progress.d.ts +41 -0
- package/lib/mjs/progress.d.ts.map +1 -0
- package/lib/mjs/progress.js +175 -0
- package/lib/mjs/progress.js.map +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +8 -7
package/lib/cjs/index.js
CHANGED
|
@@ -1,246 +1,267 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
2
13
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
14
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
15
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
16
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
17
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
18
|
};
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
8
22
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
23
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
24
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
26
|
exports.PuppeteerRenderer = void 0;
|
|
16
|
-
const puppeteer_1 = __importDefault(require("puppeteer"));
|
|
17
27
|
const exceptions_1 = require("@spinajs/exceptions");
|
|
18
28
|
const templates_1 = require("@spinajs/templates");
|
|
19
29
|
const di_1 = require("@spinajs/di");
|
|
20
30
|
const path_1 = require("path");
|
|
21
31
|
const log_1 = require("@spinajs/log");
|
|
22
|
-
const express_1 = __importDefault(require("express"));
|
|
23
|
-
const cors_1 = __importDefault(require("cors"));
|
|
24
32
|
require("@spinajs/templates-pug");
|
|
25
|
-
const
|
|
33
|
+
const progress_js_1 = require("./progress.js");
|
|
34
|
+
const asset_server_js_1 = require("./asset-server.js");
|
|
35
|
+
const browser_pool_js_1 = require("./browser-pool.js");
|
|
36
|
+
__exportStar(require("./progress.js"), exports);
|
|
37
|
+
__exportStar(require("./asset-server.js"), exports);
|
|
38
|
+
__exportStar(require("./browser-pool.js"), exports);
|
|
39
|
+
/** Default navigation/render timeout when none is configured (ms). */
|
|
40
|
+
const DEFAULT_RENDER_TIMEOUT_MS = 30000;
|
|
41
|
+
/** Watchdog canceller used when timeouts are disabled (debug mode). */
|
|
42
|
+
const noop = () => {
|
|
43
|
+
/* nothing to cancel */
|
|
44
|
+
};
|
|
26
45
|
class PuppeteerRenderer extends templates_1.TemplateRenderer {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Per-instance options that give this renderer its identity for the DI
|
|
48
|
+
* @PerInstanceCheck pooling (see subclasses). Renderers that are not pooled
|
|
49
|
+
* per-instance inherit the `undefined` default.
|
|
50
|
+
*/
|
|
51
|
+
get instanceOptions() {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* DI @PerInstanceCheck hook: an existing instance is reused only when it was
|
|
56
|
+
* created with the same options.
|
|
57
|
+
*/
|
|
58
|
+
__checkInstance__(creationOptions) {
|
|
59
|
+
return JSON.stringify(this.instanceOptions) === JSON.stringify(creationOptions);
|
|
60
|
+
}
|
|
61
|
+
/** Local static server used so Chromium can load relative asset URLs. Lazily created. */
|
|
62
|
+
get assetServer() {
|
|
63
|
+
return (this._assetServer ??= new asset_server_js_1.LocalAssetServer(this.Log, () => this.Options?.static?.portRange));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pooled browser, launched lazily and reused across renders, closed on dispose().
|
|
67
|
+
* One pool per options-set (see @PerInstanceCheck on subclasses). Lazily created.
|
|
68
|
+
*/
|
|
69
|
+
get browserPool() {
|
|
70
|
+
return (this._browserPool ??= new browser_pool_js_1.BrowserPool(this.Log, () => this.buildLaunchOptions()));
|
|
71
|
+
}
|
|
72
|
+
buildLaunchOptions() {
|
|
73
|
+
return {
|
|
74
|
+
...(this.Options?.args || {}),
|
|
75
|
+
...(this.Options?.executablePath && {
|
|
76
|
+
executablePath: this.Options.executablePath,
|
|
77
|
+
}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async renderToFile(template, model, filePath, language, options) {
|
|
81
|
+
const templateBasePath = (0, path_1.dirname)(template);
|
|
82
|
+
await this.renderContentToFile(filePath, { assetBasePath: templateBasePath, onProgress: options?.onProgress }, async (page, httpPort, markLoading) => {
|
|
39
83
|
const compiledTemplate = await this.TemplatingService.render((0, path_1.join)(templateBasePath, (0, path_1.basename)(template, this.Extension)) + '.pug', {
|
|
40
|
-
// add template temporary server port
|
|
41
|
-
// so we can use it to render images in template
|
|
84
|
+
// add template temporary server port so templates can reference local images
|
|
42
85
|
__http_template_port__: httpPort,
|
|
43
|
-
// for
|
|
86
|
+
// for convenience add full url to local http server
|
|
44
87
|
__http_template_address__: `http://localhost:${httpPort}`,
|
|
45
88
|
...model,
|
|
46
89
|
}, language);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
90
|
+
// template is compiled; resource loading starts with setContent
|
|
91
|
+
markLoading();
|
|
92
|
+
await page.setContent(compiledTemplate);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Render a raw HTML string to a file (image/pdf per the concrete renderer).
|
|
97
|
+
* Intended for CI (e.g. screenshot comparison) where HTML is already produced.
|
|
98
|
+
*
|
|
99
|
+
* @param html - the HTML content to render
|
|
100
|
+
* @param filePath - output file path
|
|
101
|
+
* @param options.assetBasePath - directory served over the local http server so
|
|
102
|
+
* relative asset URLs in the HTML resolve (defaults to the output file's dir)
|
|
103
|
+
* @param options.viewport - fixed viewport for deterministic captures
|
|
104
|
+
*/
|
|
105
|
+
async renderHtmlToFile(html, filePath, options) {
|
|
106
|
+
await this.renderContentToFile(filePath, { assetBasePath: options?.assetBasePath ?? (0, path_1.dirname)(filePath), onProgress: options?.onProgress }, async (page, httpPort, markLoading) => {
|
|
107
|
+
if (options?.viewport) {
|
|
108
|
+
await page.setViewport(options.viewport);
|
|
59
109
|
}
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
110
|
+
// resource loading starts with setContent
|
|
111
|
+
markLoading();
|
|
112
|
+
// inject a <base href> so relative asset URLs resolve via the local server
|
|
113
|
+
await page.setContent(this.injectBaseHref(html, `http://127.0.0.1:${httpPort}/`));
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Shared render orchestration: local static server + pooled browser + page +
|
|
118
|
+
* timeout watchdog + cleanup. `prepare` populates the page content (template-compiled
|
|
119
|
+
* HTML, or raw HTML). The pooled browser survives; only the page is closed.
|
|
120
|
+
*/
|
|
121
|
+
async renderContentToFile(filePath, opts, prepare) {
|
|
122
|
+
const timerLabel = `puppeteer-template-rendering-${filePath}`;
|
|
123
|
+
const progress = new progress_js_1.RenderProgressReporter(filePath, opts.onProgress);
|
|
124
|
+
let server = null;
|
|
125
|
+
let page = null;
|
|
126
|
+
// When debug.close === false the page is intentionally kept open for
|
|
127
|
+
// inspection, so timeouts must not be armed (the watchdog would close it).
|
|
128
|
+
// The browser itself is pooled and only closed on dispose().
|
|
129
|
+
const keepPageOpen = this.Options?.debug?.close === false;
|
|
130
|
+
try {
|
|
131
|
+
this.Log.timeStart(timerLabel);
|
|
132
|
+
this.Log.trace(`Rendering to file ${filePath}`);
|
|
133
|
+
progress.phase(templates_1.RenderPhase.Starting);
|
|
134
|
+
// fire up local http server for serving images etc, because chromium
|
|
135
|
+
// prevents reading local files when not using the file:// protocol
|
|
136
|
+
server = await this.assetServer.serve(opts.assetBasePath ?? process.cwd());
|
|
137
|
+
const httpPort = server.address().port;
|
|
138
|
+
// reuse the pooled browser; open a fresh page per render
|
|
139
|
+
const browser = await this.browserPool.acquire();
|
|
140
|
+
page = await browser.newPage();
|
|
141
|
+
progress.attach(page);
|
|
142
|
+
// In debug mode neither timeouts nor the watchdog are armed, so the page
|
|
143
|
+
// can be inspected indefinitely.
|
|
144
|
+
const cancelWatchdog = keepPageOpen ? noop : this.armRenderWatchdog(page);
|
|
145
|
+
if (!keepPageOpen) {
|
|
146
|
+
this.configurePageTimeouts(page);
|
|
76
147
|
}
|
|
77
|
-
|
|
78
|
-
const eventCleanup = this.addPageEventListeners(page);
|
|
148
|
+
const removeListeners = this.addPageEventListeners(page);
|
|
79
149
|
try {
|
|
150
|
+
progress.phase(templates_1.RenderPhase.Preparing);
|
|
80
151
|
await page.setBypassCSP(true);
|
|
81
|
-
|
|
82
|
-
//
|
|
152
|
+
// prepare compiles/builds the HTML then calls markLoading() right before
|
|
153
|
+
// setContent, so template-compile time is separated from resource loading.
|
|
154
|
+
await prepare(page, httpPort, () => progress.phase(templates_1.RenderPhase.Loading));
|
|
155
|
+
// perform the concrete rendering (PDF or image)
|
|
156
|
+
progress.phase(templates_1.RenderPhase.Rendering);
|
|
83
157
|
await this.performRender(page, filePath);
|
|
84
|
-
|
|
85
|
-
if (renderTimeout) {
|
|
86
|
-
clearTimeout(renderTimeout);
|
|
87
|
-
renderTimeout = undefined;
|
|
88
|
-
}
|
|
89
|
-
// Clean up event listeners
|
|
90
|
-
eventCleanup();
|
|
158
|
+
progress.phase(templates_1.RenderPhase.Done);
|
|
91
159
|
}
|
|
92
160
|
catch (renderError) {
|
|
93
|
-
|
|
94
|
-
if (renderTimeout) {
|
|
95
|
-
clearTimeout(renderTimeout);
|
|
96
|
-
renderTimeout = undefined;
|
|
97
|
-
}
|
|
98
|
-
this.Log.error(renderError, `Error during rendering for template ${template}`);
|
|
161
|
+
this.Log.error(renderError, `Error during rendering for ${filePath}`);
|
|
99
162
|
throw renderError;
|
|
100
163
|
}
|
|
164
|
+
finally {
|
|
165
|
+
cancelWatchdog();
|
|
166
|
+
removeListeners();
|
|
167
|
+
}
|
|
101
168
|
}
|
|
102
169
|
catch (err) {
|
|
103
|
-
|
|
170
|
+
progress.phase(templates_1.RenderPhase.Failed, err?.message);
|
|
171
|
+
this.Log.error(err, `Error rendering to file ${filePath}`);
|
|
104
172
|
throw err;
|
|
105
173
|
}
|
|
106
174
|
finally {
|
|
107
|
-
|
|
108
|
-
this.Log.
|
|
109
|
-
|
|
110
|
-
|
|
175
|
+
progress.dispose();
|
|
176
|
+
const duration = this.Log.timeEnd(timerLabel);
|
|
177
|
+
this.Log.trace(`Ended rendering to file ${filePath}, took: ${duration}ms`);
|
|
178
|
+
this.warnIfSlow(filePath, duration);
|
|
179
|
+
// Close the page (not the pooled browser). Skip if debug.close is false
|
|
180
|
+
// so the rendered page can be inspected.
|
|
181
|
+
if (page && !keepPageOpen) {
|
|
182
|
+
await this.closePage(page);
|
|
111
183
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
await this.safeBrowserCleanup(browser);
|
|
115
|
-
}
|
|
116
|
-
else if (browser) {
|
|
117
|
-
this.Log.info('Browser kept open for debugging (debug.close=false)');
|
|
184
|
+
else if (page) {
|
|
185
|
+
this.Log.info('Page kept open for debugging (debug.close=false)');
|
|
118
186
|
}
|
|
119
187
|
if (server) {
|
|
120
|
-
await this.
|
|
188
|
+
await this.assetServer.close(server);
|
|
121
189
|
}
|
|
122
190
|
}
|
|
123
191
|
}
|
|
124
|
-
|
|
125
|
-
|
|
192
|
+
/** Effective render timeout: configured value, else the default. */
|
|
193
|
+
get renderTimeoutMs() {
|
|
194
|
+
return this.Options?.renderTimeout || DEFAULT_RENDER_TIMEOUT_MS;
|
|
126
195
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const app = (0, express_1.default)();
|
|
132
|
-
app.use((0, cors_1.default)());
|
|
133
|
-
app.use(express_1.default.static(basePath));
|
|
134
|
-
return new Promise((resolve, reject) => {
|
|
135
|
-
const server = app
|
|
136
|
-
// if no port is provided express will choose random port to start (available)
|
|
137
|
-
// if not, we will get random from range in config
|
|
138
|
-
.listen(!this.Options?.static?.portRange || this.Options.static.portRange.length === 0
|
|
139
|
-
? 0
|
|
140
|
-
: lodash_1.default.random(this.Options.static.portRange[0], this.Options.static.portRange[1]))
|
|
141
|
-
.on('listening', function () {
|
|
142
|
-
self.Log.trace(`Puppeteer image server started on port ${this.address().port}`);
|
|
143
|
-
self.Log.trace(`Puppeteer static file dir at ${basePath}`);
|
|
144
|
-
resolve(this);
|
|
145
|
-
})
|
|
146
|
-
.on('error', (err) => {
|
|
147
|
-
self.Log.error(err, `Puppeteer image server cannot start`);
|
|
148
|
-
// Clean up the failed server
|
|
149
|
-
if (server) {
|
|
150
|
-
server.close(() => {
|
|
151
|
-
reject(err);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
reject(err);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
// Set a timeout for server startup
|
|
159
|
-
setTimeout(() => {
|
|
160
|
-
if (!server.listening) {
|
|
161
|
-
server.close();
|
|
162
|
-
reject(new Error('Server startup timeout'));
|
|
163
|
-
}
|
|
164
|
-
}, 10000);
|
|
165
|
-
});
|
|
196
|
+
/** Apply the configured (or default) navigation and render timeouts to a page. */
|
|
197
|
+
configurePageTimeouts(page) {
|
|
198
|
+
page.setDefaultNavigationTimeout(this.Options?.navigationTimeout || DEFAULT_RENDER_TIMEOUT_MS);
|
|
199
|
+
page.setDefaultTimeout(this.renderTimeoutMs);
|
|
166
200
|
}
|
|
167
201
|
/**
|
|
168
|
-
*
|
|
202
|
+
* Arm a watchdog that closes the page if a render exceeds the configured
|
|
203
|
+
* timeout - only the page is closed, the pooled browser may be serving other
|
|
204
|
+
* concurrent renders. Returns a function that cancels the watchdog.
|
|
169
205
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
await this.forceCloseBrowser(browser);
|
|
183
|
-
}
|
|
184
|
-
catch (killErr) {
|
|
185
|
-
this.Log.error(`Failed to force kill browser: ${killErr.message}`);
|
|
186
|
-
}
|
|
206
|
+
armRenderWatchdog(page) {
|
|
207
|
+
const timeoutMs = this.renderTimeoutMs;
|
|
208
|
+
const handle = setTimeout(() => {
|
|
209
|
+
this.Log.warn(`Render timeout (${timeoutMs}ms) - closing page`);
|
|
210
|
+
page.close().catch(() => { });
|
|
211
|
+
}, timeoutMs);
|
|
212
|
+
return () => clearTimeout(handle);
|
|
213
|
+
}
|
|
214
|
+
/** Warn if a render took longer than the configured warning threshold. */
|
|
215
|
+
warnIfSlow(filePath, duration) {
|
|
216
|
+
if (this.Options && duration > this.Options.renderDurationWarning) {
|
|
217
|
+
this.Log.warn(`Rendering to file ${filePath} took too long.`);
|
|
187
218
|
}
|
|
188
219
|
}
|
|
220
|
+
/** Close a page, downgrading any close error to a warning (best-effort cleanup). */
|
|
221
|
+
async closePage(page) {
|
|
222
|
+
await page.close().catch((err) => this.Log.warn(`Error closing page: ${err.message}`));
|
|
223
|
+
}
|
|
189
224
|
/**
|
|
190
|
-
*
|
|
225
|
+
* Insert a <base href> into the HTML <head> so relative asset URLs resolve
|
|
226
|
+
* against the local static server. No-op if the HTML already declares a <base>.
|
|
191
227
|
*/
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (process) {
|
|
196
|
-
process.kill('SIGKILL');
|
|
197
|
-
this.Log.warn('Browser process force killed');
|
|
198
|
-
}
|
|
228
|
+
injectBaseHref(html, baseUrl) {
|
|
229
|
+
if (/<base\s/i.test(html)) {
|
|
230
|
+
return html;
|
|
199
231
|
}
|
|
200
|
-
|
|
201
|
-
|
|
232
|
+
if (/<head[^>]*>/i.test(html)) {
|
|
233
|
+
return html.replace(/<head([^>]*)>/i, `<head$1><base href="${baseUrl}">`);
|
|
234
|
+
}
|
|
235
|
+
if (/<html[^>]*>/i.test(html)) {
|
|
236
|
+
return html.replace(/<html([^>]*)>/i, `<html$1><head><base href="${baseUrl}"></head>`);
|
|
202
237
|
}
|
|
238
|
+
return `<base href="${baseUrl}">${html}`;
|
|
203
239
|
}
|
|
204
240
|
/**
|
|
205
|
-
*
|
|
241
|
+
* Close the pooled browser when the service is disposed (e.g. DI.dispose() at shutdown).
|
|
242
|
+
* Callers that render one-shot (CLI, single email) should dispose so the process can exit.
|
|
206
243
|
*/
|
|
207
|
-
async
|
|
208
|
-
|
|
209
|
-
await
|
|
210
|
-
const timeout = setTimeout(() => {
|
|
211
|
-
reject(new Error('Server close timeout'));
|
|
212
|
-
}, 5000);
|
|
213
|
-
server.close((err) => {
|
|
214
|
-
clearTimeout(timeout);
|
|
215
|
-
if (err)
|
|
216
|
-
reject(err);
|
|
217
|
-
else
|
|
218
|
-
resolve();
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
catch (err) {
|
|
223
|
-
this.Log.warn(`Error closing server: ${err.message}`);
|
|
224
|
-
// Force close connections if available
|
|
225
|
-
try {
|
|
226
|
-
if ('closeAllConnections' in server) {
|
|
227
|
-
server.closeAllConnections();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
catch (forceErr) {
|
|
231
|
-
this.Log.error(`Error force closing server connections: ${forceErr.message}`);
|
|
232
|
-
}
|
|
244
|
+
async dispose() {
|
|
245
|
+
if (this._browserPool) {
|
|
246
|
+
await this._browserPool.dispose();
|
|
233
247
|
}
|
|
248
|
+
await super.dispose();
|
|
249
|
+
}
|
|
250
|
+
async render(_templateName, _model, _language) {
|
|
251
|
+
throw new exceptions_1.NotSupported('cannot render puppeteer template to string');
|
|
234
252
|
}
|
|
235
253
|
/**
|
|
236
254
|
* Add page event listeners with cleanup function
|
|
237
255
|
*/
|
|
238
256
|
addPageEventListeners(page) {
|
|
239
257
|
const listeners = {
|
|
240
|
-
console: (message) => this.Log.trace(`${message.type().
|
|
241
|
-
pageerror: (
|
|
258
|
+
console: (message) => this.Log.trace(`${message.type().slice(0, 3).toUpperCase()} ${message.text()}`),
|
|
259
|
+
pageerror: (error) => this.Log.error(error.message),
|
|
242
260
|
response: (response) => this.Log.trace(`${response.status()} ${response.url()}`),
|
|
243
|
-
requestfailed: (request) =>
|
|
261
|
+
requestfailed: (request) => {
|
|
262
|
+
const failure = request.failure();
|
|
263
|
+
this.Log.error(`${failure ? failure.errorText : 'request failed'} ${request.url()}`);
|
|
264
|
+
}
|
|
244
265
|
};
|
|
245
266
|
// Add listeners
|
|
246
267
|
page.on('console', listeners.console);
|
|
@@ -250,10 +271,10 @@ class PuppeteerRenderer extends templates_1.TemplateRenderer {
|
|
|
250
271
|
// Return cleanup function
|
|
251
272
|
return () => {
|
|
252
273
|
try {
|
|
253
|
-
page.
|
|
254
|
-
page.
|
|
255
|
-
page.
|
|
256
|
-
page.
|
|
274
|
+
page.off('console', listeners.console);
|
|
275
|
+
page.off('pageerror', listeners.pageerror);
|
|
276
|
+
page.off('response', listeners.response);
|
|
277
|
+
page.off('requestfailed', listeners.requestfailed);
|
|
257
278
|
}
|
|
258
279
|
catch (err) {
|
|
259
280
|
this.Log.warn(`Error removing page listeners: ${err.message}`);
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAAmD;AACnD,kDAAsH;AACtH,oCAAyD;AACzD,+BAA+C;AAC/C,sCAA2C;AAG3C,kCAAgC;AAEhC,+CAAuD;AACvD,uDAAqD;AACrD,uDAAgD;AAEhD,gDAA8B;AAC9B,oDAAkC;AAClC,oDAAkC;AAgClC,sEAAsE;AACtE,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAExC,uEAAuE;AACvE,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,uBAAuB;AACzB,CAAC,CAAC;AAEF,MAAsB,iBAAkB,SAAQ,4BAAgB;IAG9D;;;;OAIG;IACH,IAAc,eAAe;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,eAAoB;QAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAClF,CAAC;IAWD,yFAAyF;IACzF,IAAc,WAAW;QACvB,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,IAAI,kCAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACvG,CAAC;IAED;;;OAGG;IACH,IAAc,WAAW;QACvB,OAAO,CAAC,IAAI,CAAC,YAA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BACf,SAAG;8CAAC;AAGT;IADT,IAAA,eAAU,GAAE;8BACgB,qBAAS;4DAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Page } from 'puppeteer';
|
|
2
|
+
import { RenderPhase, RenderProgressCallback } from '@spinajs/templates';
|
|
3
|
+
/**
|
|
4
|
+
* Tracks a single puppeteer render and delivers throttled {@link IRenderProgress}
|
|
5
|
+
* snapshots to a callback. Resource counts come from the page's request lifecycle
|
|
6
|
+
* events; the percentage is phase-weighted (see {@link PHASE_BANDS}), and a
|
|
7
|
+
* heartbeat keeps it ticking during the long Loading/Rendering phases.
|
|
8
|
+
*
|
|
9
|
+
* When constructed without a callback it is entirely inert - no listeners, no
|
|
10
|
+
* timers, no allocations on the hot path - so callers can always create one.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RenderProgressReporter {
|
|
13
|
+
private readonly filePath;
|
|
14
|
+
private readonly enabled;
|
|
15
|
+
private readonly callback;
|
|
16
|
+
private readonly startedAt;
|
|
17
|
+
private phaseNow;
|
|
18
|
+
private loaded;
|
|
19
|
+
private pending;
|
|
20
|
+
private failed;
|
|
21
|
+
private lastEmitAt;
|
|
22
|
+
private lastPercent;
|
|
23
|
+
private heartbeat;
|
|
24
|
+
private page;
|
|
25
|
+
private readonly onRequest;
|
|
26
|
+
private readonly onRequestFinished;
|
|
27
|
+
private readonly onRequestFailed;
|
|
28
|
+
constructor(filePath: string, callback?: RenderProgressCallback);
|
|
29
|
+
/** Attach resource-lifecycle counters to the page. Call once, after newPage(). */
|
|
30
|
+
attach(page: Page): void;
|
|
31
|
+
/** Transition to a new phase and emit immediately (bypassing the throttle). */
|
|
32
|
+
phase(phase: RenderPhase, message?: string): void;
|
|
33
|
+
/** Stop the heartbeat and detach page listeners. Safe to call multiple times. */
|
|
34
|
+
dispose(): void;
|
|
35
|
+
private startHeartbeat;
|
|
36
|
+
private stopHeartbeat;
|
|
37
|
+
private computePercent;
|
|
38
|
+
private emit;
|
|
39
|
+
private defa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