-
-
Notifications
You must be signed in to change notification settings - Fork 190
Lazy loading model for module imports #4481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
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" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting change.....
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not lazily omit the documentation that shows the new need for explicit import, that makes this a major release candidate.
Should also be rebased to get some fresh ci results
This PR fixes #1848 by allowing the user to configure which modules should be loaded lazily.
It adds a new attribute
load
on themodule
element 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-distribution
config 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/.