Code Monkey home page Code Monkey logo

Comments (9)

tj avatar tj commented on March 29, 2024

for the most part subapps won't collide, if people build subapps that are meant to be mounted to any application I'd definitely suggest that they shouldn't be doing prototype manipulation anyway so I think we can skip that part. It's tempting to even remove app.context() for now and just encourage modularity via foo(this), it's not super pretty but neither is global stuff I suppose yield parse(this) vs yield this.parse() sort of deal

from koa.

jonathanong avatar jonathanong commented on March 29, 2024

Ah yeah. It's easier to just do wrap(app) at this point. I'm all for removing app.context()

from koa.

tj avatar tj commented on March 29, 2024

k sweet let's do that for now

from koa.

tj avatar tj commented on March 29, 2024

consensus for now is to assume protos are nice enough to use without extending for now haha

from koa.

jonathanong avatar jonathanong commented on March 29, 2024

ohhh you can't extend at all now. i still want to extend it. i just think modules should extend it from require('module')(app) instead of app.context(require('module')) or app.mixin(require('module')).

from koa.

tj avatar tj commented on March 29, 2024

I think it's an anti-pattern, a tempting one, but definitely an anti-pattern, tough call but I'd rather leave it out completely for now

from koa.

tj avatar tj commented on March 29, 2024

at least until everything else is well defined and finished, maybe after 0.1.0

from koa.

jonathanong avatar jonathanong commented on March 29, 2024

I think it's an anti pattern if users rely on it, but it's fine for extending koa. I would make it private. It would be annoying to do things like yield body(this)

from koa.

tj avatar tj commented on March 29, 2024

that's annoying but it's also annoying to hunt down where these magical methods are coming from if you're unfamiliar with the app, but ugly indeed

from koa.

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.