🍏 iOS / Mac OSApple M6-Chip: erste Benchmark-tests sind da(15.09.2026 um 22:27 Uhr)
🕵️ SicherheitslückenCVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition(15.09.2026 um 21:40 Uhr)
🍏 iOS / Mac OSApple M6-Chip: erste Benchmark-tests sind da(15.09.2026 um 22:27 Uhr)
🕵️ SicherheitslückenCVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition(15.09.2026 um 21:40 Uhr)

🔧 Programmierung 🕛 vor 2 Jahren 7 Min Lesezeit
0

Mitosis - Using Astro.js as the dev server to preview the component with hot-reload

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

  1. What is Mitosis

  2. Astro.js as the dev server


  3. Steps


    • Set up Mitosis


    • Set up Astro.js in /test-app


      • Framework integrations

      • Astro.js folder structure



    • Update the build script

    • (Bonus) .gitignore

    • (Bonus) Settings of Publishing to NPM





to jump start the development. I built a , , components.







What is Mitosis



In case you are new to , .



Its syntax is pretty similar to and open .




Note: Astro supports a variety of popular frameworks including , , and and .




cli guide with the following modifications.




  • We aren't initializing test-apps for each framework. Instead, we would run one test-app with Astro.js for all frameworks.

  • In terms of NPM package, we aren't scoping the component under a namespace and output various packages like @my-awesome-component/library-react and @my-awesome-component/library-svelte etc. Instead, we publish all components in one package only my-awesome-component. The output components can then be imported like my-awesome-component/react and my-awesome-component/svelte etc



The folder structure should look like this by the end of this step.




CODE
.
├── src/
│ └── MyAwesomeComponent.lite.tsx
├── mitosis.config.cjs
├── package.json
└── tsconfig.json






Without further ado, let's initiate an empty project.




CODE
mkdir my-awesome-component
cd ./my-awesome-component
npm init -y






Install the relevant packages




CODE
npm i @builder.io/eslint-plugin-mitosis @builder.io/mitosis @builder.io/mitosis-cli
npm i watch --save-dev






Setup mitosis.config.cjs. In the targets field, place all downstream frameworks to compile.




CODE
/**
* @type {import('@builder.io/mitosis').MitosisConfig}
*/

module.exports = {
files: 'src/**',
targets: ['react', 'svelte', 'solid', 'vue'],
dest: 'output',
commonOptions: {
typescript: true,
},
options: {
react: {
stylesType: 'style-tag',
},
svelte: {},
qwik: {},
},
};






Setup tsconfig.json




CODE
{
"compilerOptions": {
"target": "ESNext",
"strict": true,
"jsx": "preserve",
"noImplicitAny": false,
"moduleResolution": "node",
"jsxImportSource": "@builder.io/mitosis"
},
"include": ["src"]
}






Initialize src/MyAwesomeComponent.lite.tsx




CODE
import { useState } from "@builder.io/mitosis";

export default function MyComponent(props) {
const [name, setName] = useState("Steve");

return (
<div>
<input
css={{
color: "red",
}}
value={name}
onChange={(event) => setName(event.target.value)}
/>
Hello! I can run natively in React, Vue, Svelte, Qwik, and many more frameworks!
</div>
);
}









2. Set up Astro.js in /test-app



The folder structure should look like this by the end of this step. We will focus on test-app




CODE
.
├── src/
│ └── MyAwesomeComponent.lite.tsx
├── test-app/
│ └── astro.config.mjs
├── mitosis.config.js
├── package.json
└── tsconfig.json






Create astro project with the following config




CODE
npm create astro@latest









CODE
# Where should we create your new project?
./test-app

# How would you like to start your new project?
Empty

# Do you plan to write TypeScript?
Yes

# How strict should TypeScript be?
Strict

# Install dependencies?
Yes

# Initialize a new git repository?
No






Cd into the directory




CODE
cd test-app









2.1. Framework integrations



Follow the , and 😉

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
RoboGators, HBOMAX, Microsoft, DAS, Horsebot 3000, Aaran Leyland does AI, and More - SWN #616
1 Quelle
Trust at the Speed of Business: Why ISO 27001, SOC 2, TISAX, and CMMC are Growth Strategies, Not Compliance Projects
1 Quelle
U.S. CISA adds Cisco Secure Email Gateway flaw to its Known Exploited Vulnerabilities catalog
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Mitosis - Using Astro.js as the dev server to preview the component with hot-reload

Thematisch verwandte Begriffe: Mitosis, Using, Astrojs, server · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...