Allow template engine overrides with addExtension, with access to the "default" engine#1871
Conversation
zachleat
left a comment
There was a problem hiding this comment.
Love the tidyness of this PR! Very easily reviewable. Just a few very small points!
| } | ||
|
|
||
| async compile(str, inputPath) { | ||
| async compile(str, inputPath, ...args) { |
There was a problem hiding this comment.
What is args used for here? Future compatibility? or are you relying on it somewhere else
There was a problem hiding this comment.
@zachleat Looks like this is necessary actually! The issue is with the defaultRenderer that's getting defined a few lines down.
For instance, the Markdown engine takes in 4 parameters for compile:
compile(str, inputPath, preTemplateEngine, bypassMarkdown)So if your Custom engine is overriding markdown, it'll need to pass these extra args (preTemplateEngine, bypassMarkdown) to the markdown engine. ...args was just a quick way to grab those extra properties. Hope that makes sense!
bb3f02e to
ec9b3f1
Compare
ec9b3f1 to
c4c5455
Compare
|
This will ship with Canary 42, thanks! |
Resolves #1870
☝️ Full description of this change over there!