Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Issue 359283003: Remove usages of jquery and add sugar.js from garden-o-matic. (Closed)

Created:
6 years, 5 months ago by ojan
Modified:
6 years, 5 months ago
CC:
blink-reviews
Project:
blink
Visibility:
Public.

Description

Remove usages of jquery and add sugar.js from garden-o-matic. Use sugar.js to replace usages of jquery and replace any extraneous uses as well. Didn't touch the custom event stuff (bind/trigger) or the tabs UI code. Those will naturally go away as we port things to polymer. Kept this patch for mechanical simple changes. The only non-mechanical bits are $.param --> base.queryParam and fadeIn/fadeOut --> element.animate. NOTRY=true Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177188

Patch Set 1 #

Patch Set 2 : merge to ToT #

Patch Set 3 : add base unittest and remove fadeIn/fadeOut #

Patch Set 4 : remove jquery script from ct-sheriff-o-matic #

Total comments: 8

Patch Set 5 : address review comments #

Patch Set 6 : merge to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7920 lines, -83 lines) Patch
M Tools/GardeningServer/garden-o-matic.html View 1 chunk +1 line, -0 lines 0 comments Download
M Tools/GardeningServer/run-unittests.html View 1 chunk +1 line, -0 lines 0 comments Download
M Tools/GardeningServer/scripts/base.js View 1 2 chunks +13 lines, -1 line 0 comments Download
M Tools/GardeningServer/scripts/base_unittests.js View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M Tools/GardeningServer/scripts/builders.js View 1 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/scripts/controllers_unittests.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/scripts/garden-o-matic.js View 1 2 3 4 3 chunks +5 lines, -4 lines 0 comments Download
M Tools/GardeningServer/scripts/model.js View 2 chunks +4 lines, -4 lines 0 comments Download
M Tools/GardeningServer/scripts/model_unittests.js View 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/scripts/pixelzoomer.js View 3 chunks +6 lines, -3 lines 0 comments Download
M Tools/GardeningServer/scripts/results.js View 1 10 chunks +12 lines, -12 lines 0 comments Download
M Tools/GardeningServer/scripts/rollbot.js View 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/scripts/summary-mock.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/scripts/svn-log.js View 2 chunks +2 lines, -2 lines 0 comments Download
M Tools/GardeningServer/scripts/svn-log_unittests.js View 1 chunk +1 line, -1 line 0 comments Download
A Tools/GardeningServer/scripts/third_party/sugar.js View 1 chunk +7804 lines, -0 lines 0 comments Download
M Tools/GardeningServer/scripts/ui.js View 1 4 chunks +19 lines, -21 lines 0 comments Download
M Tools/GardeningServer/scripts/ui/failures.js View 2 chunks +5 lines, -5 lines 0 comments Download
M Tools/GardeningServer/scripts/ui/notifications.js View 1 2 3 4 5 chunks +19 lines, -12 lines 0 comments Download
M Tools/GardeningServer/scripts/ui/notifications_unittests.js View 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/scripts/ui/results.js View 1 5 chunks +9 lines, -7 lines 0 comments Download
M Tools/GardeningServer/scripts/ui/results_unittests.js View 2 chunks +3 lines, -3 lines 0 comments Download
M Tools/GardeningServer/scripts/ui_unittests.js View 1 chunk +1 line, -1 line 0 comments Download
M Tools/GardeningServer/ui/ct-sheriff-o-matic.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
ojan
This patch is big. I can split it up if you want. But it's almost ...
6 years, 5 months ago (2014-06-30 04:15:41 UTC) #1
abarth-chromium
LGTM https://codereview.chromium.org/359283003/diff/60001/Tools/GardeningServer/scripts/garden-o-matic.js File Tools/GardeningServer/scripts/garden-o-matic.js (right): https://codereview.chromium.org/359283003/diff/60001/Tools/GardeningServer/scripts/garden-o-matic.js#newcode107 Tools/GardeningServer/scripts/garden-o-matic.js:107: window.addEventListener('load', function() { ready -> DOMContentLoaded, right? https://codereview.chromium.org/359283003/diff/60001/Tools/GardeningServer/scripts/summary-mock.js ...
6 years, 5 months ago (2014-06-30 04:26:03 UTC) #2
ojan
https://codereview.chromium.org/359283003/diff/60001/Tools/GardeningServer/scripts/garden-o-matic.js File Tools/GardeningServer/scripts/garden-o-matic.js (right): https://codereview.chromium.org/359283003/diff/60001/Tools/GardeningServer/scripts/garden-o-matic.js#newcode107 Tools/GardeningServer/scripts/garden-o-matic.js:107: window.addEventListener('load', function() { On 2014/06/30 04:26:03, abarth wrote: > ...
6 years, 5 months ago (2014-06-30 04:49:59 UTC) #3
ojan
The CQ bit was checked by ojan@chromium.org
6 years, 5 months ago (2014-06-30 04:52:44 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ojan@chromium.org/359283003/100001
6 years, 5 months ago (2014-06-30 04:53:07 UTC) #5
commit-bot: I haz the power
Change committed as 177188
6 years, 5 months ago (2014-06-30 05:11:22 UTC) #6
Dirk Pranke
This change seems problematic to me (sorry!) 1) I'm not really sure why we're switching ...
6 years, 5 months ago (2014-06-30 21:24:49 UTC) #7
esprehn
On 2014/06/30 at 21:24:49, dpranke wrote: > This change seems problematic to me (sorry!) > ...
6 years, 5 months ago (2014-06-30 22:44:41 UTC) #8
ojan
6 years, 5 months ago (2014-07-01 02:45:51 UTC) #9
Message was sent while issue was closed.
On 2014/06/30 at 22:44:41, esprehn wrote:
> On 2014/06/30 at 21:24:49, dpranke wrote:
> > This change seems problematic to me (sorry!)
> > 
> > 1) I'm not really sure why we're switching from jquery to sugar. I'm not at
all familiar w/ sugar, so ... do we need things that sugar provides that the
platform doesn't and that jquery doesn't? I would say that jquery is not small
and has a bunch of stuff we don't need, but if sugar is 7800 lines of code, it's
not small either?
> 
> jQuery doesn't understand Shadow DOM or Polymer, it also leads to really messy
DOM mutation code that you should never be doing once you're using polymer
properly. We need to get rid of jQuery, Polymer + Sugar is the future.

The concern isn't code size. It's functionality. Sugar does give some things
that the platform doesn't provide (e.g. Object.keys, String.pluralize, etc).
Some of it happens to overlap with jQuery. Unlike jQuery though it doesn't
encourage coding practices that we're trying to avoid (e.g. string-based DOM
creation, a magic global object, etc).

Sugar does have some bloat that we certainly don't need (e.g. String.zenkaku),
but it doesn't really cost us anything than a small number of bytes over the
network.

> > 2) We're not allowed to check third_party code into arbitrary parts of the
tree, even if it has the right license (which sugar, being MIT, does). We have
to follow a little more bureaucracy.
> 
> Lets just add a bower dep for sugar in bower.json instead. There's no reason
to check this in at all.

Sure. I was just cargo-culting the codereview tool

Powered by Google App Engine
This is Rietveld 408576698