Skip to content

Add float type to the raw method. Added a test for the raw method#12

Closed
yurikuzn wants to merge 6 commits intodevtheorem:masterfrom
yurikuzn:master
Closed

Add float type to the raw method. Added a test for the raw method#12
yurikuzn wants to merge 6 commits intodevtheorem:masterfrom
yurikuzn:master

Conversation

@yurikuzn
Copy link
Contributor

Resolves #11.

theodorejb and others added 6 commits March 11, 2026 17:39
This is an internal class which shouldn't be part of the public API.
The `helpers` compilation option has been removed, and all helpers must now be passed at runtime when executing the template (just like in Handlebars.js).

This can significantly reduce compile time, since PHP files no longer have to be read and tokenized to extract helper functions. It also enables sharing helper closures across multiple templates, and removes limitations on what they can access and do.

Additionally, implemented `knownHelpers` option and updated `knownHelpersOnly` to work the same as in Handlebars.js. This now makes it possible to disable individual built-in helpers.

Also unified partial closures and improved param types. Compiled templates and partials now have the same function signature to avoid duplicated logic. Memory usage when running tests decreased from 20 MB to 18 MB.
This can double runtime performance for complex templates with conditions in nested loops.
@theodorejb
Copy link
Collaborator

Thank you for filing the issue and working on a fix.

I ended up resolving and testing the issue in a slightly different way (see 6069dc4), but I appreciate the effort you put into this and I hope you will contribute again in the future!

The fix will be released soon as part of v1.0.

@theodorejb theodorejb closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method Runtime::raw does not accept float value

2 participants