Skip to content

Commit

Permalink
chore: add useErrorBoundary example iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
RiadhAdrani committed Apr 1, 2024
1 parent 6da452e commit d461af3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,94 +6,134 @@ All notable changes to this project will be documented in this file.

## 0.5.9 - 2024-03-31

### Fixed

- fix tsconfig.

## 0.5.8 - 2024-03-31

### Fixed

- fix bad dom types export.

## 0.5.7 - 2024-03-31

### Added

- add `<ErrorBoundary/>` component to catch unexpected errors.
- add `useErrorBoundary` hook that can be used within the fallback of an `<ErrorBoundary/>` component to get `error` or attempt `recovery`.

## 0.5.6 - 2024-03-11

### Changed

- reworked typing.

## 0.5.5 - 2024-02-04

### Fixed

- bump `@riadh-adrani/dom-router` version.

## 0.5.4 - 2024-02-02

### Fixed

- export missing `getParams` from router.

## 0.5.3 - 2024-01-28

### Fixed

- bump `@riadh-adrani/domer` version.
- bump `@riadh-adrani/dom-router` version.

## 0.5.2 - 2024-01-14

### Fixed

- fixed `createDestination` throwing when used without a router.

## 0.5.1 - 2024-01-14

### Added

- `createComposable` create a global hook that can be accessed from anywhere in the tree.
- `useComposable` retrieve a named `composable`.
- `unmountApp` used to unmount the current app instance.
- `unmountRouter` used to unmount the current router instance.
- `createDestination` create a valid url using a destination request.

### Changed

- remake the framework from scratch and changed its architecture to be more expandable and dynamic.
- switched to `@riadh-adrani/domer` instead of `@riadh-adrani/dom-utils` for DOM manipulations.
- switched to `@riadh-adrani/dom-router` as the base of the routing system.
- `navigate` now accepts a second parameter `DestinationOptions`.

### Removed

- `createStore` is removed, replaced by `createComposable`.
- `batch` no longer useful during to framework architectural change.
- `replace` removed, you can set `DestinationOptions.replace` to `true` instead.

## 0.5.0 - 2023-10-03

### Removed

- removed experimental hooks `useReactive` and `usePromise`.

## 0.4.14 - 2023-09-09

### Changed

- optimized `actions` by collecting them while traversing the tree.

## 0.4.13 - 2023-09-02

### Added

- `dom:focused` attribute that will try to focus the element when created, ignored after the first render.

### Changed

- `innerHTML` to `dom:innerHTML` to indicate it's framework-specific.

### Fixed

- changing unmounted element position causes the app to crash.

## 0.4.12 - 2023-08-17

### Added

- named `<Fragment/>` component.

### Changed

- `class` attributes now accepts arrayables of `boolean`, `undefied` or `null`.

## 0.4.11 - 2023-08-13

### Fixed

- children not correctly reordered in some edge cases.
- allow the use of event modifiers without an actual function value

## 0.4.10 - 2023-08-10

### Added

- `dom:tag` to make html element tag dynamic.

### Fixed

- `<Portal/>` element not properly changing containers.

## 0.4.9 - 2023-08-04

### Added

- `innerHTML` attribute that allow direct setting of an HTMLElement innerHTML prop.
- add event modifiers like `Vue.js`, in this form `onEvent:prevent`, `onEvent:stop` or both `onEvent:prevent-stop`.

Expand All @@ -102,63 +142,83 @@ All notable changes to this project will be documented in this file.
## 0.4.7 - 2023-07-30

## 0.4.6 - 2023-07-24

### Removed

- removed all `deprecated` functions and classes.

### Fixed

- `anchor` element not working as intended

## 0.4.5 - 2023-07-19

### Added

- `name` route property, similar to `vue-router`.
- `titleTransform` handler to preprocess the title before applying it.
- `createStore` similar to `writable` store in `svelte`

### Changed

- `navigate` now accepts a number or an object for a `named` route.

### Deprecated

- `useKey` is now replaced with `createStore`.
- `Store` as it is becoming useless.

## 0.4.4 - 2023-07-06

### Added

- Add `switch`, `case` and `case:default` directives.
- Attach host `Branch` object to dom node.
- `ref` typing.

### Changed

- `useState` accepts an initilizer function, and a setter callback.
- improved project structure.
- improved typing.

## 0.4.3 - 2023-07-01

### Changed

- refactored project structure for a smaller bundle size.

## 0.4.2 - 2023-06-28

## 0.4.1 - 2023-06-28

### Added

- `else` and `else-if` directives that goes with `if` directive, similar to `vue.js`

### Changed

- improve `JSX.Element`s typing
- better `svg` elements typing

## 0.4.0 - 2023-06-25

### Added

- `if` directive which accepts a boolean to determine if a component should be rendered or not.
- `PropWithUtility` that allow the developer to initialize a prop type with optional `children`, `key` and `if` properties.
- `getPathname` returns the current url without the `base`.

### Changed

- `useReactive` uses `@riadh-adrani/utils/createReactive` to create reactive object instances.
- `mountRouter` config is now optional.
- deperecated `getRoute` in favor of `getPathname`.

## 0.3.0 - 2023-06-22

### Added

- `useContext`, same as `react.js`.
- `useReactive`, similar to `vue.js`'s `reactive`.
- `usePromise`, a hook that allows the user to fetch data while tracking the request state and return value.
Expand All @@ -171,10 +231,13 @@ All notable changes to this project will be documented in this file.
- add `<Portal/>` component, allowing to teleport elements in another DOM container.

### Fixed

- `scrollToTop` not having any effect, when a new page is loaded.

## 0.2.0 - 2023-06-02

### Added

- JSX syntax for writing expressive and reusable UI components.
- Function components for a modular and composable code structure.
- Hooks for managing state, performing side effects, and custom logic reuse: `useState`, `useEffect`, `useMemo`, `useCallback`, `useId` and `useRef`.
Expand Down
2 changes: 1 addition & 1 deletion docs/md/docs/api/useErrorBoundary/0.5.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ returns an array of two elements:

### Example

<iframe src="https://stackblitz.com/edit/ruvy-lqiij9?embed=1&file=src%2FCount.tsx&hideExplorer=1&hideNavigation=1" class="stackblitz"></iframe>
<iframe src="https://stackblitz.com/edit/ruvy-a3desu?embed=1&file=src%2Fmain.tsx&hideExplorer=1&hideNavigation=1" class="stackblitz"></iframe>
1 change: 1 addition & 0 deletions docs/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const Versions = [
'0.5.6',
'0.5.7',
'0.5.8',
'0.5.9',
] as const;

export type Version = (typeof Versions)[number];
Expand Down

0 comments on commit d461af3

Please sign in to comment.