Open gaplyk opened 11 years ago
The whole path resolution thing is in my understanding not working correctly in the Components manager right now.
I'm working on a PR that tries to do the path resolution in a better manner. The key thing is to understand how the inner workings of requirejs path resolution is. Right now Aurajs use the CommonJs pattern for components starting. The layout pattern for the component templates is fine enough, but there are some errors in path resolution as of my findings and the tests I've done. The key approach for me is to understand what Aurajs/arura are trying to achieve when it's setting up the sandboxes. I don't want to break the sandbox handling in my PR.
@gaplyk @VirtueMe Not sure I understand what the issue is. Can you provide an example to reproduce it ?
Aurajs defaults to relative paths, and in my cases this seems not to be the best approach. It works fine inside a CommonJS package, but creates some tension in my aurajs app space. I might be on thin ice, but it has been my experience with my minified aurajs app that you plug into pages on other domains.
Unfortunately i can't share the code of project where I faced with this problem. I'll try to describe: When you have relative path's to the modules requirejs you need always to define extension of files. look on core.js line 298. after I had add '.js' to 'main' (i really didn't want to do this) aura finally start to found all modules entries.
this happen because my index.html and another files placed to the subdirectory, and executing path for example is: http://localhost:8080/AuraSample/index.html
Try to place calendar app in such directories and play with variables relative and baseUrl in config.
@gaplyk , I have made a version I'm testing in my environment. I feel this gives me more control and follows requirejs recommendations better. If you want you can give it a test run. I have made a develop branch in my fork of the repository, you can fetch it here: Virtueme/develop
@VirtueMe Came across this issue today in one of my projects that uses aurajs. Did you manage to find a solid solution?
I think my fork/branch works better, but it's not optimal. It has been in production for a couple of weeks now. It has been some crazy weeks, so I haven't had the time to give Aura and other projects I like the attention they deserve the last month.
When you trying to place index.html and the project to the subdirectory on the server and change path's in config file, it couldn't find some files and templates.
you can try to do this with a calendar app.