Lazy loading model for module imports#4481
Conversation
|
SonarCloud Quality Gate failed. |
|
Great work! Being non-native, I find the term "lazily" quite hard to remember, I think I see "lazy" more often, is shorter and IMO more clear whilst still correct? |
| String query = | ||
| "xquery version \"1.0\";\n" + | ||
| "declare namespace transform=\"http://exist-db.org/xquery/transform\";\n" + | ||
| "import module namespace transform=\"http://exist-db.org/xquery/transform\";\n" + |
|
Great work! @adamretter are we completely sure that the code is backwards compatible? This line might show something different? (not sure) is this PR a v7 candidate ? will old code still work? |
@dizzzz "lazily" is the adverb (modifies a verb), whilst "lazy" is the adjective (describes a state). In this instance I think it makes sense, although for sure my English is not perfect either! We can change it if you still want us to? Perhaps @joewiz has an opinion on this? |
|
I see benefits in standardizing on "lazy". Now the code has instances of both "lazy" and "lazily" (but only "eager" - not "eagerly" - instead "always"). Standardizing on just "lazy" and "eager" (and doing away with "lazily" and "always") would probably prevent people mixing up the different verb forms/words on their code/configurations. |
| import module namespace test = "http://exist-db.org/xquery/xqsuite" | ||
| at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql"; | ||
|
|
||
| import module namespace inspect = "http://exist-db.org/xquery/inspection"; |
There was a problem hiding this comment.
This change is a clear hint that this constitutes a breaking change.
Library and main modules that use one of the functions in the inspect namespace will no longer function until they are imported.
line-o
left a comment
There was a problem hiding this comment.
If I understand this PR correctly each module with load=lazy needs to imported explicitly in any module that wants to use them. Looking at the list where this is applied - like lucene, http-client, security-manager to name a few - this will create a lot of work on any library and app that is doing a little more than showing static content.
I believe we need to discuss the modules that are lazy-loaded by default.
For this to be merged into 6.x.x my answer would be: none.
3c6c672 to
fa3125c
Compare
@joewiz We have now switched this to |
@line-o Sure, the target for this is eXist-db 7.0.0. |
|
SonarCloud Quality Gate failed. |
fa3125c to
18a3beb
Compare
18a3beb to
dba3da3
Compare
|
Tests are failing |
…rds compatibility
dba3da3 to
99fb337
Compare
|
SonarCloud Quality Gate failed. |










This PR fixes #1848 by allowing the user to configure which modules should be loaded lazily.
It adds a new attribute
loadon themoduleelement ofconf.xml. If unspecified, modules are loaded automatically (i.e. eagerly) to maintain backwards compatibility with the previous eXist-db mode of operation.The
exist-distributionconfig file was updated to take advantage of this new feature. Only those modules that are deemed as required by eXist-db's XQSuite tests and Apps are loaded by default. Other modules can be loaded withimport module namespace, for example:This open source contribution to the eXist-db project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.