{{{#!div style="float: right; margin: 0 1em" ← [../1.0] | [../1.3] → }}} = Documenting API changes in 1.1.x {{{#!box info 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. These notes reflect the cumulative changes that occurred during the 1.1.x development cycle, and therefore the current status for [milestone:1.2]. No API changes are expected to occur on the [source:branches/1.2-stable] branch. }}} [[PageOutline(2-4,Summary,inline)]] == Prerequisites **Only Python versions 2.6 and 2.7 are supported.** === Modified Dependencies ==== jQuery and jQuery UI (bundled) The bundled version of [http://jquery.com jQuery] was updated from 1.7.2 in Trac 1.0-stable to: * [https://blog.jquery.com/2012/09/20/jquery-1-8-2-released 1.8.2] in Trac 1.1.1 (#10976) * [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) 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. 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: * [https://jqueryui.com/docs/Changelog/1.9.2 1.9.2] in Trac 1.1.1 (#10976) * [https://jqueryui.com/docs/Changelog/1.11.4 1.11.4] in Trac 1.2 (#11019) ==== Babel (optional) The internationalization support (i18) for Trac is depending on [http://babel.edgewall.org/ Babel], >= 0.9.5 is supported. ==== Genshi (mandatory) Genshi 0.6 and 0.7 are supported. ==== Databases |||| **Database** || || SQLite || >= 3.0 || || PostgreSQL || >= 8.0 || || MySQL / MariaDB || >= 5.0 || |||| **Database Bindings** || || pysqlite || >= 2.4.1 (version provided by Python 2.6), avoid 2.5.2 - 2.5.4 || || psycopg2 || >= 2.0 || || MySQLdb || >= 1.2.2 || ==== Other || **Package** || **Req or Opt?** || **Version supported** || || SetupTools || Required || >= 0.6, 5.4 - 5.6 are not recommended. || || Git || Optional || >= 1.5.6 || || Subversion || Optional || >= 1.6 || || !DocUtils || Optional || >= 0.3.9 || || Textile || Optional || >= 2.0 || || 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] || Please add any dependencies overlooked. `ConfigObj` is no longer a required dependency for the `AuthzPolicy` permission policy (`tracopt.perm.authz_policy`) since Trac 1.1.5. === Deprecated Modules Removed Removed Enscript, SilverCity and PHP renderers in Trac 1.1.3. (#11795) === New Dependencies [pypi:passlib] is needed to decode some `htpasswd` formats on Windows, replacing the `fcrypt` package. == Detailed List of Developer Visible Changes #list === In Trac 1.1.1 [[TicketQuery(milestone=1.1.1,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] === In Trac 1.1.2 [[TicketQuery(milestone=1.1.2,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] === In Trac 1.1.3 [[TicketQuery(milestone=1.1.3,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] === In Trac 1.1.4 [[TicketQuery(milestone=1.1.4,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] === In Trac 1.1.5 [[TicketQuery(milestone=1.1.5,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] === In Trac 1.1.6 [[TicketQuery(milestone=1.1.6,status=closed,apichanges!=,col=summary,rows=apichanges,group=component,format=table)]] == Other Modifications made to the 1.0 API === Modified Interfaces ==== `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 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. ==== `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 [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. === New Interfaces ==== `trac.notification.api.INotificationDistributor` ^[source:trunk/trac/notification/api.py@13454#L29 (1.1.3)]^ #INotificationDistributor 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). ==== `trac.notification.api.INotificationFormatter` ^[source:trunk/trac/notification/api.py@13454#L46 (1.1.3)]^ #INotificationFormatter 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). ==== `trac.notification.api.INotificationSubscriber` ^[source:trunk/trac/notification/api.py@13469#L70 (1.1.3)]^ #INotificationSubscriber 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). ==== `trac.notification.api.IEmailAddressResolver` ^[source:trunk/trac/notification/api.py@13454#L67 (1.1.3)]^ #IEmailAddressResolver 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). ==== `trac.notification.api.IEmailDecorator` ^[source:trunk/trac/notification/api.py@13454#L79 (1.1.3)]^ #IEmailDecorator 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. === Notification API Changes 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]) === Database API Changes 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). In Trac 1.1.5 methods have been added to the `DatabaseManager`class for upgrading the database: `needs_upgrade` and `upgrade`. ==== `Environment.get_db_cnx` has been removed in Trac 1.1.2 #get_db_cnx Following the [../0.12#get_db_cnx deprecation] made in 0.12, the method `Environment.get_db_cnx` has been removed (#11605). One should now only use the //context managers// for retrieving a database Connection in read or write mode. - a **read-only** Connection can be used to form queries: {{{#!python with env.db_query as db: ... }}} a `db` instance obtained the above way should only be used for executing //SELECT// queries - a **writable** Connection can be used to modify the database content in a transaction: {{{#!python with env.db_transaction as db: ... }}} a `db` instance obtained the above way can be used to execute //INSERT/UPDATE/DELETE// queries; they will be committed when the last such automatic transaction in the control flow completes successfully. See DatabaseApi for the full details. `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. ==== `db` parameters removed from function and method signatures in Trac 1.1.2 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]. 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. ==== `ConnectionBase` class in Trac 1.1.2 The `ConnectionBase` class defines an abstract interface that database backends must adhere to when implementing a `Connection` class. === Template and CSS changes in Trac 1.1.2 `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. 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. === Uncategorized Changes 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: * InterWiki page * [browser:/trunk/trac/wiki/intertrac.py@13050:50-60#L30] Removed the deprecated `authname` parameter from `Environment.get_repository()` in Trac 1.1.3. Removed //Since// info from docstrings for Trac < 0.12. == New in the 1.1 API Be sure to have a look at the new ApiDocs ([http://www.edgewall.org/docs/trac-trunk/html/ for latest trunk]). {{{#!comment === New Classes ==== `trac.x.y.ClassName` ^[source:trunk/trac/x/y.py@#Lnum (1.0)]^ #ClassName ... === Other news }}}