-
Notifications
You must be signed in to change notification settings - Fork 57
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
reimplement process using native #754
Comments
Can we at the same time add |
Well I guess, if you know how to implement those sensibly for JavaScript. But please don't make them methods. |
Assigning to you, @quintesse, because I think you already started work on it. |
No way we can do this now. And who knows if ever, because it would entail removing all of the model loaders from the backend compilers and put them somewhere central ( |
Completely finished code for |
@quintesse see on gitter where I just proposed an extremely simple solution to the problem. |
Well no, gitter is not the right place to document what should be done in issues. So I'll sum it up here: Why doesn't the exact same problem happen for native("js") module imports when compiling on the JVM? I'm pretty sure we have the same problem reversed. We "just" have to have a minimal "module/model loader" that knows how to extract 1/ module imports (we already have that in the CMR) and 2/ packages from modules for other backends then by scanning module imports of other backends (native("jvm") from the js compiler for example), we can see if the package belongs there for the JVM that's pretty trivial to scan the jar I bet it's easy for the JS archives too and yes we can cache that, I expect the problem to only come up in rare cases, and only pay there. So for instance if we find that we have a missing package, check if we have native module imports for other backends, and then load them to check if the package doesn't come from there. That's the real issue we're trying to fix, right? The CMR already knows how to load module imports for any backend: JS/JVM/POM/OSGi/JBossModules. All it needs is to be augmented to also load the package lists. |
No, because there is no thing as a "legacy JS module", if you want to use existing JS code you use Edit: but that is obviously a hack, so having the possibility to get the real list would definitely improve the situation!
And it would need to be factored out of the CMR and be generally available, otherwise this wouldn't work when dealing with a flat classpath (AFAIK at least). |
OK that's true. Although, can't we also import node.js modules?
No, even the flat classpath stuff uses the CMR for module info loading. |
As I said on IRC, this would be a lot more expensive than annotating the package import, and would not scale well to other backends as loading all module imports for Now, @gavinking said that we'd need package imports to be given a type in the metamodel since that's how annotations are constrained, but I think that's fine since that can just be an empty interface with no runtime instance, as module imports are not reified at runtime. |
I don't know, can we? That would be cool but I've never seen any code doing that. |
I think we can, at least I'm doing it in testjs, see 2015-10-07 16:28 GMT+02:00 Tako Schotanus notifications@github.com:
|
@thradec well yes, but that's runtime, the compiler doesn't know anything about that :) Edit: meaning you don't import it in the module descriptor, nor do you add any import statements in the code. But it's nice to see how easy it is to load Node.js modules! |
We can interop with node or common JS modules, but that is always using |
We have done
system
,operatingSystem
, and nowruntime
. I need a volunteer to doprocess
.The text was updated successfully, but these errors were encountered: