Isomor Transpiler
raw JSON →The isomor-transpiler package (v3.0.4) is the Babel-based transpiler for isomor, a full-stack framework that automatically generates API layers between frontend and backend in a single TypeScript project. Instead of writing REST/GraphQL endpoints, isomor transpiler extracts server-side function calls from client code and creates the necessary communication stubs. This package handles the actual transpilation of .ts/.tsx files, converting decorated functions into fetch calls. It is part of the isomor ecosystem, which aims to reduce boilerplate and enforce type safety across the stack. Release cadence is irregular but maintained. Key differentiator: seamless integration with TypeScript, allowing direct imports of server functions without manual API definition.
Common errors
error Error: Cannot find module 'isomor-transpiler' ↓
error TypeError: isomor_transpiler_1.default is not a function ↓
error SyntaxError: Unexpected token 'export' ↓
Warnings
breaking Node.js >=11 required; requires ESM support. ↓
gotcha The transpiler output is designed to be used in a browser context; some Node.js specific APIs may not be polyfilled. ↓
deprecated The 'transform' function is deprecated in favor of 'transformSync' for synchronous usage. ↓
gotcha TypeScript decorators may not be fully supported; ensure @isomor decorator is used correctly. ↓
gotcha Source maps may be inaccurate if input code contains multiple imports from isomor server modules. ↓
Install
npm install isomor-transpiler yarn add isomor-transpiler pnpm add isomor-transpiler Imports
- default wrong
const transpiler = require('isomor-transpiler')correctimport transpiler from 'isomor-transpiler' - TransformOptions wrong
import { TransformOptions } from 'isomor-transpiler'correctimport type { TransformOptions } from 'isomor-transpiler' - transformSync wrong
import { transformSync } from 'isomor-transpiler'correctimport { transformSync } from 'isomor-transpiler'
Quickstart
import transpiler from 'isomor-transpiler';
import { transformSync } from '@babel/core';
const code = `
import { getUsers } from '../server/user';
// @isomor is added automatically by the transpiler
export default function MyComponent() {
getUsers().then(console.log);
}
`;
const result = transpiler.transform(code, {
filename: 'MyComponent.tsx',
sourceMaps: true
});
console.log(result.code);