Giter VIP home page Giter VIP logo

Comments (2)

alexindigo avatar alexindigo commented on August 30, 2024

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.

crwang avatar crwang commented on August 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.