| 1 | {{{#!div style="float: right; margin: 0 1em" |
| 2 | ← [../1.0] | [../1.2] → |
| 3 | }}} |
| 4 | = Documenting API changes in 1.1.x |
| 5 | |
| 6 | {{{#!box info |
| 7 | The next stable version of Trac will be named 1.2 and will contain the cumulative changes made in the successive 1.1.x releases. |
| 8 | |
| 9 | These notes reflect the current status for [milestone:1.1.5], in [source:trunk]. |
| 10 | |
| 11 | Proposed changes are prefixed with an OPEN mark and the //paragraph is written in italics.// |
| 12 | }}} |
| 13 | |
| 14 | [[PageOutline(2-4,Summary,inline)]] |
| 15 | |
| 16 | |
| 17 | == Prerequisites |
| 18 | |
| 19 | **Only Python versions 2.6 and 2.7 are supported.** |
| 20 | |
| 21 | The following language features introduced in Python 2.6 can now be used and the related clean-ups can be done: |
| 22 | - use string [http://docs.python.org/library/string.html#string-formatting format()], `print()` |
| 23 | - `except Cls as val` |
| 24 | - class decorators to avoid the `implements` hack? |
| 25 | - `@prop.setter` / `@prop.deleter` |
| 26 | - `namedtuple`s! |
| 27 | - there's no longer need of `from __future__ import with_statement` |
| 28 | - `next(iterator, [default])` to clean-up some unit tests |
| 29 | - timeout in smtplib |
| 30 | |
| 31 | TODO: List supported browsers. Consider using [http://jquery.com/browser-support/ jQuery's list]. |
| 32 | |
| 33 | === Modified Dependencies |
| 34 | |
| 35 | See gmessage:trac-dev:nkMUY_8ILF0/rg1rsArDIewJ for a discussion about what dependencies we'll support in Trac 1.2. |
| 36 | |
| 37 | ==== jQuery and jQuery UI (bundled) |
| 38 | |
| 39 | The bundled version of [http://jquery.com jQuery] was updated from 1.7.2 in Trac 1.0-stable to: |
| 40 | * jQuery **1.8.2** in Trac 1.1.1 (r11412) |
| 41 | * jQuery **1.9 / 2.0** in Trac 1.1.2 |
| 42 | |
| 43 | See jQuery release notes for the corresponding major updates: |
| 44 | - [http://blog.jquery.com/2012/08/09/jquery-1-8-released/ 1.8] |
| 45 | - [http://blog.jquery.com/2012/08/30/jquery-1-8-1-released/ 1.8.1] |
| 46 | - [http://blog.jquery.com/2012/09/20/jquery-1-8-2-released/ 1.8.2] |
| 47 | - [http://blog.jquery.com/2012/11/13/jquery-1-8-3-released/ 1.8.3] |
| 48 | - http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/ |
| 49 | |
| 50 | The bundled version of the full minified [http://jqueryui.com jQuery UI] package was upgraded from 1.8.21 in Trac 1.0-stable to: |
| 51 | * jQuery UI [http://jqueryui.com/docs/Changelog/1.9.2 1.9.2] (#10976) |
| 52 | * OPEN //upgrade jQuery UI to at least [http://jqueryui.com/docs/Changelog/1.11.2 1.11.2]. See #11019.// |
| 53 | |
| 54 | ==== Babel (optional) |
| 55 | |
| 56 | The internationalization support (i18) for Trac is depending on [http://babel.edgewall.org/ Babel], version 1.0. (#10882) TODO |
| 57 | |
| 58 | //Babel >= 0.9.5 is still supported.// |
| 59 | |
| 60 | ==== Genshi (mandatory) |
| 61 | |
| 62 | OPEN |
| 63 | // '''Genshi 0.7''' // |
| 64 | |
| 65 | //Genshi 0.6.x is still supported.// |
| 66 | |
| 67 | |
| 68 | ==== Databases |
| 69 | |
| 70 | |||| **Database** || |
| 71 | || SQLite || >= 3.0 || |
| 72 | || PostgreSQL || >= 8.0 || |
| 73 | || MySQL / MariaDB || >= 5.0 || |
| 74 | |||| **Database Bindings** || |
| 75 | || pysqlite || >= 2.4.1 (version provided by Python 2.6), avoid 2.5.2 - 2.5.4 || |
| 76 | || psycopg2 || >= 2.0 || |
| 77 | || MySQLdb || >= 1.2.2 || |
| 78 | |
| 79 | ==== Other |
| 80 | |
| 81 | || Package || Req or Opt? || Version supported || |
| 82 | || SetupTools || Required || >= 0.6, 5.4 - 5.6 are not recommended. || |
| 83 | || Git || Optional || >= 1.5.6 || |
| 84 | || Subversion || Optional || >= 1.6 || |
| 85 | || !DocUtils || Optional || >= 0.3.9 || |
| 86 | || Textile || Optional || >= 2.0 || |
| 87 | || Pygments || Optional || >= 0.6. Let's consider bumping the requirement to at least 1.0, released in [https://pypi.python.org/pypi/Pygments/1.0 2008] || |
| 88 | ... please add any dependencies I've overlooked. |
| 89 | |
| 90 | `ConfigObj` is no longer a required dependency for the `AuthzPolicy` permission policy (`tracopt.perm.authz_policy`) since Trac 1.1.5. |
| 91 | |
| 92 | === Deprecated Modules Removed |
| 93 | |
| 94 | TODO Remove support for `mod_python` (see TracModPython) ... or maybe not. It seems the project is alive (comment:34:ticket:11605). |
| 95 | |
| 96 | DONE: Removed Enscript, SilverCity and PHP renderers in Trac 1.1.3. (#11795) |
| 97 | |
| 98 | === New Dependencies |
| 99 | |
| 100 | None! |
| 101 | |
| 102 | |
| 103 | == Detailed List of Developer Visible Changes #list |
| 104 | |
| 105 | === In Trac 1.1.1 |
| 106 | [[TicketQuery(milestone=1.1.1,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 107 | |
| 108 | === In Trac 1.1.2 |
| 109 | [[TicketQuery(milestone=1.1.2,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 110 | |
| 111 | === In Trac 1.1.3 |
| 112 | [[TicketQuery(milestone=1.1.3,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 113 | |
| 114 | === In Trac 1.1.4 |
| 115 | [[TicketQuery(milestone=1.1.4,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 116 | |
| 117 | === In Trac 1.1.5 |
| 118 | [[TicketQuery(milestone=1.1.5,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 119 | |
| 120 | == Other Modifications made to the 1.0 API |
| 121 | |
| 122 | Take the //will be removed in version 1.1.1// comments in the code seriously. The earlier the planned API changes in 1.1.x, the better (gives more time to plugin authors to adapt). TODO |
| 123 | |
| 124 | === Modified Interfaces |
| 125 | ==== `IWikiChangeListener` ^[source:trunk/trac/wiki/api.py@13198:53#L32 (1.1.3)] [source:branches/1.0-stable/trac/wiki/api.py@11490#L33 (1.0)]^ #IWikiChangeListener |
| 126 | |
| 127 | Wiki page version comments can now be edited, so `wiki_page_comment_modified(page, old_comment)` has been added to allow plugins to be notified of this. |
| 128 | |
| 129 | ==== `IPreferencePanelProvider` ^[source:trunk/trac/prefs/api.py@13510:23#L17 (1.1.3)] [source:branches/1.0-stable/trac/prefs/api.py@11490#L17 (1.0)]^ #IPreferencePanelProvider |
| 130 | |
| 131 | [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.prefs.api.IPreferencePanelProvider IPreferencePanelProvider] implementations can now provide child panels that appear as sections appended to other panels ([wiki:TracDev/Proposals/AdvancedNotification#Modularpreferencepages proposal]). This allows plugins to extend existing preference panels. |
| 132 | |
| 133 | === New Interfaces |
| 134 | ==== `trac.notification.api.INotificationDistributor` ^[source:trunk/trac/notification/api.py@13454#L29 (1.1.3)]^ #INotificationDistributor |
| 135 | |
| 136 | A new [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.INotificationDistributor INotificationDistributor] interface was added ([wiki:TracDev/Proposals/AdvancedNotification#ExtensionAPIformaildistribution proposal]). It allows plugins to distribute notifications on different channels (e.g. over XMPP). |
| 137 | |
| 138 | ==== `trac.notification.api.INotificationFormatter` ^[source:trunk/trac/notification/api.py@13454#L46 (1.1.3)]^ #INotificationFormatter |
| 139 | |
| 140 | A new [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.INotificationFormatter INotificationFormatter] interface was added ([wiki:TracDev/Proposals/AdvancedNotification#ExtensionAPIformaildistribution proposal]). It allows plugins to format notifications (e.g. to HTML). |
| 141 | |
| 142 | ==== `trac.notification.api.INotificationSubscriber` ^[source:trunk/trac/notification/api.py@13469#L70 (1.1.3)]^ #INotificationSubscriber |
| 143 | |
| 144 | A new [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.INotificationSubscriber INotificationSubscriber] interface was added ([wiki:TracDev/Proposals/AdvancedNotification#ExtensionAPIforsubscriptions proposal]). It allows plugins to provide more subscription preferences (e.g. to send or suppress notifications under special conditions). |
| 145 | |
| 146 | ==== `trac.notification.api.IEmailAddressResolver` ^[source:trunk/trac/notification/api.py@13454#L67 (1.1.3)]^ #IEmailAddressResolver |
| 147 | |
| 148 | A new [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.IEmailAddressResolver IEmailAddressResolver] interface was added ([wiki:TracDev/Proposals/AdvancedNotification#ExtensionAPIformaildistribution proposal]). It allows plugins to retrieve email addresses from users (e.g. from LDAP). |
| 149 | |
| 150 | ==== `trac.notification.api.IEmailDecorator` ^[source:trunk/trac/notification/api.py@13454#L79 (1.1.3)]^ #IEmailDecorator |
| 151 | |
| 152 | A new [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.IEmailDecorator IEmailDecorator] interface was added ([wiki:TracDev/Proposals/AdvancedNotification#ExtensionAPIformaildistribution proposal]). It allows plugins to add or tweak email headers. |
| 153 | |
| 154 | === Notification API Changes |
| 155 | |
| 156 | To take advantage of the new notification related interfaces, code that sends notifications must use the new [wiki:TracDev/NotificationApi Notification API] instead of the `NotifyEmail` class hierarchy since Trac 1.1.3. (See [wiki:TracDev/Proposals/AdvancedNotification#ExtensionAPIformaildistribution proposal]) |
| 157 | |
| 158 | === Database API Changes |
| 159 | |
| 160 | In Trac 1.1.3 methods have been added to `DatabaseManager` class for settings and retrieving the database version for Trac and plugins: `set_database_version` and `get_database_version` (#11859). |
| 161 | |
| 162 | ==== `Environment.get_db_cnx` has been removed #get_db_cnx in Trac 1.1.2 |
| 163 | |
| 164 | Following the [../0.12#get_db_cnx deprecation] made in 0.12, the method `Environment.get_db_cnx` has been removed. (#11605) |
| 165 | |
| 166 | One should now only use the //context managers// for retrieving a database Connection |
| 167 | in read or write mode. |
| 168 | - a **read-only** Connection can be used to form queries: |
| 169 | {{{#!python |
| 170 | with env.db_query as db: |
| 171 | ... |
| 172 | }}} |
| 173 | a `db` instance obtained the above way should only be used for executing //SELECT// |
| 174 | queries |
| 175 | - a **writable** Connection can be used to modify the database content in a transaction: |
| 176 | {{{#!python |
| 177 | with env.db_transaction as db: |
| 178 | ... |
| 179 | }}} |
| 180 | a `db` instance obtained the above way can be used to execute //INSERT/UPDATE/DELETE// |
| 181 | queries; they will be committed when the last such automatic transaction |
| 182 | in the control flow completes successfully. See DatabaseApi for the full details. |
| 183 | |
| 184 | `Environment.get_read_db` and the decorators `@with_transaction(env)` and `env.with_transaction()` have been [../1.0#with_transaction deprecated] since Trac 1.0 and will be removed in Trac 1.3.1. |
| 185 | |
| 186 | |
| 187 | ==== `db` parameters removed from function and method signatures in Trac 1.1.2 |
| 188 | |
| 189 | With the introduction of `@with_transaction(env)` decorators in 0.12 and continuing with the introduction of the database connection context managers in 1.0, the `db` parameters passed as function and method arguments became [../0.12#Othernews deprecated]. |
| 190 | |
| 191 | The `db` parameters have been removed from nearly all function and method signatures. The `db` arguments are still present on methods of `IEnvironmentParticipant` implementations, but are deprecated and should no longer be used. They will be removed in 1.3.1. |
| 192 | |
| 193 | |
| 194 | ==== `ConnectionBase` class in Trac 1.1.2 |
| 195 | |
| 196 | The `ConnectionBase` class defines an abstract interface that database backends must adhere to when implementing a `Connection` class. |
| 197 | |
| 198 | |
| 199 | === Template and CSS changes in Trac 1.1.2 |
| 200 | |
| 201 | `tt` tags are not support in HTML5 and have been replaced with `code` tags in Trac (#11094). The styling of `tt` and `code` tags is the same in Trac , but `code` tags should be used since the styling for `tt` tags will be removed in a future version of Trac. |
| 202 | |
| 203 | The `about.css` stylesheet has been removed and the rules contained in that stylesheet have been moved to `trac.css`. The table of environment information on the //Error// and //About// pages have been extracted to a new template `environment_info.html` and the markup and associated rules in the stylesheet have been significantly changed. |
| 204 | |
| 205 | //Many more changes to be added, depending on how details we want to get. TracUpgrade#CustomizedTemplates claims that changes to `id`s and CSS `class`es will be documented in ApiChanges.// |
| 206 | |
| 207 | |
| 208 | === Uncategorized Changes |
| 209 | |
| 210 | DONE: Removed deprecated compatibility code for InterTrac links in Trac 1.1.4: [browser:/trunk/trac/wiki/formatter.py@13050:703-712#L696], and remove documentation: |
| 211 | * InterWiki page |
| 212 | * [browser:/trunk/trac/wiki/intertrac.py@13050:50-60#L30] |
| 213 | |
| 214 | DONE: Removed the deprecated `authname` parameter from `Environment.get_repository()` in Trac 1.1.3. |
| 215 | |
| 216 | TODO: Log warnings for deprecated functions and methods (comment:26:ticket:11605) |
| 217 | |
| 218 | |
| 219 | == New in the 1.1 API |
| 220 | |
| 221 | Be sure to have a look at the new ApiDocs ([http://www.edgewall.org/docs/trac-trunk/html/ for latest trunk]). |
| 222 | |
| 223 | TODO: Remove //Since// info from docstrings for Trac < 0.12. |
| 224 | |
| 225 | //This is a work in progress - coverage is still not yet complete.// |
| 226 | |
| 227 | |
| 228 | |
| 229 | {{{#!comment |
| 230 | === New Classes |
| 231 | ==== `trac.x.y.ClassName` ^[source:trunk/trac/x/y.py@#Lnum (1.0)]^ #ClassName |
| 232 | |
| 233 | ... |
| 234 | |
| 235 | === Other news |
| 236 | |
| 237 | }}} |