Recent

Author Topic: Lazarus 3 and Pas2JS missing  (Read 5659 times)

teos

  • Full Member
  • ***
  • Posts: 161
Re: Lazarus 3 and Pas2JS missing
« Reply #15 on: January 15, 2024, 11:06:03 am »
@Pascaldragon, if you can, my posts and the responses from Thaddy are off topic, is it an idea to move this to a new thread, from where Thaddy replied so there is more info about installing Pas2JS and the little things that I stumble into?

I understand/know that if you start drawing on the canvas, the entire grid becomes an image. And maybe I shouldn't try to custom draw in the stringgrid in the first place.
On the other hand, If a stringgrid is a table or ad combination of DIV's, there is a background CSS style. And I can imagine that adding a div with styling will come close to the VCL canvas.rectangle.

krolikbest

  • Full Member
  • ***
  • Posts: 248
Re: Lazarus 3 and Pas2JS missing
« Reply #16 on: January 15, 2024, 03:07:33 pm »
Hi,
@teos, I also considered using WCL, but then switched to using html and js elements painting them on canvas. And so far I'm satisfied with this approach. The best thing is to have some guidance open with js and you go with coding :) There what I did (pure pas2js) https://www.youtube.com/watch?v=eo62_1uqN1w

teos

  • Full Member
  • ***
  • Posts: 161
Re: Lazarus 3 and Pas2JS missing
« Reply #17 on: January 15, 2024, 10:31:55 pm »
For me: I would stay as close to the VCL as possible and keep the option open to use the same controls in Windows/Linux, Web and mobile.

And as I explained, styling basic elements has all kinds of options. But I understand that on the web having a web grid with pagination is better than a dbgrid that loads all data at once..

teos

  • Full Member
  • ***
  • Posts: 161
Install with fpUpdeluxe
« Reply #18 on: January 15, 2024, 10:34:03 pm »
Hi!

Lazarus 3 was released with already built-in options to build pas2js projects but no pas2js compiler is shipped within it.
 
As it requires 2.2.1 (for projects like PWA), where can I get pre-built binaries of pas2js 2.2.1 instead of compiling it from sources?

Thank you in advance.

As Thaddy explained, if you use fpupdeluxe to install everything, you also have the current pas2js state.

teos

  • Full Member
  • ***
  • Posts: 161
Re: Lazarus 3 and Pas2JS missing
« Reply #19 on: January 16, 2024, 08:02:19 pm »
If I start a new webbrowser project, I get a form named "Pas2JS Browser project options" and an error "Simple Web Server" Wrong compileserver.exe: file not found see tools/options/environment/simple web server/simpleserver.

I have 1 compileserver.exe under fpupdeluxe and that is C:\fpcupdeluxe\fpc\bin\x86_64-win64\compileserver.exe when I select that one, I get another errror: simpleserver does not support --version, maybe this is an old version?

So I have 2 projects and 1 executable that is old. I wonder what is the correct one and why the executable is not created or updated.
c:\fpcupdeluxe\fpc\bin\x86_64-win64\compileserver.exe
c:\fpcupdeluxe\ccr\pas2js-rtl\compiler\utils\pas2js\compileserver.lpi
c:\fpcupdeluxe\fpcsrc\utils\pas2js\compileserver.lpi
c:\fpcupdeluxe\ccr\pas2js-rtl\compiler\utils\pas2js\compileserver.pp

Besides this: I guess this also has something to do with the project not starting in the browser..

I have no clue what is happening and to which project I should report this.

af0815

  • Hero Member
  • *****
  • Posts: 1356
Re: Lazarus 3 and Pas2JS missing
« Reply #20 on: January 16, 2024, 09:19:04 pm »
I get another errror: simpleserver does not support --version, maybe this is an old version?
BTW: The error now is about simpleserver not compileserver
regards
Andreas

teos

  • Full Member
  • ***
  • Posts: 161
Re: Lazarus 3 and Pas2JS missing
« Reply #21 on: January 17, 2024, 09:27:59 am »
I get another errror: simpleserver does not support --version, maybe this is an old version?
BTW: The error now is about simpleserver not compileserver

That is correct. Simpleserver is not in my installatation and I don't recognize in fpcupdeluxse what to install to get it.

kveroneau

  • Full Member
  • ***
  • Posts: 119
Re: Lazarus 3 and Pas2JS missing
« Reply #22 on: February 09, 2024, 11:00:09 pm »
Today I was thinking of putting together a YouTube video showing people how to get up and running with Lazarus and Pas2js on Windows.  I primarily use Linux, and have been using FreePascal/Lazarus and Pas2Js with little issue.  My flow for setting this up on Linux was simple, download latest fpc source distrib from freepascal.org, download latest binary for Linux amd64, and then download the latest version of the Lazarus source code.  Install the binary FPC into my home directory, extract the sources for both FPC and Lazarus, then proceed to compile Lazarus as per usual.  I've heard of fpcup and now fpcudeluxe, but felt it was perfectly fine being installed as I've been doing through the last couple years. The pas2js I grabbed was a binary distribution of it from downloads.freepascal.org, which seems to be down right now, making it incredibly difficult to download the last binary release of it.  As a result, I did some research and concluded that I should try using fpcupdeluxe to get it up and running on a Windows box for this YouTube video...  If I wasn't already into FreePascal and Lazarus and was a brand-new developer coming to FreePascal/Lazarus/pas2js, I don't think I would be having the best experience, at least when compared to competing languages and frameworks.  I'd imagine most developers new to something would visit the home pages, probably FreePascal.org first, and grab a binary download of the compiler for their operating system of choice and be off to the races learning, at first blissfully unaware that Lazarus exists.  Now, I'm not trying to hate on any design decisions here, just trying to provide some constructive feedback to hopefully bring in more interest into the language.  The first top half of the main freepascal.org website doesn't really mention the Lazarus IDE, unless there is a new "News" post about a latest release.  It does a good job at marketing it's amazing cross-platform abilities, but without Lazarus, it really only feels like half of the language, and many new users might completely miss out on it's benefits and stick with VSCode.  My main point here, is that most new developers to FreePascal are not going to get the best first experience, and if they lack the patience to get past this initial hurdle, it will only make less developers willing to even give FreePascal a chance to shine in their toolkit.  A new developer will have absolutely no idea about tools like fpcupdeluxe, as they aren't featured on the main home page as a "Featured Community Project" of sorts.  A lot of FreePascal community members have contributed a lot of projects throughout the years that directly relate to the FreePascal compiler, and otherwise make the compiler easier to use.  These days, a lot of modern developers expect a lot from a language out of the box, and having a good way to showcase that FreePascal does also have those features and demoing them on the website as other languages do might help FreePascal grow more.  Personally I think a more modernized home page, perhaps made using pas2js technology which could then also be a showcase of the potential developers can get from the language.  From what I am seeing coming out of pas2js, both open source and commercial, I have incredibly high hopes for ObjectPascal as a language in the future.  If the community can create discussions around a cool concept that is seamless in ObjectPascal but otherwise complicated in most other mainstream languages, it could spark interest in ObjectPascal.  One of the killer features I believe really stands out in ObjectPascal which is severely lacking elsewhere is the super advanced Component feature, and how easy it is to create new Lazarus components which can then be placed into a DataModule or Form.  One feature I think that really makes this sand-out more is that Lazarus provides a remarkable balance between having to write too much non-sense code, and being able to visually design components without needing any code.  A great example is a small database application, in Lazarus one can be made with almost zero lines of code, if you don't want auto-resizing and other whistles, but that's the thing, to have a fully functional database application with Lazarus, actually requires zero code, and that's incredible.  It would be cool if one could do absolutely everything with components, making it possible for almost anybody, even your grandmother to build Lazarus apps with no programming knowledge required.  I feel that the component system should be marketed a bit more.  I don't want this to turn into a contender for the world record of the longest paragraph that should have been split, so I'll finish it here.

Perhaps the maintainers of FreePascal.org could say hold a community contest of sorts where community members with either pas2js experience, or otherwise web design experience can submit how they'd envision a modern FreePascal.org home page.  It'd be great for community engagement, and might be an interesting way to see how some of us might market this remarkable language to other developers, if we had the chance to.

I know this post went a bit off track of what this original topic was about, but I'd rather look at the root cause of a problem and try to fix it from there, and I can definitely see any new developer to FreePascal.org having a bad first experience, and we should find a way to address it.  If fpcudeluxe was mentioned as a "recommended community method of installation", then that'd at least be something for new developers to get their toes wet.  As it stands, most new developers won't even know of this tool until they search or join the forums when they start to have questions, which is more "reactive" then "proactive" in my opinion.

rca

  • Jr. Member
  • **
  • Posts: 84
Re: Lazarus 3 and Pas2JS missing
« Reply #23 on: June 22, 2024, 05:48:12 pm »
I have Windows 11 64 bit, Lazarus 3.4, FPC 3.2.3 (fixes) and I am installing "pas2js-rtl" with fpcupdeluxe, but it doesn't, it shows the following message:

Code: Bash  [Select][+][-]
  1. ./fpmake.exe compile --os=win64 --cpu=x86_64 -o -dx86_64 --compiler=C:/Users/rca/Downloads/Laz34FPCfix/fpc/bin/x86_64-win64/fpc.exe -bu
  2. Start compiling package pas2js for target x86_64-win64.
  3. Warning: Source file "pas2js.pp" from package pas2js not found for x86_64-win64
  4. The installer encountered the following error:
  5. Could not compile target pas2js from package pas2js
  6.  
  7. fpcupdeluxe: ERROR: Pas2js Installer (BuildModule: pas2js-rtl): make.exe returned error code 2
  8. Details: .
  9.  
  10.  
  11. ERROR: Fpcupdeluxe fatal error !
  12. Sequencer (pas2js-rtl): Failure running fpcupdeluxe: error executing sequence pas2js-rtl
  13. Sequencer (Only): Failure running fpcupdeluxe: error executing sequence Only

I have already tried with FPC 3.2.2 and trunk, but it doesn't work either.

Furthermore, I have done it manually without fpcupdeluxe, following the instructions of:
https://gitlab.com/freepascal.org/fpc/pas2js#building-on-windows
Code: Bash  [Select][+][-]
  1. set PATH=C:\Users\rca\Downloads\Laz34FPCfix\fpc\bin\x86_64-win64;%PATH%
  2. make clean all
  3.  

But I get almost the same error..
Code: Bash  [Select][+][-]
  1. ./fpmake.exe clean --os=win64 --cpu=x86_64 -o -dx86_64 --compiler=C:/Users/rca/Downloads/Laz34FPCfix/fpc/bin/x86_64-win64/ppcx64.exe -bu
  2. Warning: Removed non empty directory "bin\x86_64-win64"
  3. ./fpmake.exe compile --os=win64 --cpu=x86_64 -o -dx86_64 --compiler=C:/Users/rca/Downloads/Laz34FPCfix/fpc/bin/x86_64-win64/ppcx64.exe -bu
  4. Start compiling package pas2js for target x86_64-win64.
  5. Warning: Source file "pas2js.pp" from package pas2js not found for x86_64-win64
  6. The installer encountered the following error:
  7. Could not compile target pas2js from package pas2js
  8. make: *** [all] Error 1

What I can do? I appreciate the help.

rca

  • Jr. Member
  • **
  • Posts: 84
Re: Lazarus 3 and Pas2JS missing
« Reply #24 on: June 29, 2024, 06:55:45 am »
I managed to correct the pas2js_rtl installation error, in case anyone has the same issue:

Reading the building pas2js section:
https://gitlab.com/freepascal.org/fpc/pas2js#building-pas2js
"The makefile expects the sources of FPC to be present under the compiler directory.
You can copy/clone the FPC sources there or set enviroment variable FPCDIR.
Note that a symlink to the FPC sources will not work, as the linker confuses some relative paths.
"

In the pas2js source code, in fpmake.pp:
Code: Pascal  [Select][+][-]
  1.   FPCSrcDir:=GetEnvironmentVariable('FPCDIR');
  2.   if FPCSrcDir<>'' then
  3.     FPCSrcDir:=IncludeTrailingPathDelimiter(ExpandFileName(FPCSrcDir));
  4.   if FPCSrcDir='' then
  5.     FPCSrcDir:=IncludeTrailingPathDelimiter(GetCurrentDir)+'compiler'+PathDelim;


So, initially in Windows manually create the FPCDIR environment variable,
in my case it is "C:/Users/rca/Downloads/Laz34FPCfix/fpcsrc" and that's it!

And then I modified the source code of fpcupdeluxe, so that it does it automatically.
I have created a pull request: https://github.com/LongDirtyAnimAlf/fpcupdeluxe/pull/696


 

TinyPortal © 2005-2018