Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/performance-and-stability #521

Merged
merged 7 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,13 @@ UI_ROUTE = /
OTHER_NODE_ENV = production
OTHER_LISTEN_TO_PROCESS_EXITS = true
OTHER_NO_LOGO = false
OTHER_HARD_RESET_PAGE = false

# DEBUG CONFIG
DEBUG_ENABLE = false
DEBUG_HEADLESS = false
DEBUG_DEVTOOLS = false
DEBUG_LISTEN_TO_CONSOLE = false
DEBUG_DUMPIO = false
DEBUG_SLOW_MO = 0
DEBUG_DEBUGGING_PORT = 9222
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,17 @@ The format, along with its default values, is as follows (using the recommended
"other": {
"nodeEnv": "production",
"listenToProcessExits": true,
"noLogo": false
"noLogo": false,
"hardResetPage": false
},
"debug": {
"enable": false,
"headless": true,
"devtools": false,
"listenToConsole": false,
"dumpio": false,
"slowMo": 0,
"debuggingPort": 9222
}
}
```
Expand Down Expand Up @@ -350,6 +360,16 @@ These variables are set in your environment and take precedence over options fro
- `OTHER_NODE_ENV`: The type of Node.js environment. The value controls whether to include the error's stack in a response or not. Can be development or production (defaults to `production`).
- `OTHER_LISTEN_TO_PROCESS_EXITS`: Decides whether or not to attach _process.exit_ handlers (defaults to `true`).
- `OTHER_NO_LOGO`: Skip printing the logo on a startup. Will be replaced by a simple text (defaults to `false`).
- `OTHER_HARD_RESET_PAGE`: Determines whether the page's content should be reset from scratch, including Highcharts scripts (defaults to `false`).

### Debugging Config
- `DEBUG_ENABLE`: Enables or disables debug mode for the underlying browser (defaults to `false`).
- `DEBUG_HEADLESS`: Controls the mode in which the browser is launched when in the debug mode (defaults to `true`).
- `DEBUG_DEVTOOLS`: Decides whether to enable DevTools when the browser is in a headful state (defaults to `false`).
- `DEBUG_LISTEN_TO_CONSOLE`: Decides whether to enable a listener for console messages sent from the browser (defaults to `false`).
- `DEBUG_DUMPIO`: Redirects browser process stdout and stderr to process.stdout and process.stderr (defaults to `false`).
- `DEBUG_SLOW_MO`: Slows down Puppeteer operations by the specified number of milliseconds (defaults to `0`).
- `DEBUG_DEBUGGING_PORT`: Specifies the debugging port (defaults to `9222`).

## Command Line Arguments

Expand Down Expand Up @@ -414,6 +434,14 @@ _Available options:_
- `--nodeEnv`: The type of Node.js environment (defaults to `production`).
- `--listenToProcessExits`: Decides whether or not to attach process.exit handlers (defaults to `true`).
- `--noLogo`: Skip printing the logo on a startup. Will be replaced by a simple text (defaults to `false`).
- `--hardResetPage`: Determines whether the page's content should be reset from scratch, including Highcharts scripts (defaults to `false`).
- `--enableDebug`: Enables or disables debug mode for the underlying browser (defaults to `false`).
- `--headless`: Controls the mode in which the browser is launched when in the debug mode (defaults to `true`).
- `--devtools`: Decides whether to enable DevTools when the browser is in a headful state (defaults to `false`).
- `--listenToConsole`: Decides whether to enable a listener for console messages sent from the browser (defaults to `false`).
- `--dumpio`: Redirects browser process stdout and stderr to process.stdout and process.stderr (defaults to `false`).
- `--slowMo`: Slows down Puppeteer operations by the specified number of milliseconds (defaults to `0`).
- `--debuggingPort`: Specifies the debugging port (defaults to `9222`).

# HTTP Server

Expand Down Expand Up @@ -552,7 +580,7 @@ This package supports both CommonJS and ES modules.
**highcharts-export-server module**

- `server`: The server instance which offers the following functions:
- `async startServer(serverConfig)`: The same as `startServer` describe below.
- `async startServer(serverConfig)`: The same as `startServer` described below.

- `closeServers()`: Closes all servers associated with Express app instance.

Expand Down Expand Up @@ -593,6 +621,11 @@ This package supports both CommonJS and ES modules.
- `{Object} settings`: The settings object containing export configuration.
- `{function} endCallback`: The callback function to be invoked upon finalizing work or upon error occurance of the exporting process.

- `async initPool(config)`: Initializes the export pool with the provided configuration, creating a browser instance and setting up worker resources.
- `{Object} config`: Configuration options for the export pool along with custom puppeteer arguments for the puppeteer.launch function.

- `async killPool()`: Kills all workers in the pool, destroys the pool, and closes the browser instance.

- `setOptions(userOptions, args)`: Initializes and sets the general options for the server instace, keeping the principle of the options load priority. It accepts optional userOptions and args from the CLI.
- `{Object} userOptions`: User-provided options for customization.
- `{Array} args`: Command-line arguments for additional configuration (CLI usage).
Expand Down
4 changes: 2 additions & 2 deletions dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.esm.js.map

Large diffs are not rendered by default.

Loading
Loading