Git Product home page Git Product logo

Comments (9)

jasisk avatar jasisk commented on July 3, 2024

Hi tkambler,

Yes, 4.0 is a breaking change and I've not yet updated the documentation—that's my mistake.

Meddleware 4.0 introduced a new pattern of mounting on a router to avoid having to normalize routes the way we were.

There are a few things that it will break—mountpaths now work the way they do everywhere else in express, but was previously different in meddleware. Error-handling middleware is another thing that will work differently.

I'll take a look at your example and get back to you.

from meddleware.

jasisk avatar jasisk commented on July 3, 2024

I'm seeing mount fire. If you're on OS X:

$ npm ex meddleware -- "sed -i '' '/function onmount/a\\'$'\\n''console.log(\"mounted\");' index.js" && node ./bin/index.js
Initializing Confit with configuration directory: /Users/jsisk/Downloads/test/config
ping route loaded
middleware { enrouten:
   { enabled: true,
     priority: 30,
     module: { name: 'express-enrouten', arguments: [Object] } } }
mounted
ready
App listening on port: 7025
404 - Cannot GET /api/v1/ping

Will keep exploring.

from meddleware.

jasisk avatar jasisk commented on July 3, 2024

Ok, I see the problem—I misunderstood what you were saying before.

You're absolutely right. The problem is that enrouten's onmount isn't fired. This is because meddleware is now a router instance, instead of an app instance. router instances have no analogy to app instances mount event.

I'll have to investigate how to resolve this issue. In the meantime, I recommend you move down to ^3.0.0. If I'm unable to find a clean solution in a timely manner, I may simple deprecate 4.0.0 for now.

Thanks for bringing this to our attention—meant to spend some time on 4.x this week, you just moved it up on my list by a few items. :)

from meddleware.

tkambler avatar tkambler commented on July 3, 2024

What's the status on this? This bit me again for a brief moment, before I realized I'd run into this before. IMO, 4.0 should be unpublished and re-published as a -beta release. It's clearly not done.

from meddleware.

jasisk avatar jasisk commented on July 3, 2024

Hey @tkambler,

4.0.0 was deprecated when we spoke last. How are you installing it, exactly?

from meddleware.

tkambler avatar tkambler commented on July 3, 2024

$ npm install meddleware --save

from meddleware.

jasisk avatar jasisk commented on July 3, 2024

It is most certainly deprecated—are you certain you're pulling version 4.0.0?

❯ npm install --save meddleware
[email protected] /tmp/meddleware-test
└─┬ [email protected]
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   └── [email protected]
  ├── [email protected]
  └── [email protected]

from meddleware.

tkambler avatar tkambler commented on July 3, 2024

The problem seems to be a result of my using a private npm server (Sinopia). Apparently I installed meddleware at a time when v4 was not deprecated, which Sinopia cached (as desired). Anything you may have deprecated after that time was not picked up by the cache, however. Removing the cached version from Sinopia fixed the issue.

Sorry for the trouble.

from meddleware.

jasisk avatar jasisk commented on July 3, 2024

No trouble at all. Glad it all worked out.

from meddleware.

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.