SDK 4.0.0 #22
Replies: 4 comments 17 replies
-
😮 |
Beta Was this translation helpful? Give feedback.
-
Great job team!! Will give this a go over the coming days and let you know if any issues. Really looking forward to the continued evolution of this. Devs have been wanting this capability for years on the platform. The biggest limitations I can see in this initial release is no SSR(but that was to be expected) and being limited to hash routing. APIs like Tanstack router for the combination of route loading, cacheing, and file based routing are super convenient. But hopefully this is something that can be figured out in future updates. Then if we can get to point where we can support Server Side Rendering and use next.js etc the sky is the limit! Awesome work :) |
Beta Was this translation helpful? Give feedback.
-
The new version is awesome! Hopefully team will add hot reloading for the React page or something like "npm run dev", that will improve DX so much. |
Beta Was this translation helpful? Give feedback.
-
I've had a go at building my own template which includes everything I personally would use when creating a react app. If anyone wants to give it a go and has any feedback would love to hear it. Hopefully the instructions are clear, for me I done this via terminal/VS Code rather than ServiceNow IDE |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🔥 4.0.0 is here! 🔥
The latest release of the
@servicenow/sdk
just dropped on npm, and it’s a big one.Internally, we’ve completely overhauled our plugin framework to make APIs more reliable, and way faster to ship. Translation? You’ll be seeing more APIs, more often 🚀.
But the real star of the show:
Check out the release notes below, kick the tires, and drop your thoughts on the discussion board. We can’t wait to see what you build with 4.0.0 🙌.
New Fluent APIs
Some new Fluent APIs have been added to make working with certain types of tables easier using the SDK.
Command changes
There are some minor command changes to
now-sdk
and they can be viewed using--help
option for more information.Added
clean
commandThe clean command will clean out the build output directory, typically dist folder. This is automatically performed as part of the build command, but if you have any other needs to clean out the folder you can use this command.
Added
pack
commandThe pack command will package up the output of a build into an installable archive file. pack is automatically performed as part of the install command. Pack used to be run at the end of build but this was removed since installalso performs pack
Added
download
commandThe download command can be used for downloading complete or incremental metadata from the instance for the application.
Front-end framework support
The SDK now supports building front-end applications with standard frameworks to run on ServiceNow! For this first release, we are natively supporting React out of the box, and in the future, we are aiming to support a "bring your own front end" (BYOF) approach. This new feature will let you use a more modern development experience for building UI applications.
To get started building front ends, simply choose a template with included front-end framework support such as
now-sdk + fullstack React
when runninginit
to get started!This is just the beginning of the BYOF support we are adding to the SDK and we will be following up soon with more support for providing your own bundler and tooling for other frameworks like Svelte, Vue, etc...
How does it work?
Front-end applications utilize the
UiPage
Fluent API for bundling and hosting the application and its entry point. The SDK detects importing from an .html page that is being assigned to the html attribute onUiPage
Fluent API and bundles your front end into static assets served with your application.By default, the front-end application code lives in your
src/client
directory (configurable in now.config.json with the clientDir property). Add all your images, style sheets, fonts, etc. here the same way you would for any typical React application that you're building. The out of the box bundler we have included is Rollup to package up the your front end application.Example with React:
In the
src/client
folder create anindex.html
page like this:In the
src/client/*
folder add amain.tsx
file with your React code, CSS, and other assets to build your applicationWhen you are ready, just build and install then open the UI Page on the instance to view your application!
Limitations:
com.glide.attachment.max_size
system property(rel="preload")
(rel="stylesheet")
. Import your style sheets into code instead (import "path/to/style-sheet"
)@import
in CSS isn't supportedAPI Changes
List
API deprecates $id property as it is a coalescing table and uses combination of name, view, sys_domain, element, relationship, and parent properties. The property will not produce build errors but be marked as deprecated.Role
API deprecates $id property as it is a coalescing table and uses the name property to generate its key. The property will not produce build errors but will be marked as deprecated.ClientScript
API will no longer produce script fields with tagged template literalsscript tag during generation by default. Syntax highlighting for these tags were removed back in 3.0 in favor of Now.include functionality. The tags will not produce build errors, and they do not alter functionality.Breaking Changes
Record
API instead if that's a possibility.For example, you could specify a field called
x_customfield
on an API likeRole
in version 3.0 and prior and that field would be automatically added to the build output.Documentation
https://www.servicenow.com/docs/bundle/zurich-application-development/page/build/servicenow-sdk/concept/servicenow-sdk-landing.html
Support and Issues
This discussion was created from the release SDK 4.0.0.
Beta Was this translation helpful? Give feedback.
All reactions