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

Merged
merged 1 commit into from
Nov 4, 2024

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

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
@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 2, 2024
@smnandre smnandre force-pushed the twig/twig-prelexer-optimizations branch from a848722 to 9ec2a71 Compare November 4, 2024 01:08
@smnandre smnandre merged commit 65e59d1 into symfony:2.x Nov 4, 2024
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer TwigComponent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants