Skip to main content

Spectral 9.x Upgrade Guide

Spectral 9.x is backwards-compatible with Spectral 8.x for custom component development. You can safely bump your version of Spectral from 8.x to 9.x without changes to your custom component code.

For code-native integrations, Spectral 9.x introduces the ability to reference existing components' actions within a code-native flow. To update a code-native integration to Spectral 9.x, it may be easiest to re-initialize a code-native project, and copy your flows and config wizard code to the new project. Alternatively, initialize a new project for reference and do the following:

  • Copy .spectral/index.ts from the new project into your current project
  • Copy .npmrc from the new project into your current project
  • Update @prismatic-io/spectral in your package.json file to the latest version

A few syntax changes were made between 8.x and 9.x. Namely:

  • Flows no longer require configPage generics to infer the shape of your config variables. flow<typeof configPages>() can be changed simply to flow().
  • References to existing components' data sources, connections are now done by installing a component's manifest package into your project. See Using existing components in code-native integrations.
  • References to existing components' triggers remain the same syntactically.

Visibility of inputs on connections can now be explicitly set. For example, a reference to an existing Slack OAuth connection can now read:

export const configPages = {
Connections: configPage({
tagline: "Authenticate with Slack",
elements: {
"Slack OAuth Connection": connectionConfigVar({
stableKey: "slack-oauth-connection",
dataType: "connection",
connection: {
component: "slack",
key: "oauth2",
values: {
clientId: {
value: SLACK_CLIENT_ID,
permissionAndVisibilityType: "organization",
visibleToOrgDeployer: false,
},
clientSecret: {
value: SLACK_CLIENT_SECRET,
permissionAndVisibilityType: "organization",
visibleToOrgDeployer: false,
},
signingSecret: {
value: SLACK_SIGNING_SECRET,
permissionAndVisibilityType: "organization",
visibleToOrgDeployer: false,
},
scopes: {
value: "chat:write chat:write.public channels:read",
permissionAndVisibilityType: "organization",
visibleToOrgDeployer: false,
},
},
},
}),
},
}),
};