github polterguy/magic v8.2.22
Significant cleanups + optimisations + clarifications

latest releases: v17.3.9, v17.3.8, v17.3.7...
3 years ago

Version 8.2.2

NOTICE - 2 BREAKING CHANGES

TL;TR - Do not update an existing website, unless you can re-crudify all
endpoints, and/or you are certain about what you're doing. If you can re-crudify
all endpoints (backend parts), you should be OK to upgrade though.

magic.signals

Implemented support for having async slot invocations be "prioritized", if a slot class
implements the ISlotAsync interface, and its async implementation can be used. This
implies that there is no longer any needs for explicitly invoking any [wait.xxx]
overrides, to have the signaler choose the async slot, since if you're already within in async
context, the async slot will be automatically preferred, and invoked automatically, instead of its
synchronous version. This should significantly simplify your Hyperlambda
code, since there are never any reasons to explicitly choose the "wait."
slot invocation. In addition, it also allows you to use the same
Hyperlambda from both a synchronous and an async context, resulting in
less "async compatibility problems".

The signaler implementation is also now significantly optimized, in such
that it doesn't create a new synchronization context as many times as it
would previously end up doing. Resulting in among other things, much
better exceptions stacktraces, and fewer synchronization contexts
being created - Resulting in more optimally performing code.

BREAKING CHANGES

Notice, this implies that if you want to upgrade an existing application to
use the new core, you'll have to do a find and replace operation through
all your Hyperlambda files/snippets, and replace every occurrency of "wait."
with "" (empty string) - Since the async slots no longer exists, and hence
invoking these will throw an exception.

magic.lambda.io

Fixed a bug when trying to copy a file, and you pass in the destination
as only a folder name. This would occur only in the async version of
the slot.

magic.lambda

Fixed bug in [add] when descendants iterator is used to traverse your
destination nodes. Previously it could trigger an exception, due to enumerator
being changed.

magic.endpoint

Completely new way to retrieve meta data, much more fault tolerant, and
less dependent upon structure of Hyperlambda file.

Magic (main)

Remove the "trash" folder entirely, and no longer creating backup
of files replaced during the setup process. This was anyways not necessary,
since if you needed these files, you could anyways find them online.
It only resulted in unnecessary complications.

Optimized how the Crudifier works, by entirely removing the dependencies
upon the dynamic CRUD slots, which you could previously find in the
mssql and mysql folders inside of the "/files/modules/system/magic.startup/"
folder. This significantly simplifies your code, and also makes it more
robust, easily maintained, and more easily changed and understood.

The above is a BREAKING CHANGE - If you have existing websites,
you should really know what you're doing if you want to update it
to use the new core. If you still want to take the chance of upgrading,
you'll have to use the "semantic SQL" slots directly now instead of the
dynamic CRUD slots.

Notice - I was never really happy with the way this used to work
to be honest, since these parts were too complex. However,
now hopefully there won't be any more breaking changes, since I'm fairly
happy with how the entirety of the core works - Including the crudification
process.

Improved the paging in the "Logs" menu item, such that it no displays
the number of relevant records - Implying that it now takes your filter
into account, as it displays the number of log items in your database.

Improved the scaffolded Angular frontend, by checking if JWT token has
expired before I set the user's roles, and if expired, the token is
deleted from local storage.

The scaffolded Angular frontend will now patch records during
updates, completely eliminating the needs for optimistic/pessimistic
database record locking, allowing multiple users to edit the same
record at the same time, without overwriting the other user's changes.

Removed the [load-app-settings] and the [save-app-settings]
slots in Release builds, due to that having these slots in production
might in theory create security issues, although no endpoints are
invoking them before checking if the user is root or not. Still, this
is defensive coding, and arguably the right thing to do. In a production
environment, you should anyways apply "appsettings.json" settings through
some kind of secret tansformations, etc - And not follow the setup
process, which is the only process that actually uses these slots today
anyways.

Fixed the counting of lines of code created during crudification, which
was previously wrong, and way too small. The crudify process will now
accurately report the number of lines of code created as it crudifies
your database.

Cleaned up a lot of the Hyperlambda in the backend, such as the Hyperlambda
responsible for creating CRUD endpoints, etc.

Don't miss a new magic release

NewReleases is sending notifications on new releases.