Hello,
On 2/27/2016 1:01 AM, RjOllos wrote:
>
> On Friday, February 26, 2016 at 2:18:15 PM UTC-8, Dirk Stöcker wrote:
>
> On Tue, 23 Feb 2016, Christian Boos wrote:
>
> > I've given some thoughts about maintaining a Genshi-compatibility
> layer,
> > but finally decided against it:
>
> Do I understand that correctly? You want to replace the template engine
> with an incompatible new one and instead of operating these two in
> parallel for at least one majore release, you want to drop the old one
> immediatelly?
>
> > That will give a clear signal to the plugin developers, as well as
> > giving them enough time to adapt before 1.4.
>
> Yes - it gives a clear signal: That you don't care about other
> peoples work.
>
>
> As usual your tone is quite unpleasant. People are more likely to care
> about your opinion if you learn to phrase your points better.
Ah, glad to see it's not just me reading it that way ;-) Yes, please
everyone, it would be great to keep a conversation tone where everyone
feels welcome to share her opinion. Nothing has been "voted" upon yet,
so I'm sure we can reach a consensus in what's the best outcome for the
project, its maintainers, plugin developers and users.
So yes, I want to switch to the Jinja2 template engine, this point seems
already consensual, and it's been already the consensus 6 years ago in
the first discussion on the topic (1). What has changed is that now we
have a working branch which is going to be completed (2), and as things
get more concrete we're also presented with a few development choices,
with pros and cons.
Dirk proposes to keep Genshi in parallel for "at least one major
release" (1.3.x - 1.4.x). It's true that we did that when we switched
from ClearSilver to Genshi. For that period, we had to keep telling
people: "yeah, we know we have this and that issue with ClearSilver,
please ask the plugin maintainer to switch to Genshi" and likewise with
ClearSilver related bugs. Do we really want to do the same with Genshi
again? Also, we would have to explain what still works and what no
longer works, as 100% backward compatibility is not possible
(ITemplateStreamFilter will no longer be supported). Having both
template engines coexist is not impossible of course, as this is how
things currently work in the branch, but this mixed situation has to be
compared with the clarity of a clear-cut transition.
Again, I'm not "viscerally" opposed to the idea, but I have to be
convinced that it really makes a difference. I know that for plugins
like the SpamFilter plugin, this would be "great", the Genshi templates
would still work, no changes required, and the plugin can just be used
unmodified. But what happens when 1.5.1 comes around? Same discussion?
We're not going to maintain forever a template engine we don't use in
core and know is problematic, so the necessity to migrate will come
sooner or later. The question is, does it really make such a big
difference if we announce it now, and have people do the migration early
during the 1.3.x time frame, or if we say you'll have till 1.5.x do to it?
>
> Usually plugins are developed to solve a certain problem, not to
> rewrite
> the same code again and again when someone decides that a fancy new
> library is again better than the last one. Genshi also was so much
> better
> than the previous one.
>
>
> The migration to Jinja2 solves two real problems:
> - Performance
> - Genshi is no longer producing releases
>
> Additionally Jinja2 is much more widely adopted. It's not simply
> "deciding a fancy new library is again better than the last one". You
> should take a look at the performance numbers Christian has produced and
> the detailed migration notes he has already prepared. This migration
> solves several real problems and the amount of effort he has put into
> documentation demonstrates that he clearly does care about helping users
> migrate.
>
Yes, I think so far no one really spoke against the migration and we all
see the benefits. I do what I can to prepare for a smooth transition. I
even found yesterday that making the tag builder API replacement in
trac.util.html compatible again with the Genshi templates was not as
problematic as I initially thought. So now on the branch the remaining
Genshi templates work again.
I will continue to refactor trac.web.chrome to more cleanly separate the
Genshi legacy support from the new code. An intermediate goal will be to
make Genshi an *optional* package, i.e. Trac should be able to work
fully without Genshi installed.
> Compatibility is not a nuisance, it's required for acceptance.
>
>
> Sometimes the ideal solution is not always practical. There will likely
> be more than a year of pre-releases over which time plugins can be made
> compatible. Maybe that's not a perfect solution, but a year is quite a
> bit of time to plan your transition.
I hope that after a few more exchanges we will be able to figure out the
right approach, a clear severance between Trac and Genshi, or a
middle-of-the-road approach, with Genshi templates still supported for a
while in a "low profile" maintenance mode (i.e. if something's broken,
tell people to migrate away from Genshi), and what's the appropriate
time frame for either.
But compatibility *will* be challenged, that's what happens with live
software projects and I do hope we still count Trac as a live software
project ;-) Genshi vs. Jinja2 is by far not the only compatibility
concern for plugins in future versions. With Trac 1.3.x, I also support
the proposal (made initially by Ryan? or me?) that we drop Python 2.6
compatibility and focus on Python 2.7. If we can merge in support for
Python 3.5, all the better. We'll also pick at some point jQuery 3.0.
And switch from XHTML to HTML5 (also more or less part of the jinja2
branch, btw). And yes, our data model still sucks and is eventually
going to change radically one day. I can already here the "you're going
to break *all* plugins with such a change!" criticisms. Well, yes, but
we can keep that one for a future discussion ;-)
-- Christian
(1) -
http://groups.google.com/group/trac-dev/msg/fc8d8c0447140110
(2) current output of python contrib/jinjastats.py:
58.54% converted to Jinja2 (5067 Jinja2 lines corresponding to 3861
Genshi lines on a total of 6596 Genshi lines)
Yes, it looks like the way I write Jinja2 templates results in templates
being 30% more verbose than their Genshi counterparts, but I think we
also gain in clarity (and also I stick now to < 80 chars per line most
of the time).