Elephize is a TypeScript-to-PHP transpiler designed for server-side rendering of React components. The current stable version is 3.1.3, while 4.0.0-alpha.13 is available as a pre-release. It transpiles a limited set of React and TypeScript constructs into PHP, targeting VKCOM's ecosystem. Key differentiators include direct PHP output for SSR, dependency on TypeScript 5.x, and a CLI tool for batch processing. However, it has sparse documentation in English and is primarily maintained for internal use.
npm install dk-elephizeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of the transpile function to convert a React component to PHP.
Install TypeScript 5.x: npm install -D typescript@^5.0.2
Use latest stable 3.x for production.
Review documentation for supported syntax before using.
Use import syntax; do not use require().
Always await or chain promises.
Run npm install @vkontakte/elephize
Use import { transpile } from '@vkontakte/elephize'Add await or use .then(result => ...)
Rewrite without spread in JSX.