Draft-js: Draft 0.11.0 Umbrella

Created on 28 Jul 2017  路  17Comments  路  Source: facebook/draft-js

If you've followed the v0.10.0 migration guide then you're all set to try the alpha release of Draft 0.11.0!

Get this new and improved Draft.js by installing [email protected] or updating your package.json to the following and running yarn install/npm install:

  "draft-js": "0.11.0-alpha" 

_And help make Draft better by reporting bugs._ :)


Progress towards releasing Draft 0.11.0:

  • [x] Release 'alpha' of 0.11.0
  • [ ] Fix bugs reported in Alpha (ongoing!)
  • [ ] Update Facebook Draft uses to 0.11.0 API (for context see https://github.com/facebook/draft-js/issues/839) - 29 remaining callsites need updated
  • [x] Merge 0.11.0-alpha branch into master
  • [x] Manual testing (see https://github.com/facebook/draft-js/wiki/Manual-Testing)

    • [x] Chrome

    • [x] Firefox

    • [x] Safari

    • [x] IE

    • [x] Edge

  • [x] Land 0.11.0-beta internally at FB
  • [x] 1-2 weeks of testing - fix bugs that are reported
  • [x] Update docs (mostly done thanks to previous PRS that just need merged)
  • [x] Release 0.11.0 :)
big picture

Most helpful comment

@flarnie Sorry to bother, but it would be nice to have that information on the repo's README. We've adopted draftjs around March, as we figured it was still active, but I've just now found this information, after having to slog through a rather large amount of bugs.

All 17 comments

I noticed that the peerDependencies for 0.11.0 are:

  "peerDependencies": {
    "react": "^0.14.0 || ^15.0.0-rc",
    "react-dom": "^0.14.0 || ^15.0.0-rc"
  },

Are there plans to also support ^16.0.0?

Thanks for the great work! 馃憤

Hi Steve!

Absolutely - thanks for the reminder. Should work without a hitch, since we have been using Draft.js with React 16-alpha internally for some time now.

@flarnie if supported React 16, will be ref as string converted to function?

https://github.com/facebook/draft-js/blob/744e9b4eb4810797a93c66591fea6f9cac533b4b/src/component/base/DraftEditor.react.js#L243

With React 16.0.0-beta.5 I got such console error:
screen shot 2017-08-15 at 09 18 16

Edit: Of course, now that I think about it it makes sense that you are having this issue. Draft.js is requiring React 15 as a peer dependency, and if you also load React 16 then you'll have 2 copies of React loaded.

I would manually tweak the package.json of your copy of Draft.js to also accept React 16 as a peer dependency and then run npm install to see if that helps.


Hi @nodkz - I know that error is confusing, sorry about that. From what we have seen, it pretty much only happens when you have somehow loaded two copies of React. If you tell me more about your build system I might be able to help.

Here is an issue where other folks have talked through this same problem and we documented some cases and solutions:
https://github.com/facebook/draft-js/issues/296

@flarnie thanks for help!

Easiest way to make draft-js working with React 16

  • run before start/build shell command rm -fr ./node_modules/draft-js/node_modules/react-dom && rm -fr ./node_modules/draft-js/node_modules/react.
  • or shortly but with warning message if folders already removed rm -fr ./node_modules/draft-js/node_modules/react*

How I understood when I upgraded from React 15 to React 16-beta yarn copy old react version to the draft-js/node_modules for keeping peerDeps consistent. Also the same behavior if I remove node_modules and install packages from scratch. So adding react 16 in peerDeps will solve the problem with yarn.

PS. Ref as string is not a problem for React 16. All works like a charm.

Just an update - still blocked on "Update Facebook Draft uses to 0.11.0 API (for context see #839) - 29 remaining callsites need updated". Unfortunately I need someone within FB to work on those tasks and I'm mainly focused on React right now, so haven't churned through them yet. Thanks for everyone's patience.

Hi!

Any news on this one? I'd really like to try out 0.11 as it solves a few annoyances for us (the main one being making the entity state fully immutable so updated entity data triggers a re-render properly) but I noticed the 0.11-alpha is quite far behind master. I guess this is still blocked due to FB needing to dedicate resources, but would it be feasible to merge master into the 0.11-alpha branch so we can test it, or does that not make sense?

Thank you in advance!

Hi!
Thank you for cool project. We like it very much.

@flarnie Any updates on releasing v0.11 ?
We have similar problems with entity data updates in v0.10.x, mentioned by @zth

tldr; This is not on any team's roadmap and it's more work than I can do in my spare time, so no progress yet. Until someone within Facebook takes it on it likely won't progress. In about 5 months I may try championing this project again, but for now I'm booked working on other efforts. At that time I will recommend forking Draft internally, and we leave behind less vital uses of Draft.js without blocking progress of features for our main uses on Facebook and Messenger.

@flarnie will the editor evolve or not? It makes sense to wait for a major release?
Thanks!

@flarnie Sorry to bother, but it would be nice to have that information on the repo's README. We've adopted draftjs around March, as we figured it was still active, but I've just now found this information, after having to slog through a rather large amount of bugs.

more recent update from @flarnie on another thread: https://github.com/facebook/draft-js/issues/1193#issuecomment-420099650

I will start by admitting that I am no paragon of keeping open source projects up to date (see benmosher/eslint-plugin-import#1249 馃槄) but it would be nice to get a prognosis update for the maintenance status of this project from the maintainer's perspective, particularly after the September update linked in my preceding comment.

Like others, I am trying to figure out after a little bit of time using (and enjoying!) this project whether I need to consider something else or forking to get the current master and fix other bugs I have encountered myself.

Hi @benmosher, thanks for voicing the concerns that most users in the community are having. We are looking into reducing the bundle size after the addition of a new HTML converter which coexists with the old one. This is currently being dogfooded internally for regression and, since it caused a breakage in production earlier, we're being extra scrupulous with testing. We'll keep you updated on progress in this issue.

Hi, what is the status of this? I can see the release of v0.11, but this issue is still open and checkboxes not checked. Were all the above tasks finished? E.g. can we rely on v0.11 being fully tested? I am also missing branch v0.11-stable, can we consider master as such?

Yeah, I think we could just close this issue... the new releases are there...

v0.11.0 shipped, so closing this issue.

The removal of the global DraftEntity API did not make it to v0.11.0 and will instead happen in v0.12.0. Any follow-ups to that change can be posted on the v0.12.0 umbrella issue: https://github.com/facebook/draft-js/issues/2650.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackmatrix picture jackmatrix  路  3Comments

vierno picture vierno  路  3Comments

eessex picture eessex  路  3Comments

ktjd123 picture ktjd123  路  3Comments

abeq picture abeq  路  3Comments