Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Will Preact stay API compatible with React 16? #432

Description

@drcmda

We usually alias to Preact in production because of the payload savings, but now that we moved to React 16 which was officially released yesterday, preact-compat is down (for instance when returning arrays). That raises questions as to how far we can go with Fiber anyway, even if preact-compat can patch some minor things. But will it support returning arrays, numbers and strings as results, portals, and eventually async scheduling?

screen shot 2017-09-27 at 12 32 03

Activity

  1. developit commented on Sep 28, 2017

    @developit
    Member

    Hi there! All good questions. Preact-compat has to account for all of these changes, but some of them will remain in compat and not in core. Here's a list:

    • Returning Arrays from render(): yes, but this is a huge change for Preact itself. It will come, but it will take time.
    • Numbers & strings: this has always been supported in Preact.
    • Portals: I like the idea, but there are things like event bubbling redirection that might be unworkable within preact. We'll probably have to patch them into compat. On a personal note, I don't think the event propagation redirection piece of this holds enough value for Preact to adopt it and deviate from using browser events directly.
    • Async scheduling: this will absolutely be coming to Preact itself, and we'll ship a decent scheduler enabled by-default in preact-compat once it's available.
  2. HillLiu commented on Oct 12, 2017

    @HillLiu
  3. vorillaz commented on Oct 17, 2017

    @vorillaz

    Waiting for hydrate since this is a breaking change for aliasing with Next.js

  4. effulgentsia commented on Oct 17, 2017

    @effulgentsia

    Returning Arrays from render(): yes, but this is a huge change for Preact itself. It will come, but it will take time.

    Is there an issue to follow for that? #406 is closed. I don't know if it's appropriate to reopen that one or start with a new one: is there definitely agreement that it's for Preact rather than for Preact-compat?

  5. developit commented on Oct 21, 2017

    @developit
    Member

    @effulgentsia I think most people want Array returns in preact itself, but it's also quite possible doing so would necessitate a rewrite of the diff. In terms of ongoing discussion, @tkh44 was working some magic in #703.

  6. vorillaz commented on Oct 28, 2017

    @vorillaz

    @developit Watching this closely as Next.js is strictly packed with React 16. Is there any chance to help you out with missing API changes?

  7. developit commented on Jan 11, 2018

    @developit
    Member

    Yes! Jump on slack and we can work out what to do.

  8. alexparish commented on Jul 13, 2018

    @alexparish

    Does anyone have a rough timeline for React 16 compatibility? Particularly interested in support for the hydrate function.

  9. added a commit that references this issue on Aug 6, 2018
  10. added a commit that references this issue on Dec 18, 2018
  11. marvinhagemeister commented on Nov 1, 2019

    @marvinhagemeister
    Member

    Note, we added all of those in Preact X 🎉 We even ship with a rough implementation fo Suspense but that is not ready for production yet 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions