Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

feat: swap Preact with React #34

Merged
merged 3 commits into from
Mar 3, 2020
Merged

Conversation

francoischalifour
Copy link
Owner

@francoischalifour francoischalifour commented Mar 2, 2020

This swaps the Preact implementation with a React implementation.

I had to make the core library events types generic because React uses Synthetic Events. I also fixed some typings issues that Preact types didn't complain about.

React is now a peer dependency of autocomplete-react.

@eunjae-lee
Copy link
Collaborator

Can you ELI5 why you swap Preact with React and if you have any possible approach in mind for vanilla js afterwards?

@francoischalifour
Copy link
Owner Author

Supporting React by default makes more sense because the primary users of autocomplete-react will be React users.

Swapping the implementation to Preact will be straightforward because it's a matter of configuration, as explained in Preact documentation. Before doing so we'll need to understand if we want to reuse this same code.

This moves also makes the environment more stable since React is the main library, and Preact aims at mimicing their public API.

I'm still undecided if we should use Preact for the vanilla version, or plain JavaScript. When we start the vanilla implementation, we should investigate how difficult it would be to write it in plain vanilla. Wild idea, perhaps we should consider Svelte too, which outputs plain JavaScript.

@eunjae-lee
Copy link
Collaborator

Thanks. Now I'm in the context 🙂
It makes sense and this PR looks good to me.

@francoischalifour francoischalifour merged commit e0f2568 into next Mar 3, 2020
@francoischalifour francoischalifour deleted the feat/swap-preact-react branch March 3, 2020 16:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants