New language features
New features our out in the version 0.2.4
!
New formatting
Use the improved SSJS formatter. It can now also be used for AMPscript! The extension now also contains settings for AMPscript setup.
Library templating
The other new feature lets you easily include other file in your project into the script. So, if you want to share a piece of code - let’s call it a… library. ;)
But how?
- put your piece of code into a new file:
// file: ./myLib.js
function helloWorld() {
Write("Hello World!");
}
Now, set a new templating token in the .vscode/ssjs-setup.json
. It needs to reference your file using the: file://./path/to/file
syntax.
{
//...
"dev-tokens": {
"IS_PROD": false,
"MY_LIB": "file://./myLib.js"
},
//...
}
Let’s include the library in your script file, like:
<script runat="server">
Platform.Load("1.1.1");
{{MY_LIB}}
helloWorld();
</script>
And run as usual! No changes there!
But you might be asking, how about deploying to production? I’ve got you covered with a new command in the toolset: SSJS: Deploy to Production
. At the moment, it gives you compiled code to Clipboard, but more advanced deployment is coming soon!
Something more?
Yes! Preferences of the SSJS Manager are now organized in a more logical way. also, the validity of SFMC Credentials is validated on the extension startup!
And of course, some of those pesky bugs are fixed!