Difference between revisions of "pas2js Electron Web Application"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "= Electron Web Application = Since Lazarus 2.3 and pas2js 2.2.1. =Install Electron= First you must install '''node.js'''. * Windows, MacOS: https://nodejs.org/en/download/...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 15: Line 15:
 
  npm -v
 
  npm -v
  
Create some directory and install electron into to:
+
Create some directory and install electron there:
 
  mkdir mynodejs
 
  mkdir mynodejs
 
  cd mynodejs
 
  cd mynodejs
Line 27: Line 27:
 
=Lazarus Electron Web Application=
 
=Lazarus Electron Web Application=
  
Install pas2jsdgn package. For more information see [[lazarus_pas2js_integration|here]]
+
Install pas2jsdgn package. For more information see [[lazarus_pas2js_integration|here]].
  
You get a new project type '''Electron Web Application''', which is like a ''Web Browser Application'', except this wizard creates three projects, the '''preload.lpi''', the '''render.lpi''' and '''YourApp.lpi''', and a project group. After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.
+
You get a new project type '''Electron Web Application''', which is like a ''Web Browser Application'', except this wizard creates three projects, the '''preload.lpi''', the '''render.lpi''' and '''YourApp.lpi''', and a project group.  
 +
 
 +
After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.
  
 
To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.
 
To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.
 +
[[Category:Applications created with Lazarus]]

Latest revision as of 17:57, 16 August 2022

Electron Web Application

Since Lazarus 2.3 and pas2js 2.2.1.

Install Electron

First you must install node.js.

sudo apt install nodejs npm

Check that node and npm work:

node -v
npm -v

Create some directory and install electron there:

mkdir mynodejs
cd mynodejs
npm install --save-dev electron

This should create a sub folder node_modules containing electron:

C:\Whatever\mynodejs\node_modules\electron\dist\electron.exe

Set the full path to this executable in Lazarus Tools / Options / pas2js / Electron executable

Lazarus Electron Web Application

Install pas2jsdgn package. For more information see here.

You get a new project type Electron Web Application, which is like a Web Browser Application, except this wizard creates three projects, the preload.lpi, the render.lpi and YourApp.lpi, and a project group.

After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.

To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.