System Runtime is now an ES module. You can now use the JavaScript native import API to import the library from a CDN:
<script type="module">
import runtime from 'https://cdn.jsdelivr.net/npm/system-runtime@6.0.0-beta.5/dist/system-runtime.js'
const system = runtime.system('mySystem')
// ...
</script>
You can now use the JavaScript native import API to import the library in nodeJS:
import runtime from 'system-runtime'
const system = runtime.system('mySystem')
// ...
Breaking change: we can not use require in the code. We have this breaking change because your scripts are evaluated inside System Runtime which is now an ES module.
Breaking change: we change the way we access collections with $db internal component. Example:
// before
$db.Person.find()
// now
$db.collections.Person.find()
What has been done
event
:How to test the PR
Test in HTML
Test with nodeJS
"type":"module"
in thepackage.json
),npm i system-runtime@6.0.0-beta.5
.You will have something like that in your
package.json
:system-runtime
library:TODO