create-oc 1.1.35 → 1.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -7
- package/package.json +2 -2
- package/templates/esm.remix/package.json +1 -2
- package/templates/esm.remix/src/App.tsx +9 -5
- package/templates/esm.remix/src/entry.client.tsx +2 -2
- package/templates/esm.remix/tsconfig.json +1 -1
- package/templates/esm.remix/vite.config.ts +1 -1
- package/templates/vue/package.json +1 -1
package/index.js
CHANGED
|
@@ -25,7 +25,8 @@ function createOcJson(cwd, importmap) {
|
|
|
25
25
|
if (!oc.$schema) {
|
|
26
26
|
oc.$schema = 'https://opencomponents.github.io/schema.json';
|
|
27
27
|
}
|
|
28
|
-
oc.
|
|
28
|
+
oc.development = {};
|
|
29
|
+
oc.development.importmap = oc.importmap?.imports
|
|
29
30
|
? {
|
|
30
31
|
imports: {
|
|
31
32
|
...oc.importmap.imports,
|
|
@@ -167,12 +168,8 @@ const imports = (() => {
|
|
|
167
168
|
};
|
|
168
169
|
case 'esm.remix':
|
|
169
170
|
return {
|
|
170
|
-
'@remix-run/
|
|
171
|
-
|
|
172
|
-
'@remix-run/events':
|
|
173
|
-
'https://esm.sh/@remix-run/events@0.0.0-experimental-remix-jam.5',
|
|
174
|
-
'@remix-run/events/':
|
|
175
|
-
'https://esm.sh/@remix-run/events@0.0.0-experimental-remix-jam.5/',
|
|
171
|
+
'@remix-run/component': 'https://esm.sh/@remix-run/component@0.5.0',
|
|
172
|
+
'@remix-run/component/': 'https://esm.sh/@remix-run/component@0.5.0/',
|
|
176
173
|
};
|
|
177
174
|
default:
|
|
178
175
|
return undefined;
|
package/package.json
CHANGED
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@remix-run/
|
|
26
|
-
"@remix-run/events": "^0.0.0-experimental-remix-jam.5",
|
|
25
|
+
"@remix-run/component": "^0.5.0",
|
|
27
26
|
"happy-dom": "^18.0.1",
|
|
28
27
|
"oc-server": "^4.0.2",
|
|
29
28
|
"oc-template-esm-compiler": "^4.0.1",
|
|
@@ -3,14 +3,13 @@ import {
|
|
|
3
3
|
type ActionOutput,
|
|
4
4
|
getInitialData,
|
|
5
5
|
} from 'oc-server/client';
|
|
6
|
-
import type
|
|
7
|
-
import { press } from '@remix-run/events/press';
|
|
6
|
+
import { on, type Handle } from '@remix-run/component';
|
|
8
7
|
import styles from './styles.module.css';
|
|
9
8
|
import logo from '../public/logo.png';
|
|
10
9
|
|
|
11
10
|
type AdditionalData = ActionOutput<'funFact'>;
|
|
12
11
|
|
|
13
|
-
export default function App(
|
|
12
|
+
export default function App(handle: Handle) {
|
|
14
13
|
const { firstName, lastName, born, hobbies } = getInitialData();
|
|
15
14
|
let additionalData: AdditionalData | null = null;
|
|
16
15
|
let error = '';
|
|
@@ -23,7 +22,7 @@ export default function App(this: Remix.Handle) {
|
|
|
23
22
|
} catch (err) {
|
|
24
23
|
error = String(err);
|
|
25
24
|
} finally {
|
|
26
|
-
|
|
25
|
+
handle.update();
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
|
|
@@ -45,7 +44,12 @@ export default function App(this: Remix.Handle) {
|
|
|
45
44
|
</div>
|
|
46
45
|
</div>
|
|
47
46
|
{additionalData && <div>{additionalData.funFact}</div>}
|
|
48
|
-
<button
|
|
47
|
+
<button
|
|
48
|
+
className={styles.button}
|
|
49
|
+
on={{
|
|
50
|
+
click: getFunFact,
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
49
53
|
Fun year fact
|
|
50
54
|
</button>
|
|
51
55
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent } from 'oc-template-esm-compiler/renderer';
|
|
2
|
-
import { createRoot } from '@remix-run/
|
|
2
|
+
import { createRoot } from '@remix-run/component';
|
|
3
3
|
import App from './App';
|
|
4
4
|
|
|
5
5
|
export default createComponent(() => {
|
|
@@ -11,7 +11,7 @@ export default createComponent(() => {
|
|
|
11
11
|
root.render(<App />);
|
|
12
12
|
},
|
|
13
13
|
unmount() {
|
|
14
|
-
root?.
|
|
14
|
+
root?.dispose();
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
});
|