-
Notifications
You must be signed in to change notification settings - Fork 312
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
modelUtils - hardcoded typePath #493
Comments
Hey, I'll start from the end. As for proposed structure, for me it looks very similar to:
Which allows better comparability and it will be easier for different kind of bundlers (not only requirejs). And regular It still might require to modify Rendr, but it should be more along with the way everything else works in node. And I think it's possible to make it backwards compatible. For example if "first folder" in the path doesn't exist, try to resolve it as node module. Sidenote: I'm working on new bundler for requirejs, that will make it much easier to have separate bundles with existing structure. But it's more somewhat short-term solution before we have everything in separate node module. – https://www.npmjs.com/package/multibundle (still work in progress) |
Thanks @alexindigo great suggestions. I was thinking of breaking into node_modules as a second step but if we need to modify rendr to accomplish this, you may be right that the best way to break it up would be to look into the node_modules path to help modularize as we were discussing previously. I'l take a look at this sometime this week some. I have a feeling there will be more complications than model utils putting things into node_modules now, but I think it's the best approach for the future. 😄 |
Hi guys,
I'm trying to restructure our app in a way that would be more conducive to require js bundling.
What I'd like to do is have this structure:
I personally feel this structure will make the requirejs bundling much cleaner and it could help with making things more componentized so that people could more easily share code.
However, modelUtils is currently hardcoding
typePath
with the app on the front as:https://github.com/rendrjs/rendr/blob/master/shared/modelUtils.js
It doesn't seem like there's a really simple way to workaround this without breaking changes.
One idea is to allow passing in a forward slash so a model could have the name:
/bundle1/model_name
and thengetFullPath
in modelUtils could look for that and not prepend app, but that's pretty ugly and a patch.Any thoughts on this?
The text was updated successfully, but these errors were encountered: