Skip to content

Commit c544753

Browse files
committed
v1.2
* Deprecation * Deprecation notice on server start * Added instantiation compatible with Meteor 3 for potential future use
1 parent d881f81 commit c544753

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v1.2.0 - 2024-05-04
4+
* Deprecating the package as from Meteor 3.0 onwards it is no longer needed. You can use express in Meteor 3 via the WebApp package and do routing like you would with Picker.
5+
* Added instance setup for Meteor 3 in case we move towards compatibility version.
6+
* Updated `path-to-regexp` to v6.2.2
7+
38
## v1.1.1 - 2022-5-07
49
* Updated tests to use `fetch`
510
* Updated `path-to-regexp` to v6.2.1

lib/implementation.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { pathToRegexp } from 'path-to-regexp';
2-
// TODO replace fibers
2+
// TODO remove fibers
33
import Fiber from 'fibers';
44

55
function parseQuery(queryString) {
@@ -117,6 +117,7 @@ PickerImp.prototype._processRoute = function(callback, params, req, res, next) {
117117
function doCall () {
118118
callback.call(null, params, req, res, next);
119119
}
120+
// callback.call(null, params, req, res, next);
120121
};
121122

122123
PickerImp.prototype._processMiddleware = function(middleware, req, res, next) {
@@ -129,4 +130,5 @@ PickerImp.prototype._processMiddleware = function(middleware, req, res, next) {
129130
function doCall() {
130131
middleware.call(null, req, res, next);
131132
}
132-
};
133+
// middleware.call(null, req, res, next);
134+
};

lib/instance.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1+
import { Meteor } from 'meteor/meteor';
12
import { WebApp } from 'meteor/webapp';
23
import { PickerImp } from './implementation';
34

5+
Meteor.startup(() => {
6+
console.debug('communitypackages:picker has been deprecated! It is still fine to use with Meteor 2, but for Meteor 3 you can use the webapp package itself as it now has all the capabilities that Picker was made to compensate for.')
7+
console.debug('See the repository for more information: https://github.com/Meteor-Community-Packages/picker')
8+
})
9+
410
export const Picker = new PickerImp();
5-
WebApp.rawConnectHandlers.use(function(req, res, next) {
6-
Picker._dispatch(req, res, next);
7-
});
11+
if (WebApp.rawExpressHandlers) {
12+
// Meteor 3
13+
WebApp.rawExpressHandlers.use(function(req, res, next) {
14+
Picker._dispatch(req, res, next);
15+
});
16+
} else if (WebApp.rawConnectHandlers) {
17+
WebApp.rawConnectHandlers.use(function(req, res, next) {
18+
Picker._dispatch(req, res, next);
19+
});
20+
}

package.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
Package.describe({
22
name: 'communitypackages:picker',
33
summary: 'Server Side Router for Meteor',
4-
version: '1.1.1',
4+
version: '1.2.0',
55
git: 'https://github.com/Meteor-Community-Packages/picker.git',
6-
documentation: 'README.md'
6+
documentation: 'README.md',
7+
deprecated: true
78
});
89

910
Npm.depends({
10-
'path-to-regexp': '6.2.1'
11+
'path-to-regexp': '6.2.2'
1112
});
1213

1314
function configurePackage(api) {
14-
api.versionsFrom('1.9');
15+
api.versionsFrom(['1.9']);
1516
api.use(['webapp', 'ecmascript', 'url'], 'server');
1617
}
1718

0 commit comments

Comments
 (0)