preact icon indicating copy to clipboard operation
preact copied to clipboard

preact/compat/dist/compat.module.js does not export 'unstable_flushControlled

Open pedrolucasp opened this issue 3 years ago • 2 comments

  • [x] Check if updating to the latest Preact version resolves the issue

Describe the bug

When building a preact application using parceljs and having draftjs as a dependency it'll output this message:

node_modules/preact/compat/dist/compat.module.js does not export 'unstable_flushControlled

I wonder if we can export this functionality or if this is completely out-of-scope for preact. If we do wish to export this, I can try to work around a patch if provided with some aid/guidance.

To Reproduce

I've created a sample/demo repository here: https://git.eletrotupi.com/parcel-preact-draftjs

Steps to reproduce the behavior:

  1. Clone the repository
  2. Install the deps
  3. Run yarn build

Expected behavior

It should build a fully functional page

pedrolucasp avatar Sep 07 '22 01:09 pedrolucasp

What type of module is calling this? Personally not a big fan of introducing the unstable_ prefixed ones even as a stub, generally you can easily add those as

export function unstable_flushControlled() {}

JoviDeCroock avatar Sep 18 '22 07:09 JoviDeCroock

It's their src/components/base/DraftEditorFlushControlled component and I also wonder if it makes sense to add unstable_ functions to preact/compat, that's why I didn't even follow up this issue with a patch.

pedrolucasp avatar Sep 19 '22 21:09 pedrolucasp

I'm going to close this on out as draft-js has been archived for a bit and there hasn't seemed to be any other modules making use of this in particular. We probably want to avoid unstable_ identifiers in general, but can decide on a case-by-case basis.

rschristian avatar May 09 '24 21:05 rschristian