Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QBJS Offline Development?
#1
I think it's great that you can do online development, but what about offline QBJS?

In the event that something should happen (and heaven forbid, the code for it goes away or there is a problem with the QB64 politics), is there a way for us to download a QBJS compiler package and develop with it offline? Can we use this offline to develop and make changes so that when we run and upload the javascript, it will be ready to run?

This would not only solve for if we needed to maintain it to upload/host it somewhere, but more crucially, if we ever needed to compile it to Javascript, this would be a must.

Because if not, all of the great code and work done for QBJS would be lost, and then we would only have the compiled javascript versions as-is or the QB64 code. If we ever needed to change, update, or recompile them, I fear this would be lost.

Can we make a version of QB64 that is for Javascript but with the option of offline development and compiling javascript offline for such a situation?
Reply
#2
Hi @JamesAlexander,

Yes, you can run a local version of QBJS. Just do the following:

1) Download the zip from the latest release: https://github.com/boxgaming/qbjs/releases/latest
2) Unzip it to your preferred location
3) Open the index.html in a browser

You can run much of the functionality with this simple approach.  For the full functionality you will need to run a local webserver.  For convenience, there is a simple one included in the project.  Just compile the webserver.bas in the tools directory (with QB64).  Then from a command line, run the following command from the directory where you unzipped the project:

c:\users\dbox\qbjs> tools\webserver.exe 8888

Then you can open up a new browser to the local URL: http://localhost:8888/index.html

Now you've got the whole app running on your desktop.

(There has also been some preliminary work by @grymmjack to create a version of QBJS which can run inside VSCode as an alternative to the method I described above.  It has been discussed here in another thread.)

For clarity... QBJS is a separate, open source project, independent from QB64(PE).  The source is available to anyone on github.
Reply
#3
Thank you!  Smile

One final note:

Do you intend for this to be a future-integrated project to where it is absorbed by QB64 and you can simply check-mark a compiler version box?

( (i.e: Compile to JS) and transparently compile the native javascript as an HTML+JS source to the output directory)

or will this continue to be a standalone project so that if you need to fork it and make changes to it as necessary you can?

I see how this could be used in either way.
Reply
#4
That's an interesting question.  What is QBJS today started as an extension to the GX game engine that I'm working on.  Essentially, I wanted to be able to take games made in QB64 and compile them for the web.  (The web IDE grew out of the nerdy idea of having the qb2js compiler compile itself to JS so it could run in the browser.)

I intend for the compiler (qb2js.bas) to always be separate from the IDE.  It can be run from the command line today and could certainly be invoked from within the QB64 IDE.  It's inclusion in this manner would be a question for the QB64 devs.

I will say that, while it's come a long way and you can run a lot of QB64 programs in QBJS today, there is still quite a way to go to yet to achieve the goal level of compatibility with QBasic/QB64. And there are going to be some areas where, due to the nature of the web and JS, that 100% compatibility is just not feasible.  So there would have to be that understanding that not all features will be available for "compile to web".

I do see it as continuing as a separate project as there are a lot of possibilities for future functionality specific to QBJS.
Reply
#5
(11-22-2023, 10:58 PM)dbox Wrote: (There has also been some preliminary work by @grymmjack to create a version of QBJS which can run inside VSCode as an alternative to the method I described above.  It has been discussed here in another thread.)

This is really easy to get working @JamesAlexander and I'm happy to share what I've done with you if you are interested.

It uses the vscode tasks system, and a few extensions. Very easy to use. If you are interested in this, I can share the work.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#6
Thank you! I would like to see it! Message sent. Arrow
Reply




Users browsing this thread: 2 Guest(s)