Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/21/19 in all areas

  1. https://tondrej.blogspot.com/2019/01/node-modules-with-delphi-and-free-pascal.html chakracore-delphi now comes with NodeSample, a new sample console application showing (as of now very limited) support for Node modules. Included are: - commonmark - graphql - json-query - lodash - moment The sample only shows how Node modules can be resolved and used in Delphi and Free Pascal applications. It doesn't implement Node's event loop or any of its internal modules or native bindings like path, fs or http; any scripts referencing them will - for now - raise an exception. Screencast (YouTube)
  2. Hi, I'm in the process of modernizing my application's installation procedure and I'm wondering if there is any official and up-to-date documentation about best practices for installers on recent versions of Windows ? For example, it looks like "My Documents" should never be used to place sample per-user data (as it is sometimes disabled by system administrators) but replaced by "AppData\Roaming". But do I still need administrator's privileges to install the application in "Program Files" or is it not considered best practice anymore ? I admit that I created the installer a long time ago (Windows XP era) and didn't proceed to any major update since then. Any recommendation would be greatly appreciated. Best regards, John.
  3. Ondrej Kelle

    Node modules with Delphi and Free Pascal

    ChakraCore is a Javascript (and WebAssembly) engine, comparable to Google's V8, Mozilla's SpiderMonkey or other similar implementations. Node.js is much more - a runtime host environment (native executable for the target platform) embedding V8, it implements some (native code) services and exposes them to the engine through an API. For example, you can instantiate a simple web server from Javascript run by Node as described here. There's also Node.js on ChakraCore, a fork of Node, using ChakraCore instead of V8 (by providing a V8 API shim layer and delegating to the ChakraCore engine). Node comes with a huge online ecosystem of Javascript modules and a package manager (npm) to manage the dependencies. Node modules can reuse other modules through an established ("require") method - you could think of it as Node's runtime equivalent of Delphi's "uses" clause in Javascript. My example shows a way to implement this "require" mechanism in a Delphi or Free Pascal host application, reading npm's "package.json" files where the module metadata is declared and resolving the "require" clauses to full-path file names so they can be loaded and evaluated at runtime with ChakraCore. It doesn't provide any of Node's extra services, so modules relying on them won't work. For example, an attempt to call require('http'); from a script will raise an exception since my host application doesn't provide the "http" module and the implementation of its API (which could be done with some extra work, e.g. using Indy). A hint on how one might provide those services to the engine can be found in the NodeProcess unit which is an incomplete stub implementation of the 'process' module (I just wanted to satisfy graphql for the demo).
  4. Now added to Quality Portal that you cannot Notarize a Delphi MacOSX app. I found there is actually another problem too. Please vote for it: https://quality.embarcadero.com/browse/RSP-23368
  5. Dalija Prasnikar

    What shows when opening a project?

    Eh... I completely forgot you can turn that off
  6. PeterBelow

    Maintaining For loop(s)

    Instead of Projects: TArray<TProject> use a list class: type TProjectList = class(TList<TProject>) end; Add public methods to the class that implement your current for loops. This way you have all this code centralized in one place, which should massively simplify the maintenance. And while you're at it: convert the record into a class. Lists of records are a bit inefficient since accessing the items in the list involves a lot of copying of data. You can then use a TObjectlist<TProject> as base class for your TProjectlist and let the list manage the memory of the TProject objects you add to it (OwnsObjects parameter for the list constructor set to true, which is the default).
  7. Lars Fosdal

    Amazing support at TMS

    I love how responsive TMS are as a company, but I wish they did more regression tests on the TAdvStringGrid.
×