Skip to main content
Build WebAssembly plugins using TypeScript. Noorle uses ComponentizeJS to compile TypeScript to WASI Preview 2 WebAssembly.

Setup

Install Tools

Project Structure

Define Tools

Export functions as plugin tools.

Simple Functions

Complex Types

Type Definitions

Define reusable types:

Working with Dependencies

Add Dependencies

Edit package.json:

Install and Build

Size Optimization

Choose lightweight dependencies:

File I/O

Access filesystem via standard APIs.

Configure Permissions

In noorle.yaml:

Environment Variables

Access configuration via environment variables.
Configure in .env:

Network Access

Make HTTP requests to allowed hosts.
Or use a library like axios (add to package.json):
Configure network permissions:

Error Handling

Return errors gracefully with typed results:

Testing

Test locally before uploading.

Unit Tests

Run tests:

Integration Tests

Building and Deploying

Build

Upload

Best Practices

Input Validation

Logging

Documentation

Example: Complete Plugin

Troubleshooting

Build fails with type errors:
Plugin too large (>5MB):
  • Review node_modules size
  • Remove unused dependencies
  • Use tree-shaking compatible libraries
Runtime errors with environment variables:
  • Verify .env file is created
  • Check noorle.yaml environment permissions
  • Ensure variable names are exact match

Next Steps