Closed Bug 869407 Opened 11 years ago Closed 11 years ago

Add ical.js backend wrapper

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Fallen, Assigned: Fallen)

References

Details

Attachments

(4 files)

This bug takes care of adding the ical.js backend. These should be the remaining patches for the first round, I'm splitting them up a bit for easier review.
This patch adds the backend to the build system, together with the js wrapper objects that glue together xpcom and ical.js
Attachment #746366 - Flags: review?(matthew.mecca)
The C++ implementation requires the jsDate attribut to be [implicit_jscontext] to forward the context to the date constructor. This flag does not work with a js implementation though. Therefore this patch splits out the interface into two different ones, each loaded based on the pref again.
Attachment #746367 - Flags: review?(matthew.mecca)
The timezone service uses an intermediate object for certain timezones for the C++ implementation. A similar wrapper is needed for ical.js. Therefore we should be loading each based on the backend used. the calICALJSTimezone object is also being used in other parts of the ical.js wrapper.
Attachment #746368 - Flags: review?(matthew.mecca)
Some slight modifications are needed for the unit tests. Most cases where an if/else block is used, the tests are not general enough (i.e comparing a whole string when there is a paremeter that is optional. Libical adds it, ical.js doesn't). As the goal is to get rid of libical, I think these are OK.
Attachment #746370 - Flags: review?(matthew.mecca)
Attachment #746367 - Attachment description: Part 2 - Split calIDateTime into JS/C++ interfaces → Part 2 - Split calIDateTime into JS/C++ interfaces - v1
Comment on attachment 746368 [details] [diff] [review]
Part 3 - Timezone Service changes - v1

Review of attachment 746368 [details] [diff] [review]:
-----------------------------------------------------------------

::: calendar/base/src/calTimezone.js
@@ +72,5 @@
> +        return (this.icalComponent ? this.icalComponent.toString() : this.tzid);
> +    },
> +
> +    get isUTC() {
> +        dump("### testing is utc " + this.mUTC + "\n");

Debugging/Testing left-over ;)
Comment on attachment 746366 [details] [diff] [review]
Part 1 - Add Backend and its JS Wrapper Objects - v1

Review of attachment 746366 [details] [diff] [review]:
-----------------------------------------------------------------

::: calendar/base/backend/icaljs/calRecurrenceRule.js
@@ +103,5 @@
> +        prop.setValue(this.innerObject);
> +        return new calIcalProperty(prop);
> +    },
> +    set icalProperty(val) unwrapSetter(ICAL.Property, val, function(val) {
> +        Components.utils.reportError("GOT RRULE ICALPROP VALUE: " + val.toSource());

When testing with a large ics file, this line caused TB to hang, it attempts to write the entire parsed content of the calendar out to the error console.
Attachment #746366 - Flags: review?(matthew.mecca) → review+
Attachment #746367 - Flags: review?(matthew.mecca) → review+
Attachment #746368 - Flags: review?(matthew.mecca) → review+
Comment on attachment 746370 [details] [diff] [review]
Part 4 - Unit test changes and additions - v1

Review of attachment 746370 [details] [diff] [review]:
-----------------------------------------------------------------

Everything looks good overall. r=mmecca
Attachment #746370 - Flags: review?(matthew.mecca) → review+
Pushed to comm-central changeset 1ad08ece2315
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.5
I've removed the debug messages in these patches, I hope that improves the performance for now.
Build OS X 10.7 opt is burning 
https://tbpl.mozilla.org/php/getParsedLog.php?id=22878370&tree=Thunderbird-Trunk

It seems the removal of <em:targetPlatform> is problematic for the scripts preparing the Mac "universal" builds.
I think em:targetPlatform is still required as long as we include binary components. Otherwise you could install e.g. the linux package on windows and be confused because it doesn't work.
For now I've pushed a bustage fix that keeps it for merging under the name em:realTargetPlatform. I'm not really happy with this solution, but it should at least make the tree green again. I don't have a final solution for this yet, maybe you have an idea:

If we do specify em:targetPlatform, then it won't be possible to install Lightning on a different platform when calendar.backend = "icaljs". How can we restrict the targetPlatform only when the backend is libical?

OTOH maybe its just too early. Theming is not ready for cross-platform install, so it might not hurt to just keep the targetPlatform tag intact.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: