Allow context to be initialised with Any#281
Allow context to be initialised with Any#281adam-fowler wants to merge 7 commits intostencilproject:masterfrom
Conversation
Initialise Context with Any by converting to dictionary Allow Any to be pushed onto a Context in a similar way Change Environment functions to use these new functions
|
This will fix #223 (comment) |
Co-Authored-By: Ilya Puchka <ilyapuchka@gmail.com>
Co-Authored-By: Ilya Puchka <ilyapuchka@gmail.com>
Make init(object:environment) public Co-Authored-By: Ilya Puchka <ilyapuchka@gmail.com>
|
@ilyapuchka Is this getting merged in or do I need another approval? |
djbe
left a comment
There was a problem hiding this comment.
Can we possibly avoid the Mirror(...).asDictionary() bit? Stencil already has quite extensive reflection capabilities for multiple types (when rendering a template).
Co-authored-by: David Jennes <djbe@users.noreply.github.com>
I'll have to have a good look at the code again. It was a wee while ago when I wrote this |
@djbe I had a look through the code again. None of the reflection code seems accessible at this point. Is there function that takes an object and converts it to a |
Given Mirror is being used to serialize objects that are members of the Context dictionary, it only seems logical we shouldn't be limited to initializing a Context with a dictionary. This PR adds the ability to initialize a context with Any
Initialize Context with Any by converting to dictionary
Allow Any to be pushed onto a Context in a similar way
Change Environment functions to use these new functions