Jump to content

Invalid JavaScript code generated for nested record copy


Recommended Posts

Hello,

Just to discuss about https://smartmobilestudio.zendesk.com/hc/en-us/requests/84issue.

Using latest Smart Mobile Studio 2.1 (beta-3):

If I define the following record type:

type
TTestNestedRecord = record
  H1: integer;
  H2: string;
  H3: record
    H3a: boolean;
    H3b: TSQLRawBlob;
  end;
end;

when I want to copy the record:

var rec1,rec2: TTestNestedRecord;
rec2 := rec1;

then the browser complain about a missing copy function.

In fact, there is no function generated by the compiler to copy the 
nested rec2.H3 := rec1.H3.


This is very annoying to have such a basic language feature not 
working...
I would have to switch from record to classes for our mORMot SOA client, and it 
is really disappointing.

Link to post
Share on other sites

I confirm that the just release 2.1 revision fixed the issue.

 

I'm now able to work with records and nested records transmitted as JSON from a mORMot server!

 

From my point of view, SMS client generation for mORMot is working as expected.

You can now from any Smart application:

- Have a secure RESTful ORM access to a remote mORMot server;

- Execute interface-based services from a remote mORMot server.

 

The mORMot server is able to generate code wrappers for Smart.

No need to add a plug-in in Smart: the units are generated from the mORMot server, using a Mustache template (there are templates for Smart, Win32/Win64 Delphi, and CrossPlatform Delphi clients, including OSX / iOS / Android via FMX/NextGen, and the FreePascalCompiler).

 

Note that I was able to share a lot of code between Smart, Delphi and FPC.

As such, the RESTful ORM and SOA classes and methods are the same among all platforms.

Then the units are generated from templates.

The Smart part is 100% object pascal: there is no external JavaScript library needed (as with RemObjects or DataSnap).

 

I'm finishing the documentation.

Some blog articles are to come.

Stay tuned!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...