Comments (2)
Hey,
Nice to see you thinking about future of Rendr.
I'll start from the end.
I've been there – starting things with /
that are not the root of the FS, it's a slippery slope, leads to many bugs and much confusion (in node and in the browser). I found that sticking to the AMD narrative of having baseUrl
and not using leading /
is much saner approach.
As for proposed structure, for me it looks very similar to:
├─┬ app
│ ├── collections
│ ├── controllers
│ ├── lib
│ ├── models
│ ├── templates
│ ├── views
│ │
│ ├─┬ node_modules
│ │ ├─┬ bundle1
│ │ │ ├── collections
│ │ │ ├── controllers
│ │ │ ├── lib
│ │ │ ├── models
│ │ │ ├── templates
│ │ │ └── views
│ │ │
│ │ └─┬ bundle2
│ │ ├── collections
│ │ ├── controllers
│ │ ├── lib
│ │ ├── models
│ │ ├── templates
│ │ └── views
Which allows better comparability and it will be easier for different kind of bundlers (not only requirejs).
And regular require('bundle1/controllers/my_controller.js')
would work. And it will allow to have separate code bases, versioning and all the goodies that big (multi-bundle) projects need.
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)
from rendr.
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. 😄
from rendr.
Related Issues (20)
- Rendr, Grunt and Browserify HOT 9
- Lazy view with fetch_params HOT 2
- jquery selector not working on events HOT 3
- Jquery .val() undefined HOT 2
- Improvement in release process HOT 20
- On client-load, _block subviews don't get their passed-in model. HOT 2
- how to pass model to subview HOT 4
- LocalStorage is not defined in the controller HOT 1
- Using gulp with rendr
- Render App.router.currentView is undefined HOT 1
- Rendr + jspm HOT 2
- Is this still used in production of airbnb or anywhere? HOT 2
- Unnecessary server sessions [fix] HOT 2
- setting writeToCache: false still writes models to cache HOT 1
- Debugging an Example app HOT 1
- Store some data which is loaded first time via API?
- how to run derbyjs without mongo? HOT 2
- 1 vulnerability found by nsp
- Handling model Error if one model fail to give data in controller HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rendr.