Milestone v4.0.0 was closed with 31 issues.
What’s new
API: os.execCommand
- Renamed
shouldRunInBackground
option tobackground
. - Supports
stdIn
as an optional input. - Returns multiple values:
stdOut
,stdErr
,pid
, andexitCode
.
Core: API extensions
- Config file supports new
extensions
array globally or in a specific mode. - Neutralino spawns extension processes based on
extensions
array. - Neutralino doesn’t send kill signals to extension processes. The extension developer needs to stop
processes properly. extension
setting has 4 fields:id
,command
,commandLinux
,commandDarwin
, andcommandWindows
.- The
command
‘s (platform-specific command’s) value accepts${NL_PATH}
global variable. - Each extension process instance is called with three CLI args:
--nl-port={}
,--nl-extension-id={}
and--nl-token={}
- Enable/disable extensions with
enableExtensions
config.
Core: Static server
- Supports setting document root (with
documentRoot
) via config. Now, it’s possible to launch the app without a subdirectory in the URL.
Core: Community driver processes
Now developers can use Neutralinojs as a part of their software with any programming language by spawning Neutralinojs as a child process.
Use exportAuthInfo
to write auth details to ${NL_PATH}/.tmp/auth_info.json
. Then the parent process can pick up access details there. Note that WebSocket communication needs to be initiated via extensions API/loader.
API: app.broadcast
- Sends an event to all app clients. This method is for extension developers.
API: events.broadcast
- Sends an event to all clients (apps and extensions). Useful for notifying important general events.
API: extensions
dispatch
: Sends an event to a specific extension.broadcast
: Sends an event to all connected extensions. Useful for sending shutdown signals.getStats
: Returns details about loaded extensions and connected extensions.
API: updater
checkForUpdates
: Send a request to a seed URL (JSON) and fetch update details.install
: Install updates based on the currently downloaded manifest.
Events
appClientConnect
andappClientDisconnect
: Occurs when a new app instance is launched and closed respectively.extClientConnect
andextClientDisconnect
: Occurs when a new extension is connected and disconnected respectively.extensionReady
can be used to implement immediate extension calls. This is implemented from the client-side withextensions.getStats
andextClientConnect
. This event gurantees that it will be triggered regardless of the extension’s start time.
Error codes
NE_EX_EXTNOTC
: Thrown byextensions.dispatch
if the target extension is not connected.NE_UP_CUPDMER
: Thrown byupdater.checkForUpdates
if the JSON update manifest is invalid or applicationId is not matching.NE_UP_CUPDERR
: Thrown byupdater.checkForUpdates
if the updater API cannot fetch the manifest.NE_UP_UPDNOUF
: Thrown byupdater.install
when the update manifest is not loaded.NE_UP_UPDINER
: Thrown byupdater.install
for update installation errors.
Bug fixes
- Fix port 0 issue with modes. Earlier, if the developer sets port as 0 from a specific mode,
theNL_PORT
also becomes 0. - Fix an issue with
writeToLogFile
config option. Earlier, the log file was created even this
option is set tofalse
.
Global variables
NL_APPVERSION
: Value of theversion
key in the config file.
Get started: https://neutralino.js.org/docs
More Stories like this
GitHub – droppyjs/droppy: Self-hosted file storage
Jest VSCode Extension | How to code Tutorial.
Import SVGs as React Components | How to code Tutorial