From aa8dab81b6fb0786b23dddc12d9671c1ae328177 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 Jan 2025 18:03:42 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20Publish=20Mitosis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/clean-cobras-know.md | 31 ----------------- .changeset/polite-pugs-pull.md | 31 ----------------- packages/cli/CHANGELOG.md | 8 +++++ packages/cli/package.json | 2 +- packages/core/CHANGELOG.md | 60 +++++++++++++++++++++++++++++++++ packages/core/package.json | 2 +- 6 files changed, 70 insertions(+), 64 deletions(-) delete mode 100644 .changeset/clean-cobras-know.md delete mode 100644 .changeset/polite-pugs-pull.md diff --git a/.changeset/clean-cobras-know.md b/.changeset/clean-cobras-know.md deleted file mode 100644 index 7e55cccc2e..0000000000 --- a/.changeset/clean-cobras-know.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -'@builder.io/mitosis': patch ---- - -[All] Refactored `useMetadata` hook to enable import resolution instead of simple `JSON5` parsing. - -You could use a normal JS `Object` and import it inside your `*.lite.tsx` file like this: - -```ts -// data.ts - -export const myMetadata: Record = { - a: 'b', - c: 1, -}; -``` - -```tsx -// my-button.lite.tsx -import { useMetadata } from '@builder.io/mitosis'; -import { myMetadata } from './data.ts'; - -useMetadata({ - x: 'y', - my: myMetadata, -}); - -export default function MyButton() { - return ; -} -``` diff --git a/.changeset/polite-pugs-pull.md b/.changeset/polite-pugs-pull.md deleted file mode 100644 index a15e74df56..0000000000 --- a/.changeset/polite-pugs-pull.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -'@builder.io/mitosis': patch ---- - -[angular]: Fix issue with events forced to become `toLowerCase()`. - -Based on [choosing-event-names](https://angular.dev/guide/components/outputs#choosing-event-names) custom events are camelCase. -[DOM events](https://www.w3schools.com/jsref/dom_obj_event.asp) are always lower-cased for Angular components. - -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. - -If you need some other event to be lower-cased you can use `useMetadata.angular.nativeEvents`: - -```tsx -import { useMetadata } from '@builder.io/mitosis'; - -useMetadata({ - angular: { - nativeEvents: ['onNativeEvent'], - }, -}); - -export default function MyComponent(props) { - return ( -
- console.log(event)} /> - Hello! -
- ); -} -``` diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index da6eac4936..4867a6e2a9 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @builder.io/mitosis-cli +## 0.5.25 + +### Patch Changes + +- Updated dependencies [af43f50] +- Updated dependencies [20ad8dc] + - @builder.io/mitosis@0.5.25 + ## 0.5.24 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 28f0cc7fd8..978cbb8e47 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@builder.io/mitosis-cli", - "version": "0.5.24", + "version": "0.5.25", "description": "mitosis CLI", "types": "build/types/types.d.ts", "bin": { diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 80cd30c496..cf92021fc5 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,65 @@ # Change Log +## 0.5.25 + +### Patch Changes + +- af43f50: [All] Refactored `useMetadata` hook to enable import resolution instead of simple `JSON5` parsing. + + You could use a normal JS `Object` and import it inside your `*.lite.tsx` file like this: + + ```ts + // data.ts + + export const myMetadata: Record = { + a: 'b', + c: 1, + }; + ``` + + ```tsx + // my-button.lite.tsx + import { useMetadata } from '@builder.io/mitosis'; + import { myMetadata } from './data.ts'; + + useMetadata({ + x: 'y', + my: myMetadata, + }); + + export default function MyButton() { + return ; + } + ``` + +- 20ad8dc: [angular]: Fix issue with events forced to become `toLowerCase()`. + + Based on [choosing-event-names](https://angular.dev/guide/components/outputs#choosing-event-names) custom events are camelCase. + [DOM events](https://www.w3schools.com/jsref/dom_obj_event.asp) are always lower-cased for Angular components. + + 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. + + If you need some other event to be lower-cased you can use `useMetadata.angular.nativeEvents`: + + ```tsx + import { useMetadata } from '@builder.io/mitosis'; + + useMetadata({ + angular: { + nativeEvents: ['onNativeEvent'], + }, + }); + + export default function MyComponent(props) { + return ( +
+ console.log(event)} /> + Hello! +
+ ); + } + ``` + ## 0.5.24 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 55f53e9ed0..36760b341d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,7 +22,7 @@ "name": "Builder.io", "url": "https://www.builder.io" }, - "version": "0.5.24", + "version": "0.5.25", "homepage": "https://github.com/BuilderIO/mitosis", "main": "./dist/src/index.js", "exports": {