Skip to content

Releases: atomicojs/atomico

atomico@1.79.2 🔧 - fixes types and context synchronization in case of edges

24 Apr 05:01
Compare
Choose a tag to compare
  1. Fix first argument to useState at type level, example:
// BEFORE
const [state, setState] = useState<string>(()=>"welcome"); // ❌Typescript announces error
// BEFORE
const [state, setState] = useState<string>(()=>"welcome"); // ✅Typescript announces success
  1. Context synchronization

While version 1.79 fixed cases where HTML-based synchronization is privileged, this fix fixes synchronization when using JSX, avoiding 2 renders when connecting to contexts 💪, example:

<MyParent>
    <MyContext>
       <MyChild/>
    </MyContext>
</MyParent>

Using JSX/TSX has better performance when synchronizing contexts,thanks to the fact that MyChild will be receiving the status at the time of mount.

atomico@1.79.1

19 Apr 03:15
Compare
Choose a tag to compare

This version applies fixes to improve component unmounting when using useSuspense and code reductions for the context API.

  1. Internal fixes for the context API, reducing the code and logic.
  2. Internal fixes for the suspense API, properly cleaning up the state upon unmounting.

Say hello to atomico@1.79 🎉🚀

18 Apr 03:04
Compare
Choose a tag to compare

This version has 2 core changes:

  1. Improvements in the context API to achieve state synchronization in extreme and collaborative cases (When using Atomico within other libraries like React, Vue or Angular).
  2. Enhancements in the suspense API, now allowing to properly observe and clean up promises resolved in nested components.

Fix : type declarations for refactor to context api

02 Apr 00:22
Compare
Choose a tag to compare

fix: TS, fix GetValueFromContext type

31 Mar 04:26
Compare
Choose a tag to compare

Say hello to Atomico@1.78.0 🚀, asynchronously friendlier 🤗🤝.

31 Mar 04:13
Compare
Choose a tag to compare

New Features

Now usePromise is also observed by the useSuspense Hook.

With this, you can create interfaces that react from the parent component to the asynchrony of its children.

New hook useProvider

With this new hook, you can set the context instance, for example:

const Theme = createContext({ mode: "light" });

const App = c(() => {
    useProvider(Theme, { mode: "dark" });
});

Internal improvements

  1. The context api is improved to synchronize states according to the HTML.

Fix useContext in SSR

22 Mar 01:17
Compare
Choose a tag to compare

Fixes a bug when using contexts in SSR environments.
Thanks to @WickyNilliams for reporting the issue atomicojs/astro#1.

Fix type Mark

09 Mar 02:04
Compare
Choose a tag to compare

This allows fixing the filter by instanceof a nidel of typescript types, example:

import { Mark } from "atomico";

Array.from(element.childNodes).filter(
    (el) => !(el instanceof Mark)
);

atomico@1.77 - New assignNode property for the tag slot 🚀

08 Mar 03:55
Compare
Choose a tag to compare

This new property allows working with slots in manual assignment mode in an agile way. For example:

import { c } from "atomico";
import { useChildNodes } from "@atomico/use-child-nodes";

const MyComponent = c(() => {
	const childNodes = useChildNodes();
	return (
		<host shadowDom={{ slotAssignment: "manual" }}>
			{childNodes
				.filter((el) => el instanceof HTMLElement)
				.map((child: HTMLElement) => (
					<slot assignNode={child}></slot>
				))}
		</host>
	);
});

customElements.define("my-component", MyComponent);

Fix missing useRefEffect type

07 Mar 03:45
Compare
Choose a tag to compare

Now the type exists as a module at the TS level