A Babel plugin that transforms Hydra imports into a bridge to enable server-side rendering (SSR) for Hydra components. The current stable version 6.3.2 is part of the Hylid ecosystem, released with moderate cadence. It differentiates from other SSR solutions by integrating specifically with the Hylid component model, allowing hydration of components in both client and server environments. The plugin is designed to work with Babel 7+ and is primarily used in Next.js or similar frameworks that require SSR support for Hydra-based UI. The package ships TypeScript types for enhanced developer experience.
npm install babel-plugin-hylid-bridgeVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation and configuration of the plugin in babel.config.js for a Next.js project.
Update babel.config.js: plugins: [['babel-plugin-hylid-bridge', options]] instead of plugins: [babelPluginHylidBridge(options)].
Replace 'name' with 'hydra' in options object.
Order in plugins array: add after 'next/babel' preset or after other presets that require Hydra transforms.
Add 'babel-plugin-hylid-bridge' to your Babel plugins. If not using Next.js, you need to ensure Babel is processing the files.
Ensure your import matches the configured source: import { Hydra } from 'hydra'; or adjust the 'hydra' option in plugin.Use string name: plugins: ['babel-plugin-hylid-bridge'] or call the function: plugins: [require('babel-plugin-hylid-bridge')()].