Skip to content

Commit f94ea11

Browse files
📦 Publish Mitosis (#1658)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent af43f50 commit f94ea11

File tree

6 files changed

+70
-64
lines changed

6 files changed

+70
-64
lines changed

.changeset/clean-cobras-know.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

.changeset/polite-pugs-pull.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @builder.io/mitosis-cli
22

3+
## 0.5.25
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [af43f50]
8+
- Updated dependencies [20ad8dc]
9+
- @builder.io/mitosis@0.5.25
10+
311
## 0.5.24
412

513
### Patch Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@builder.io/mitosis-cli",
3-
"version": "0.5.24",
3+
"version": "0.5.25",
44
"description": "mitosis CLI",
55
"types": "build/types/types.d.ts",
66
"bin": {

packages/core/CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
# Change Log
22

3+
## 0.5.25
4+
5+
### Patch Changes
6+
7+
- af43f50: [All] Refactored `useMetadata` hook to enable import resolution instead of simple `JSON5` parsing.
8+
9+
You could use a normal JS `Object` and import it inside your `*.lite.tsx` file like this:
10+
11+
```ts
12+
// data.ts
13+
14+
export const myMetadata: Record<string, string | number> = {
15+
a: 'b',
16+
c: 1,
17+
};
18+
```
19+
20+
```tsx
21+
// my-button.lite.tsx
22+
import { useMetadata } from '@builder.io/mitosis';
23+
import { myMetadata } from './data.ts';
24+
25+
useMetadata({
26+
x: 'y',
27+
my: myMetadata,
28+
});
29+
30+
export default function MyButton() {
31+
return <button></button>;
32+
}
33+
```
34+
35+
- 20ad8dc: [angular]: Fix issue with events forced to become `toLowerCase()`.
36+
37+
Based on [choosing-event-names](https://angular.dev/guide/components/outputs#choosing-event-names) custom events are camelCase.
38+
[DOM events](https://www.w3schools.com/jsref/dom_obj_event.asp) are always lower-cased for Angular components.
39+
40+
Checkout [event-handlers.ts](https://github.com/BuilderIO/mitosis/blob/main/packages/core/src/helpers/event-handlers.ts) for a list of all events that are automatically lower-cased. Everything else will be treated as a custom event and therefore camelCased.
41+
42+
If you need some other event to be lower-cased you can use `useMetadata.angular.nativeEvents`:
43+
44+
```tsx
45+
import { useMetadata } from '@builder.io/mitosis';
46+
47+
useMetadata({
48+
angular: {
49+
nativeEvents: ['onNativeEvent'],
50+
},
51+
});
52+
53+
export default function MyComponent(props) {
54+
return (
55+
<div>
56+
<input onNativeEvent={(event) => console.log(event)} />
57+
Hello!
58+
</div>
59+
);
60+
}
61+
```
62+
363
## 0.5.24
464

565
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"name": "Builder.io",
2323
"url": "https://www.builder.io"
2424
},
25-
"version": "0.5.24",
25+
"version": "0.5.25",
2626
"homepage": "https://github.com/BuilderIO/mitosis",
2727
"main": "./dist/src/index.js",
2828
"exports": {

0 commit comments

Comments
 (0)