Changes between Version 23 and Version 24 of TracDev/ApiChanges/0.11
- Timestamp:
- Nov 16, 2007, 11:39:27 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/ApiChanges/0.11
v23 v24 2 2 = !TracDev/ApiChanges/0.11 = 3 3 4 '''Note: Development of Trac [milestone:0.11] has started with r3804 and the trunk now uses ''[http://genshi.edgewall.org/ Genshi]'' instead of ClearSilver, for its template engine. Please keep in mind that the information in this page is work in progress.''' 4 '''Note: Development of Trac [milestone:0.11] has started with r3804 and now at r6160 it has reached some stability. We're considering releasing a beta 1 soon. 5 Please keep in mind that the information in this page is ''still'' work in progress (most notably the sections marked with `TBD`).''' 5 6 6 == Caveats for Plugin Developers == 7 8 The Trac macros will need to be adapted: 9 - the old-style wiki-macros are not supported anymore (due to the drop of ClearSilver and the HDF); they need to be converted to the new-style macros 10 11 == Migrating away from Clearsilver == 7 == New Dependencies == 8 === Genshi === 12 9 13 10 ClearSilver has proven too limited and “uncomfortable”, so research for better alternatives was done. The [http://kid-templating.org/ Kid] templating language was unanimously found appealing, to the point that ChristopherLenz did a port of Trac to Kid during the development of DrProject (a fork of Trac). This in turn was found painful, and prompted Christopher to start his own, enhanced, version of Kid currently maturing as [http://genshi.edgewall.org/ Genshi]. … … 17 14 You can start porting your plugins [TracDev/PortingFromClearSilverToGenshi from Clearsilver to Genshi]. 18 15 19 == Advanced JavaScript Support == 16 === jQuery === 17 Advanced JavaScript Support 20 18 21 19 [http://jquery.com jQuery] is included in Trac, and it is advised to use this library when writing JavaScript code. 22 20 23 21 24 == Date and Time Manipulations == 22 == Modifications made to the 0.10 API == 23 24 === Date and Time Manipulations === 25 25 26 26 Since r3935, Trac uses `datetime` objects internally, instead of timestamps. … … 31 31 Those utilities automatically take into account the ''timezone'' information set by the user, so that the dates are presented in a meaningful way to him. 32 32 33 == Interface Changes==33 === Caveats for Macros Developers === 34 34 35 === `ITimelineEventProvider` ^[source:trunk/trac/timeline/api.py@head#L87 (0.11)] [source:tags/trac-0.10/trac/Timeline.py@head#L32 (0.10)]^ === #ITimelineEventProvider 35 The Trac macros will need to be adapted: 36 - the old-style wiki-macros are not supported anymore (due to the drop of ClearSilver and the HDF); they need to be converted to the new-style macros 37 - new-style macros are [#IWikiMacroProvider] plugins. They can be written as full plugins or simple one file drop-in plugins, see source:trunk/sample-plugins for some examples (TODO: source:tags/trac-0.11/sample-plugins/macros) 38 39 === Modified Interfaces === 40 ==== `ITimelineEventProvider` ^[source:trunk/trac/timeline/api.py@head#L87 (0.11)] [source:tags/trac-0.10/trac/Timeline.py@head#L32 (0.10)]^ ==== #ITimelineEventProvider 36 41 37 42 First thing, the timeline module has now its own package (`trac.timeline`), and the ITimelineEventProvider interface itself should now be imported from `trac.timeline`. However, note that the case has changed here, as you would previously have imported `trac.Timeline`. If you want to support both versions, try something like this: … … 65 70 ''Note: support for #1198 and #2293 will likely require adding other methods to that interface'' 66 71 67 === `ISearchSource` ^[source:trunk/trac/search/api.py@head#L17 (0.11)] [source:tags/trac-0.10/trac/search.py@head#L30 (0.10)]^=== #ISearchSource72 ==== `ISearchSource` ^[source:trunk/trac/search/api.py@head#L17 (0.11)] [source:tags/trac-0.10/trac/search.py@head#L30 (0.10)]^ ==== #ISearchSource 68 73 69 74 Similar to the timeline package, the search module has also been migrated to a package (`trac.search`), with the same case change. Again, if you want to support both versions, try something like this: … … 77 82 }}} 78 83 79 === `IWikiMacroProvider` ^[source:trunk/trac/wiki/api.py@head#L73 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@head#L70 (0.10)]^=== #IWikiMacroProvider84 ==== `IWikiMacroProvider` ^[source:trunk/trac/wiki/api.py@head#L73 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@head#L70 (0.10)]^ ==== #IWikiMacroProvider 80 85 81 86 - `render_macro(req, name, content)` has been deprecated (see r4621) … … 92 97 `render_macro(req, name, content)` will likely be removed in [milestone:0.12]. 93 98 94 === `IHTMLPreviewRenderer` ^[source:trunk/trac/wiki/api.py@head#L213 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@head#L209 (0.10)]^=== #IHTMLPreviewRenderer99 ==== `IHTMLPreviewRenderer` ^[source:trunk/trac/wiki/api.py@head#L213 (0.11)] [source:tags/trac-0.10/trac/wiki/api.py@head#L209 (0.10)]^ ==== #IHTMLPreviewRenderer 95 100 96 101 Similar to the above change, `render(req, mimetype ...)` is now `render(context, mimetype ...)`, `context` being a rendering `Context` (see below). 97 102 It doesn't matter that much however, as it looks like that this interface is going to be integrated in `IContentConverter` anyway (see #3332 - 0.12 topic unfortunately). 98 103 99 == New Interfaces, Modules and Classes == 104 105 == New in the 0.11 API == 100 106 101 107 Several new interfaces and modules have been added in 0.11. … … 103 109 TODO: document the various new trac.util modules. 104 110 105 === `trac.resource.Resource` === 111 === New Classes === 112 ==== `trac.resource.Resource` ==== #Resource 106 113 107 114 The '''resource identifier''' class `Resource` is used to specify in a convenient way which Trac ''resources'' is being manipulated. … … 112 119 Finally, a resource can be parented in another resource. This relationship usually means that a removal of the parent resource implies a removal of the children resources. 113 120 114 === `trac.resource.IResourceManager` === 115 116 The `IResourceManager` let components claim ownership of some realms. 117 For the managed realms, the manager component will know how to build URLs to access the resources belonging to that realm and will know how to describe those resources. 118 Various utility functions exist in the `trac.resource` module in order to manipulate the `Resource` identifier objects in a generic way. 119 120 === `trac.mimeview.api.Context` === 121 ==== `trac.mimeview.api.Context` ==== #Context 121 122 122 123 The '''rendering context''' class is used to specify ''how'' the content should be rendered. … … 128 129 (typical example, ticket information displayed within a Wiki page by the way of a macro). 129 130 130 === `trac.perm.IPermissionPolicy` === 131 === New Interfaces === 132 ==== `trac.resource.IResourceManager` ==== #IResourceManager 133 134 The `IResourceManager` let components claim ownership of some realms. 135 For the managed realms, the manager component will know how to build URLs to access the resources belonging to that realm and will know how to describe those resources. 136 Various utility functions exist in the `trac.resource` module in order to manipulate the `Resource` identifier objects in a generic way. 137 138 ==== `trac.perm.IPermissionPolicy` ==== #IPermissionPolicy 139 140 TBD. 141 ==== `trac.attachment.ILegacyAttachmentDelegate` ==== #ILegacyAttachmentDelegate 131 142 132 143 TBD. 133 144 134 === `trac.ticket.api.ITicketActionController` ===145 ==== `trac.ticket.api.ITicketActionController` ==== #ITicketActionController 135 146 136 147 TBD. See TracWorkflow. 137 148 138 === `trac.ticket.roadmap.ITicketGroupStatsProvider` ===149 ==== `trac.ticket.roadmap.ITicketGroupStatsProvider` ==== #ITicketGroupStatsProvider 139 150 140 151 TBD. 141 152 142 === `trac.web.ITemplateStreamFilter` ===153 ==== `trac.web.ITemplateStreamFilter` ==== #ITemplateStreamFilter 143 154 144 155 TBD. 145 156 146 === `trac.prefs.api.IPreferencePanelProvider` ===157 ==== `trac.prefs.api.IPreferencePanelProvider` ==== #IPreferencePanelProvider 147 158 148 159 TBD. 149 160 150 === `IPropertyRenderer` ^[source:trunk/trac/versioncontrol/web_ui/browser.py@head#L46 (0.11)] ===161 ==== `trac.versioncontrol.web_ui.browser.IPropertyRenderer` ^[source:trunk/trac/versioncontrol/web_ui/browser.py@head#L46 (0.11)] ==== #IPropertyRenderer 151 162 152 163 The presentation of version control properties for files and directories can be customized to a great extent. 153 164 The revision properties can be customized in a similar way. 154 165 155 === `IPropertyDiffRenderer` ^[source:trunk/trac/versioncontrol/web_ui/changeset.py@head#L51 (0.11)] ===166 ==== `trac.versioncontrol.web_ui.changeset.IPropertyDiffRenderer` ^[source:trunk/trac/versioncontrol/web_ui/changeset.py@head#L51 (0.11)] ==== #IPropertyDiffRenderer 156 167 157 168 Likewise, the presentation of changes for version control properties can be customized. 158 169 159 === !WebAdmin is now part of the core === 160 161 * The previously external interface `webadmin.web_ui.IAdminPageProvider` is now a core interface: `trac.admin.api.IAdminPanelProvider`. 162 Also its `get_admin_pages` method became `get_admin_panels`. 163 [[comment(some module names, such as {{{trac.Timeline}}} and {{{trac.Search}}}, were de-capitalized, e.g. {{{trac.timeline}}} => see above, there's a full section for each)]] 170 ==== `trac.admin.api.IAdminPanelProvider` ==== #IAdminPanelProvider 171 !WebAdmin is now part of the core. 172 The previously external interface `webadmin.web_ui.IAdminPageProvider` is now a core interface: `trac.admin.api.IAdminPanelProvider`. 173 Also its `get_admin_pages` method became `get_admin_panels`.