| 1 | {{{#!div style="float: right; margin: 0 1em" |
| 2 | ← [../1.0] | [../1.4] → |
| 3 | }}} |
| 4 | |
| 5 | = Documenting API changes in 1.2 |
| 6 | |
| 7 | {{{#!box info |
| 8 | These notes reflect the cumulative changes that occurred during the 1.1.x development cycle, and therefore the current status for [milestone:1.2]. |
| 9 | |
| 10 | No API changes are expected to occur on the [source:branches/1.2-stable] branch. |
| 11 | }}} |
| 12 | |
| 13 | [[PageOutline(2-4,Summary,inline)]] |
| 14 | |
| 15 | == Prerequisites |
| 16 | |
| 17 | **Only Python versions 2.6 and 2.7 are supported.** |
| 18 | |
| 19 | === Modified Dependencies |
| 20 | |
| 21 | ==== jQuery and jQuery UI (bundled) |
| 22 | |
| 23 | The bundled version of [http://jquery.com jQuery] was updated from 1.7.2 in Trac 1.0-stable to: |
| 24 | * [https://blog.jquery.com/2012/09/20/jquery-1-8-2-released 1.8.2] in Trac 1.1.1 (#10976) |
| 25 | * [https://blog.jquery.com/2015/04/28/jquery-1-11-3-and-2-1-4-released-ios-fail-safe-edition/ 1.11.3] in Trac 1.2 (#11019) |
| 26 | |
| 27 | The bundled version of [http://jqueryui.com jQuery UI] was updated from 1.9.2 in 1.0-stable to 1.11.4 in Trac 1.2. |
| 28 | |
| 29 | 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: |
| 30 | * [https://jqueryui.com/docs/Changelog/1.9.2 1.9.2] in Trac 1.1.1 (#10976) |
| 31 | * [https://jqueryui.com/docs/Changelog/1.11.4 1.11.4] in Trac 1.2 (#11019) |
| 32 | |
| 33 | |
| 34 | ==== Babel (optional) |
| 35 | |
| 36 | The internationalization support (i18) for Trac is depending on [http://babel.edgewall.org/ Babel], >= 0.9.5 is supported. |
| 37 | |
| 38 | ==== Genshi (mandatory) |
| 39 | |
| 40 | Genshi 0.6 and 0.7 are supported. |
| 41 | |
| 42 | ==== Databases |
| 43 | |
| 44 | |||| **Database** || |
| 45 | || SQLite || >= 3.0 || |
| 46 | || PostgreSQL || >= 8.0 || |
| 47 | || MySQL / MariaDB || >= 5.0 || |
| 48 | |||| **Database Bindings** || |
| 49 | || pysqlite || >= 2.4.1 (version provided by Python 2.6), avoid 2.5.2 - 2.5.4 || |
| 50 | || psycopg2 || >= 2.0 || |
| 51 | || MySQLdb || >= 1.2.2 || |
| 52 | |
| 53 | ==== Other |
| 54 | |
| 55 | || **Package** || **Req or Opt?** || **Version supported** || |
| 56 | || SetupTools || Required || >= 0.6, 5.4 - 5.6 are not recommended. || |
| 57 | || Git || Optional || >= 1.5.6 || |
| 58 | || Subversion || Optional || >= 1.6 || |
| 59 | || !DocUtils || Optional || >= 0.3.9 || |
| 60 | || Textile || Optional || >= 2.0 || |
| 61 | || 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] || |
| 62 | |
| 63 | Please add any dependencies overlooked. |
| 64 | |
| 65 | `ConfigObj` is no longer a required dependency for the `AuthzPolicy` permission policy (`tracopt.perm.authz_policy`) since Trac 1.1.5. |
| 66 | |
| 67 | === Deprecated Modules Removed |
| 68 | |
| 69 | Removed Enscript, SilverCity and PHP renderers in Trac 1.1.3. (#11795) |
| 70 | |
| 71 | === New Dependencies |
| 72 | |
| 73 | [pypi:passlib] is needed to decode some `htpasswd` formats on Windows, replacing the `fcrypt` package. |
| 74 | |
| 75 | == Detailed List of Developer Visible Changes #list |
| 76 | |
| 77 | === In Trac 1.1.1 |
| 78 | [[TicketQuery(milestone=1.1.1,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 79 | |
| 80 | === In Trac 1.1.2 |
| 81 | [[TicketQuery(milestone=1.1.2,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 82 | |
| 83 | === In Trac 1.1.3 |
| 84 | [[TicketQuery(milestone=1.1.3,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 85 | |
| 86 | === In Trac 1.1.4 |
| 87 | [[TicketQuery(milestone=1.1.4,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 88 | |
| 89 | === In Trac 1.1.5 |
| 90 | [[TicketQuery(milestone=1.1.5,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 91 | |
| 92 | === In Trac 1.1.6 |
| 93 | [[TicketQuery(milestone=1.1.6,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] |
| 94 | |
| 95 | == Other Modifications made to the 1.0 API |
| 96 | |
| 97 | === Modified Interfaces |
| 98 | |
| 99 | ==== `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 |
| 100 | |
| 101 | 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. |
| 102 | |
| 103 | ==== `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 |
| 104 | |
| 105 | [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. |
| 106 | |
| 107 | === New Interfaces |
| 108 | |
| 109 | ==== `trac.notification.api.INotificationDistributor` ^[source:trunk/trac/notification/api.py@13454#L29 (1.1.3)]^ #INotificationDistributor |
| 110 | |
| 111 | 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). |
| 112 | |
| 113 | ==== `trac.notification.api.INotificationFormatter` ^[source:trunk/trac/notification/api.py@13454#L46 (1.1.3)]^ #INotificationFormatter |
| 114 | |
| 115 | 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). |
| 116 | |
| 117 | ==== `trac.notification.api.INotificationSubscriber` ^[source:trunk/trac/notification/api.py@13469#L70 (1.1.3)]^ #INotificationSubscriber |
| 118 | |
| 119 | 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). |
| 120 | |
| 121 | ==== `trac.notification.api.IEmailAddressResolver` ^[source:trunk/trac/notification/api.py@13454#L67 (1.1.3)]^ #IEmailAddressResolver |
| 122 | |
| 123 | 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). |
| 124 | |
| 125 | ==== `trac.notification.api.IEmailDecorator` ^[source:trunk/trac/notification/api.py@13454#L79 (1.1.3)]^ #IEmailDecorator |
| 126 | |
| 127 | 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. |
| 128 | |
| 129 | === Notification API Changes |
| 130 | |
| 131 | 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]) |
| 132 | |
| 133 | === Database API Changes |
| 134 | |
| 135 | In Trac 1.1.3 methods have been added to the `DatabaseManager` class for settings and retrieving the database version for Trac and plugins: `set_database_version` and `get_database_version` (#11859). |
| 136 | |
| 137 | In Trac 1.1.5 methods have been added to the `DatabaseManager`class for upgrading the database: `needs_upgrade` and `upgrade`. |
| 138 | |
| 139 | ==== `Environment.get_db_cnx` has been removed in Trac 1.1.2 #get_db_cnx |
| 140 | |
| 141 | Following the [../0.12#get_db_cnx deprecation] made in 0.12, the method `Environment.get_db_cnx` has been removed (#11605). |
| 142 | |
| 143 | One should now only use the //context managers// for retrieving a database Connection in read or write mode. |
| 144 | - a **read-only** Connection can be used to form queries: |
| 145 | {{{#!python |
| 146 | with env.db_query as db: |
| 147 | ... |
| 148 | }}} |
| 149 | a `db` instance obtained the above way should only be used for executing //SELECT// |
| 150 | queries |
| 151 | - a **writable** Connection can be used to modify the database content in a transaction: |
| 152 | {{{#!python |
| 153 | with env.db_transaction as db: |
| 154 | ... |
| 155 | }}} |
| 156 | a `db` instance obtained the above way can be used to execute //INSERT/UPDATE/DELETE// |
| 157 | queries; they will be committed when the last such automatic transaction |
| 158 | in the control flow completes successfully. See DatabaseApi for the full details. |
| 159 | |
| 160 | `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. |
| 161 | |
| 162 | |
| 163 | ==== `db` parameters removed from function and method signatures in Trac 1.1.2 |
| 164 | |
| 165 | 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]. |
| 166 | |
| 167 | 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. |
| 168 | |
| 169 | |
| 170 | ==== `ConnectionBase` class in Trac 1.1.2 |
| 171 | |
| 172 | The `ConnectionBase` class defines an abstract interface that database backends must adhere to when implementing a `Connection` class. |
| 173 | |
| 174 | |
| 175 | === Template and CSS changes in Trac 1.1.2 |
| 176 | |
| 177 | `tt` tags are not supported 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. |
| 178 | |
| 179 | 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. |
| 180 | |
| 181 | === Uncategorized Changes |
| 182 | |
| 183 | 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: |
| 184 | * InterWiki page |
| 185 | * [browser:/trunk/trac/wiki/intertrac.py@13050:50-60#L30] |
| 186 | |
| 187 | Removed the deprecated `authname` parameter from `Environment.get_repository()` in Trac 1.1.3. |
| 188 | |
| 189 | Removed //Since// info from docstrings for Trac < 0.12. |
| 190 | |
| 191 | == New in the 1.2 API |
| 192 | |
| 193 | Be sure to have a look at the new ApiDocs ([http://www.edgewall.org/docs/trac-trunk/html/ for latest trunk]). |
| 194 | |
| 195 | |
| 196 | {{{#!comment |
| 197 | === New Classes |
| 198 | ==== `trac.x.y.ClassName` ^[source:trunk/trac/x/y.py@#Lnum (1.0)]^ #ClassName |
| 199 | |
| 200 | ... |
| 201 | |
| 202 | === Other news |
| 203 | |
| 204 | }}} |