ES Module Support
You can now build integrations using modern ES Module syntax. This means you can useimport ... from ...
instead of require(...)
, and use newer npm packages that support only ESM.
To start using ESM for your integration project:
- Set
"type": "module"
in yourpackage.json
- Replace
main
withexports
in yourpackage.json
zapier init
with the -m esm
flag).
Additionally, this update means it’s no longer required for every integration’s entry point to be index.js
at the root directory. Instead, the entry point can be defined in package.json
.
- For example, see the Typescript ESM example integration at this link - it no longer contains an
index.js
file at the root directory, rather the entry point is defined via"exports": "./dist/index.js"
in the integration’s package.json
Typing Improvements
We’ve improved the typing system, making the TypeScript dev experience more enjoyable. The new typing system includes:- Bundle
inputData
types is now inferred from input fields. - New helper functions to help with typing:
defineApp
,defineTrigger
,defineCreate
,defineSearch
,defineInputFields
- These are now recommended over the equivalent
satisfies Xyz
statements satisfies
is still used forperform
functions, withInferInputData
, and for other features withoutdefine
helpers. For example,export default { ... } satisfies Authentication
is still expected.
❗ No More {{curly brackets}}
Outside of Shorthand Requests
Calling z.request()
with {{bundle.*}}
or {{process.env.*}}
will now result in an error. For example:
${var}
:
{{curly backets}}
are still (and have to be) allowed in other places, including operation.lock.key
. They are also allowed (actually required) in usage of shorthand requests:
❗ Schema Changes
We have split authentication fields, input fields, and output fields into their own respective schemas, to allow for stricter schema checks and to prepare for future platform updates. Along with this, we have removed irrelevant or incompatible field types and properties from certain schemas. Note that a descriptive error will be thrown onzapier validate
if your integration attempts to use an unsupported type or property to prompt you to change it; no need to manually check these. The updated schema are as follows:
AuthenticationSchema.fields
:- The following types are no longer supported:
code
,file
,integer
,text
- The following properties are no longer supported:
altersDynamicFields
,dynamic
,meta
,primary
,search
,steadyState
- The following types are no longer supported:
BasicActionOperationSchema.inputFields
:- All types remain the same.
- The following properties are no longer supported:
primary
,steadyState
BasicActionOperationSchema.outputFields
:- The following types are no longer supported:
text
,copy
,code
- The following properties are no longer supported:
altersDynamicFields
,choices
,computed
,dynamic
,helpText
,inputFormat
,meta
,placeholder
,search
- The following types are no longer supported:
Apart from these major changes, here are the detailed release notes for this release (note that ❗ denotes a breaking change):
cli
- 🎉 ESM support added to
zapier init
command via the--module
flag - supports Minimal and Typescript templates (#976) - 🔨
zapier build
now usesesbuild
instead ofbrowserify
to detect dependencies, for a faster experience building, and to better support ESM (#946) - 🔨 Update
gulp-prettier
dependency from 4.0.0 to 5.0.0
core
- ❗ Stop replacing
{{curlies}}
unless it’s a shorthand request (#1001) - 🎉 ESM Support: Two versions of
zapierwrapper.js
, one CJS and one ESM, loaded dynamically depending on the app type (#965) - 🐛 Not every
{{curlies}}
in the request object need to be recursively replaced (#1001) - 🐛 HTTP 500 along with status codes >500 are caught in RPC client (#974)
- 🔨 Remove Bluebird library, replace with native promises (#980)
- 🔨 Refactor middleware and lambda handler logic to use async/await instead of Promise chaining (#980)
- 🔨 Trim newline and whitespaces from request headers (#1000)
schema
- ❗ Remove deprecated shouldLock property in the schema (#988)
- 🔨 FieldSchema has been split into separate schemas and renamed for clarity (#957, #998). Changes include:
- Input Fields (
PlainInputFieldSchema
andInputFieldsSchema
) - Output Fields (
PlainOutputFieldSchema
andOutputFieldsSchema
) - Authentication Fields (
AuthFieldSchema
andAuthFieldsSchema
)
- Input Fields (
- 🔨 A dedicated
BasicSearchOperationSchema
has been added (#998)
misc
- 🔨 Dependency updates - full list in the PR (#1010)