Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TwigComponent] Optimize TwigPreLexer #2316

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented Nov 1, 2024

Q A
Bug fix? no
New feature? no
Issues Fix #...
License MIT

Refactor the following methods:

  • check
  • consume
  • consumeComponentName
  • consumeUntil
  • consumeWhitespace

Remove the following methods:

  • addDefaultBlock
  • consumeAttributeName
  • doesStringEventuallyExist

Refactor the following methods:
* `check`
* `consume`
* `consumeComponentName`
* `consumeUntil`
* `consumeWhitespace`

Remove the following methods:
* `doesStringEventuallyExist`
* `consumeAttributeName`
Copy link
Collaborator

@WebMamba WebMamba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Simon! Maybe this is it out of scope of this PR, but what do you think to cache the PreLexer result ? Maybe we can do that in the ComponentLexer

@smnandre
Copy link
Member Author

smnandre commented Nov 1, 2024

Hey Simon! Maybe this is it out of scope of this PR, but what do you think to cache the PreLexer result ? Maybe we can do that in the ComponentLexer

I don't think we need to:

  • in prod all templates are cached
  • in dev, the lexer will be called only when the template changed (so we cannot use cache then)

@smnandre smnandre requested review from Kocal and kbond November 2, 2024 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants