freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasper Rosenberg (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FREEMARKER-60) Document interaction between lazy import and #global
Date Wed, 05 Jul 2017 00:05:00 GMT

    [ https://issues.apache.org/jira/browse/FREEMARKER-60?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074122#comment-16074122
] 

Jasper Rosenberg commented on FREEMARKER-60:
--------------------------------------------

In my case, all my globals were in the same file, so I could just switch it to an include
to have the same effect (and switch them to #assign as well since the would no longer be namespaced.)
 The only reason I tried global + import was consistency in how I'm trying to reorganize our
very large freemarker macro/function collection into layered libraries (util, domain, etc)
with a clear dependency tree.  Unfortunately, I haven't been able to figure out a way to do
the later (other than a post-process namespace usage check).  That is probably a question
better asked in a different venue though.  Thanks!

> Document interaction between lazy import and #global
> ----------------------------------------------------
>
>                 Key: FREEMARKER-60
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-60
>             Project: Apache Freemarker
>          Issue Type: Improvement
>          Components: documentation
>    Affects Versions: 2.3.26-incubating
>            Reporter: Jasper Rosenberg
>            Priority: Trivial
>
> If I am understanding what is going on correctly, it appears that when you turn on lazy
imports, #global variables defined in that file will not be defined unless something else
first accesses the imported file's namespace.  This is a bit of a weird case so it might just
be worth documenting.
> Alternatively, you could say that if you have #global variables defined in a file it
disqualifies it from being lazily imported.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message