This commit is contained in:
2022-09-23 16:43:30 +07:00
commit 9f3a623c73
48 changed files with 13494 additions and 0 deletions

32
packages/host/src/App.tsx Normal file
View File

@@ -0,0 +1,32 @@
import React, { useEffect } from 'react'
import ReactDOM from 'react-dom'
import Counter from 'remote/Counter'
import './index.css'
import { Counter as CounterComponentType } from 'shared-types'
import SvelteCounter from 'remoteSvelte/Counter'
import { StoreProvider } from 'store/store'
const CounterComp = Counter as CounterComponentType
const App = () => {
useEffect(() => {
new SvelteCounter({
target: document.getElementById('svelteApp'),
})
}, [])
return (
<div className="container">
<CounterComp initialValue={2} />
<div id={'svelteApp'}></div>
</div>
)
}
ReactDOM.render(
<StoreProvider>
<App />
</StoreProvider>,
document.getElementById('app'),
)

View File

@@ -0,0 +1,10 @@
body {
font-family: Arial, Helvetica, sans-serif;
}
.container {
font-size: 3rem;
margin: auto;
max-width: 800px;
margin-top: 20px;
}

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>host</title>
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
import("./App");
export {};

2
packages/host/src/remote.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
declare module "remote/Counter";
declare module "remoteSvelte/Counter";