-
Notifications
You must be signed in to change notification settings - Fork 235
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
Implement tree import of modules. #497
Comments
The tools now support multi-part paths. To use that, you will need to update the Moddable SDK and rebuild tools. The Keeping Up To Date document explains how to do that. |
Woww. that is eficiency. I will see if I can upgrade this afternoon.. By the way ... does it import all the subtree or just one level? I mean if I have aral/util and aral/componentes, would I need to create
Or would it be enough with ...
|
Thanks for giving it a try. FYI - The module wildcard applies to one level. It is not recursive. While it would be convenient to have recursive imports for very large projects, properly supporting them is not trivial and so we don't intend to support recursive imports at this time. |
OK, it is no a problem to import each subdir. It may be even convenient (so you don't forget what you are exactly using). I will try to update my moddable sdk install and a test it, and will feed back (I could not do it yesterday): |
I have updated moddable using the instructions, pulling from git, deleting build bin and tmp content and rbuillt moddable. I have changed the manifest to this:
and the import statement to this:
And got the eror again: |
Any update on this? I have tried it but it does not work yet. |
The feature is working as expected. Please see the example here. |
I am getting mad with this. I have tried to test the example you provided, but I continue getting an error: I have checked every thing I could think of. May be it is a windows bug? I have tried your example using the host integrated in one file (in the app directory as in your example) and creating a host (extracted from ch1 of your book it is in host directory) and a separate app to run with mcrun (in the test directory). Neither of them work. UPDATED: Chris has confirmed that it does not work in his windows environment either (in a conversation in gitter). |
It looks like the |
mcconfig? mcconfig runs and flashes the firmware. I have run and flashed other software from the examples and the iot bood. It is only when I try to use the import in multi level tree when there is an error, and it is thrown after mcconfig is launched and running, is the mcconfig process the one that trows the error. In the Example proyect I have put, if I use multiple branch tree (in directory test) it does not work, If I use just one level it works (othertest). |
Perhaps the change to |
Yes, it seems it is platform related. I suspect that the function you use may be using to detect the / is changing it by \ in windows or something like that (interpreting the string as a directory). @cmidgley has tested it with the same results and he is using windows too. I am stuck with this problem and the check module not been loaded. |
This issue is about multi-part module specifiers. The |
Yes, you are right, sorry, it seems another problem (I am sure that the problem is my manifest, in that case). |
A fix has been committed for this on Windows. To try it:
|
I have upgraded moddable and tried. Thank you very much for the fix. I close the issue now, as it is solved (I am not sure if I should close or I should let you that task). |
Wahoo! Thank you for your patience. The cross-platform differences sometimes obscure problems. Once you have confirmed a problem is resolved, it is helpful to close the issue. Thanks for doing that. |
It seems that you cannot use a path with more than one level (nested path) in the modules section of a manifest.
I mean something like:
In order to be able to use imports in code like:
import Tool from "aral/util/tool"
If you try to use it, when you run mcrun you get an error (not very useful error, as it does not provide any hint about where it comes from).
It seems that mcrun does not interpret paths with more than one level.
A workaround (provided by @phoddie) is to use this instead:
import Tool from "aral_util/tool"
But it is ugly not to have standard import paths.
The text was updated successfully, but these errors were encountered: