Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1863)

Issue 194059: Fix SHINDIG-1260

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 3 months ago by Jacky Wang
Modified:
14 years, 3 months ago
Reviewers:
Paul Lindner, james.mcininc, chabotc
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

Improper JavaScript inclusion logic leads to out-of-order and duplicate includes / JavaScript errors. 1) feature list sorted. 2) un-used features are removed from forcedJsLibs 3) re-factored Gadget*Renderer.php TODO: 1) cache management 2) don't expend the js on JsServlet.

Patch Set 1 #

Patch Set 2 : patch - don't expend the js on JsServlet. #

Patch Set 3 : Fix the unit-test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -68 lines) Patch
config/container.js View 1 chunk +1 line, -1 line 0 comments Download
php/config/container.php View 1 chunk +1 line, -1 line 0 comments Download
php/src/gadgets/GadgetContext.php View 2 chunks +2 lines, -2 lines 0 comments Download
php/src/gadgets/GadgetFactory.php View 1 chunk +3 lines, -1 line 0 comments Download
php/src/gadgets/GadgetFeatureRegistry.php View 1 2 3 chunks +72 lines, -5 lines 0 comments Download
php/src/gadgets/GadgetSpecParser.php View 2 chunks +4 lines, -2 lines 0 comments Download
php/src/gadgets/render/GadgetBaseRenderer.php View 1 2 3 chunks +55 lines, -39 lines 0 comments Download
php/src/gadgets/render/GadgetHtmlRenderer.php View 1 1 chunk +8 lines, -5 lines 0 comments Download
php/src/gadgets/render/GadgetRenderer.php View 1 1 chunk +2 lines, -4 lines 0 comments Download
php/src/gadgets/render/GadgetUrlRenderer.php View 1 2 2 chunks +14 lines, -6 lines 0 comments Download
php/src/gadgets/servlet/JsServlet.php View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5
Jacky Wang
14 years, 3 months ago (2010-01-25 14:31:15 UTC) #1
Jacky Wang
patch - don't expend the js on JsServlet.
14 years, 3 months ago (2010-01-26 10:22:37 UTC) #2
Jacky Wang
fix the unit-test.
14 years, 3 months ago (2010-02-01 12:40:38 UTC) #3
Jacky Wang
Fix the unit-test.
14 years, 3 months ago (2010-02-01 12:42:36 UTC) #4
Jacky Wang
14 years, 3 months ago (2010-02-01 13:07:30 UTC) #5
Hi All,

This patch is complete now.

Basically, it fixes the issue SHINDIG-1260, which could be found here:
http://issues.apache.org/jira/browse/SHINDIG-1260

In details, this patch does the following things:

1. Change all the name "focedJsLibs" to "forcedJsLibs".

2. Sort the order of features according to their dependencies.

3. If the forced-javascript-lib is not included in the required features, it
won't be included in the generated gadget, and it won't be appear in the
gadget.init, either.

4. JsServlet's behaviors is changed: it won't expand the javascript content
according to the dependency anymore.  This prevent the redundant inclusion of
the js content.

5. The js generating logic is changed:
   Given a dependency graph inl_A <- inl_B <- fjl_C <- fjl_D <- inl_E <- fjl_F
(inl = inline, fjl = forcedJsLib):
   The existing solution produces [fjl: C+D+F], [inline A+B+E] in the
header/body.  However, it breaks the dependency graph.
   In contrast, this new patch groups the features into groups, and each one
belongs to either "inlined" or "forced external".
   Therefore the example yields the following groups: [inl_A, inl_B], [fjl_C,
fjl_D], [inl_E], [fjl_F] and generates the proper code in header/body.

6. Since the dependency graph might generate different topological sorted
orders, heuristic method is used to make the feature group number as less as
possible, thus reduces the outbound request number of javascript content.

I've tested it against many gadgets, and it works quite well.

Hope it helps.

Cheers,
Jacky

On 2010/02/01 12:42:36, Jacky Wang wrote:
> Fix the unit-test.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b