JavaScript schemas
Sometimes… something comes along… that’s so fantastic… not even an Owen Wilson “Wow” can capture its magnitude. We are so excited to announce the preview release of JavaScript Schemas 🎉
Tenants with this feature enabled will now see the option to choose either JSON or JavaScript format when creating a new schema.
So, why is this exciting? As you already know, the schemas in Enterspeed are all about transformation.
We take our existing data from our data sources (CMS, PIM, etc.) and build schemas that generate the views we use in the front end.
Sometimes all that is needed is a simple one-to-one mapping. But other times, we need some custom logic to either format the data correctly or return the correct data to a specific user.
This is where we experienced a limitation with JSON schemas. JSON is fantastic for representing and structuring data. However, all custom logic could only be done using Enterspeeds own built-in methods.
This is fine for some of the most common cases, but as the logic and use cases got more complex, so did the job of developing and maintaining these methods.
That is why we decided to give the power back to the developer by providing them with a familiar and versatile language – the one and only JavaScript.
Ensuring all routes were presented in lowercase is now as simple as appending the URL with toLowerCase().
An array can now easily be mapped using the good, old, familiar map() function.References can now be done without doing lookups first:And, of course, returning the correct conditional data can now be done using ternary operators, nullish coalescing operators, etc.Curious to see more? Check out this video of our Senior Software Engineer, Jesper Weber, testing out JavaScript Schemas.
What’s next?
Our goal for the preview release is to achieve feature parity with JSON Schemas.
However, we also have a list of enhancements planned. One particularly exciting addition is the support for shared JavaScript modules, including third-party NPM packages and custom modules.
We are also focusing on improving the overall developer experience, aiming to make JavaScript Schemas as user-friendly as other IDEs like VS Code.
Lastly, it's important to note that the preview release does not currently support Algolia and webhook destinations, which are still under development.
How do I get it?
Want to test it out? Reach out on your usual support Slack channel or write to us at support@enterspeed.com to request access to the preview.
We can't wait to see what you can build with JavaScript Schemas.
We hope you want to try out the new JavaScript Schemas, and we'll be grateful if you'll try your use case and provide your feedback.
Please note that this is a preview release; we do not recommend using this for production tenants. We might make changes based on your feedback!
We expect to roll out general availability later in the summer.