Coder Social home page Coder Social logo

Don't expose collections directly about todos HOT 8 CLOSED

meteor avatar meteor commented on July 2, 2024
Don't expose collections directly

from todos.

Comments (8)

stubailo avatar stubailo commented on July 2, 2024

@tmeasday do you think this is a good idea? This is in the "building a package" outline.

from todos.

tmeasday avatar tmeasday commented on July 2, 2024

I'm not quite sure what this means in practice. You mean that we wouldn't have a exported symbol called Todos? How would you do queries?

from todos.

stubailo avatar stubailo commented on July 2, 2024

Well the idea is, you would have methods on Todos like: Todos.getInList(listId) instead of Todos.find({ listId: listId })

This way you could switch to another DB more easily? Not sure how realistic it is.

from todos.

tmeasday avatar tmeasday commented on July 2, 2024

My sense is it's too much of a departure from how people typically do things at this point in time.

from todos.

stubailo avatar stubailo commented on July 2, 2024

OK sounds good. It's just something we ran into twice:

  1. When converting Todos to use SQL
  2. When we wanted to change how Accounts worked internally, it was tough that we exposed Meteor.users as an API

from todos.

tmeasday avatar tmeasday commented on July 2, 2024

I think it makes a heap of sense for point 2., but gets to the larger discussion of saying users shouldn't use the users collection...

from todos.

stubailo avatar stubailo commented on July 2, 2024

Yeah but the point still stands that it's too different from what people do now.

from todos.

tmeasday avatar tmeasday commented on July 2, 2024

Yep, put it on the ideas list for guide v2 :)

from todos.

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.