[fpc-devel] First pas2js public release

Michael Van Canneyt michael at freepascal.org
Fri Dec 22 08:57:01 CET 2017

On Thu, 21 Dec 2017, Michael Schnell wrote:

> On 20.12.2017 11:36, Michael Van Canneyt wrote:
>>> (Nothing stops really the server-side-native binary (e.g. written in 
>>> Pascal)
>>> from sending a pas2js transpiled program to the browser as a part of 
>>> a 'html page'/script,
>> You could do so.
>> But I don't think you should.
> How else should the Java Script code reach the browser ?

You just place it on the server as a file, so the HTTP server (Apache,
NginX, IIS) sends it.

The server side native binary doesn't need to provide it. But this could be
done. In fact, there is a demo that does this: the server program is a HTTP
server which has the compiler built-in, and using 3 special URLS you can
request a recompile (hotreload). It can even watch the project directory on
the server and automatically recompile. The browser polls for updates and
when an  update is available, reloads the page.

A classical mechanism when doing web development in react, angular or vue,
now also available in FPC.

But next week I will properly document this in the wiki.


More information about the fpc-devel mailing list