Task #7345

Split up TS processors into separate classes

Added by Karsten Dambekalns over 5 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2010-06-10
Priority:Could have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:-
Target version:- Estimated time:5.00 hours

Description

Due to Fluid view helper architecture we need to split the TS processors into separate classes.

7345_v1.patch Magnifier (23 kB) Bastian Waidelich, 2010-06-11 16:35

7345_v2.patch Magnifier (187.3 kB) Bastian Waidelich, 2010-06-22 14:22

TypoScriptTestSite.zip (5.7 kB) Bastian Waidelich, 2010-06-22 18:50


Related issues

related to Base Distribution - Story #7143: As a WebsiteUser I want to see a simple website. Resolved
related to TYPO3.TypoScript - Bug #8439: Fix Namespace support in processor notation Resolved 2010-06-22
related to TYPO3.TypoScript - Task #8575: Exception on wrong processing instruction misleading Closed
blocked by TYPO3.TypoScript - Feature #8440: Add support for named parameters for TS processors Resolved 2010-06-22

History

#1 Updated by Robert Lemke about 5 years ago

  • Priority changed from Should have to Could have

#2 Updated by Karsten Dambekalns about 5 years ago

  • Target version changed from 518 to 550

#3 Updated by Bastian Waidelich about 5 years ago

  • Assigned To set to Bastian Waidelich
  • Start date set to 2010-06-10
  • Estimated time set to 2.00

#4 Updated by Karsten Dambekalns about 5 years ago

  • Status changed from New to Accepted

#5 Updated by Bastian Waidelich about 5 years ago

  • File 7345_v1.patchMagnifier added
  • Status changed from Accepted to Needs Feedback
  • Estimated time changed from 2.00 to 3.00

I started by moving the crop processor. Can you please have a quick look at the patch to see if it's the way you imagined. Especially

$cropProcessor->setSubject('Foo');
$cropProcessor->setMaximumNumberOfCharacters(15);
$cropProcessor->setPreOrSuffixString('...');
$result = $cropProcessor->render();

vs

$cropProcessor->render('Foo', 15, '...');

Thanks

#6 Updated by Robert Lemke about 5 years ago

  • Status changed from Needs Feedback to Accepted

Thanks for your patch, Bastian!

As discussed in yesterday's Daily Scrum we should - for now - not split up processors into separate classes but do introduce named parameters and provide a common interface with a render() method. Therefore I didn't look into this patch more closely ...

#7 Updated by Bastian Waidelich about 5 years ago

Update: we decided now to do split up the processors into separate classes to test if it has a big impact on performance and memory.
Additionally parameters will be named, so instead of:

page.title << 1.crop(10)

you'll write
page.title << 1.crop(maximumNumberOfCharacters: 15)

That might seem cumbersome, but it's more flexible - especially if you have a lot of parameters. Additionally it's in sync with the Fluid ViewHelper syntax.

#8 Updated by Bastian Waidelich about 5 years ago

  • File 7345_v2.patchMagnifier added
  • Status changed from Accepted to Needs Feedback
  • Estimated time changed from 3.00 to 5.00

The attached patch (7345_v2.patch) splits all processors into classes and adjusts the parser accordingly.
Additionally this patch introduces named processor arguments (#8440) as this was a requirement for the new processor calls.
Last but not least this fixes the processor namespace support that was broken since the new namespace syntax (#8439)

#9 Updated by Bastian Waidelich about 5 years ago

Attached is a simple test site, that uses most of the TS processors and displays the rendering time.
You can import it through the new TYPO3 setup controller.
After applying the patch, rename Root.ts2 to Root.ts2.old and Root.ts2.new to Root.ts2 in TypoScriptTestSite/Resources/Private/TypoScripts/homepage/ in order to test this.
My test results (on Windows7):

unpatched version DEVELOPMENT context
0,03863 seconds

unpatched version PRODUCTION context
0,04566 seconds

patched version DEVELOPMENT context
0,03938 seconds

patched version PRODUCTION context
0,04099 seconds

all numbers are average values of 5 runs.
-> the differences are not too big for this simple test case. Strangely processing seems to be slower in production context. And the patched version is slightly faster in production context.

#10 Updated by Robert Lemke about 5 years ago

  • Status changed from Needs Feedback to Accepted

Looks good (just read it), please commit and I'll test it again ...

#11 Updated by Robert Lemke about 5 years ago

  • % Done changed from 0 to 90

#12 Updated by Bastian Waidelich about 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 90 to 100

Appplied in ChangeSet r4725

#13 Updated by Robert Lemke about 4 years ago

  • Project changed from Core Team to Base Distribution
  • Target version deleted (550)
  • Remaining (hours) set to 5.0

#14 Updated by Robert Lemke almost 3 years ago

  • Project changed from Base Distribution to TYPO3.Neos

Also available in: Atom PDF