Comments (9)
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.
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.
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.
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.
Hey @tkambler,
4.0.0 was deprecated when we spoke last. How are you installing it, exactly?
from meddleware.
$ npm install meddleware --save
from meddleware.
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.
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.
No trouble at all. Glad it all worked out.
from meddleware.
Related Issues (20)
- Route on middleware not working HOT 6
- Backport route regex support for v1.x?
- Events not fired properly HOT 5
- normalize the config `module` property
- add array support for the `route` property HOT 1
- `mountpath` isn't always a string HOT 4
- Enabled toggle in flow controlled sections changed HOT 3
- `util#mapValues` `prop.name` won't ever exist
- `module.name` is not required? HOT 1
- Passing object to middleware HOT 1
- Can we support async middleware factories? HOT 5
- Register middleware based on HTTP method HOT 3
- Deprecate RQ for parallelism HOT 1
- Why is the configuration an object instead of an array of objects?
- edge case bug in the local path resolver HOT 1
- npm5 issue HOT 1
- How can I have an environment-controllable value that defaults to true? HOT 3
- meddleware broken with config v.3.0
- if modulePath is undefined, the require might resolve relative path from config wrongly HOT 1
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 meddleware.