publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
958 stars 1.83k forks source link

[Phase 2] React Rewrite of Comment System #9365

Open noi5e opened 3 years ago

noi5e commented 3 years ago

The first phase of the React rewrite of the Comment/Legacy System was merged in #9176. Discussion in #9175. Yay! 🥳

To anyone who wants to see the React system in production, visit any research note, and add the following parameter to the end of the URL:

?react=true

I'm going to do a lot of follow-up work (in multiple PRs) in the next two weeks to try to get it as close to the fully functioning system as possible.

Including:

To-Do List (last edited Moday April 18th)

Done


(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)

noi5e commented 3 years ago

I'm back!

Starting to add system tests ensure that basic functionality for React comments exists. See #9665, which tests posting comments, and comment replies.

An added benefit of system tests for React comments is that we can use test runtime as a rough measure of whether or not React comments are faster than the Rails comment system.

React:

Screen Shot 2021-05-24 at 2 15 11 PM

Rails:

Screen Shot 2021-05-24 at 2 16 20 PM

A difference of .707 seconds, or 3% faster!

jywarren commented 3 years ago

This is awesome. Thanks @noi5e !!!

noi5e commented 3 years ago

Opened PR for editing comments.

Here's the new speed breakdown for all 3 new tests:

React:

Screen Shot 2021-05-31 at 6 43 32 PM

Rails:

Screen Shot 2021-05-31 at 6 45 35 PM

10% speed difference this time! I guess it can vary a lot depending on many factors, including whether or not processes are slowing down Terminal on my computer.