Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[example] Add preact-next example #15401

Merged
merged 1 commit into from Apr 18, 2019

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Apr 18, 2019

Because bundle size matter. Closes #14798. The Preact integration might not be perfect yet. This example will be a playground for us.

This change creates precedence for us in the support of Preact. Preact market share is small: https://www.rank2traffic.com/preactjs.com. However, they seem to take React compatibility very seriously: https://github.com/developit/preact/releases/tag/10.0.0-beta.0. It's an awesome alternative for people who wish to minimize the bundle size (-25kB gzipped). I hope it won't require any major effort. Maybe it will get traction 🤷‍♂️? No matter what, it helps with the "bloat" fear.

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Apr 18, 2019
@mui-pr-bot
Copy link

mui-pr-bot commented Apr 18, 2019

No bundle size changes comparing 522c8f7...982bae1

Generated by 🚫 dangerJS against 982bae1

@oliviertassinari oliviertassinari force-pushed the preact-next branch 2 times, most recently from ba7bd42 to e4ba3c4 Compare April 18, 2019 14:33
@yuqianma
Copy link

yuqianma commented Jul 6, 2019

It seems like you install the es-lint things globally?
I cannot run the example with a simple npm install. Too many packages are missing.
Finally get it run after commenting the "First, run the linter" section in webpack.config.js

@yuqianma
Copy link

yuqianma commented Jul 6, 2019

BTW, the TextField with preact is broken now.
Have no idea what's the problem so far...

@yuqianma
Copy link

yuqianma commented Jul 6, 2019

Find a workaround:

const TextField = (props) => {
  const [value, set] = useState(props.value);
  return <OTextField
    {...props}
    value={value}
    onChange={e => set(e.target.value)}
  />
}

@oliviertassinari
Copy link
Member Author

@yuqianma Do you know why it makes a difference?

@yuqianma
Copy link

yuqianma commented Jul 7, 2019

@oliviertassinari Not really. I first guess it's related to this PR in 10.0.0-beta.1. But I tried to install beta.0. It's also broken.
Other possible is ref?

Since it's a bit complex to dig in the problem and I find the workaround. I want to get mine things done first.

Raise a issue with codesandbox at preact
preactjs/preact#1759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation preact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants