Skip to content

Commit 26c89bb

Browse files
committed
Upgrade & Patches
1 parent b4b2f90 commit 26c89bb

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed

README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Meteor Icon](http://icon.meteor.com/package/useraccounts:flow-routing)](https://atmospherejs.com/useraccounts/flow-routing)
1+
[Flow-routing-extra](https://atmospherejs.com/useraccounts/flow-routing)
22

33
# Flow Router add-on for User Accounts
44

@@ -25,7 +25,7 @@ Assuming you have a main layout that looks like this:
2525
<div class="content">
2626
{{> Template.dynamic template=main}}
2727
</div>
28-
28+
useraccounts
2929
<footer>
3030
{{> Template.dynamic template=footer}}
3131
</footer>
@@ -58,13 +58,13 @@ AccountsTemplates.configure({
5858
});
5959
```
6060

61-
`useraccounts:flow-routing` uses the internal useraccounts `fullPageAtForm` is the built-in template useraccounts uses by default for its forms. You can override it on a per-route basis (see below) or replace it with `defaultTemplate:` field as above (templates specified in route config will still take precedence). Omit `defaultTemplate` (or set to an empty string) to use the `fullPageAtForm` template built-in to your useraccounts UI package (ex [material](https://github.com/meteor-useraccounts/materialize/blob/master/lib/full_page_at_form.html)).
61+
`mealsunite:flow-routing-extra` uses the internal useraccounts `fullPageAtForm` is the built-in template useraccounts uses by default for its forms. You can override it on a per-route basis (see below) or replace it with `defaultTemplate:` field as above (templates specified in route config will still take precedence). Omit `defaultTemplate` (or set to an empty string) to use the `fullPageAtForm` template built-in to your useraccounts UI package (ex [material](https://github.com/meteor-useraccounts/materialize/blob/master/lib/full_page_at_form.html)).
6262

6363
NOTE: The above configs must load BEFORE your AccountsTemplates routes are defined (next section).
6464

6565
## React Configuration
6666

67-
Firstly, please ensure that your app depends upon the [React Layout][3] and the [Blaze Layout][2] packages. User Accounts currents only renders Blaze templates. In order to use User Accounts with React we rely on the [Blaze To React][4] package to render the User Accounts templates.
67+
Firstly, please ensure that your app depends upon the [React Layout][3] and the [Blaze Layout][2] packages. User Accounts currents only renders Blaze templates. In order to use User Accounts with React we rely on the [Blaze To React][3] package to render the User Accounts templates.
6868

6969
Before you configure routes for User Accounts with Flow Router, you will need to make sure you have set a few default configuration items.
7070

@@ -119,7 +119,7 @@ AccountsTemplates.configure({
119119

120120
`useraccounts:flow-routing` uses `fullPageAtForm` for the `defaultTemplate` option. `fullPageAtForm` is the built-in Blaze template that all UserAccounts themed packages (Bootstrap, Materialize, etc.) use for their forms. You can override it on a per-route basis (see below) or replace it as shown above (templates specified in a route config will still take precedence). Omit `defaultTemplate` (or set to an empty string) to use the `fullPageAtForm` template built-in to your useraccounts UI package (ex [material](https://github.com/meteor-useraccounts/materialize/blob/master/lib/full_page_at_form.html)).
121121

122-
Please note that this template must be a **Blaze** template. It will be rendered into your React layout using [Blaze To React][4].
122+
Please note that this template must be a **Blaze** template. It will be rendered into your React layout using [Blaze To React][3].
123123

124124
NOTE: The above configs must load BEFORE your AccountsTemplates routes are defined (next section).
125125

@@ -183,7 +183,7 @@ AccountsTemplates.configureRoute('signIn', {
183183
});
184184
```
185185

186-
All options are passed to FlowRouter.route() which then creates a new custom route (see the official Flow Router documentation [here](https://atmospherejs.com/kadira/flow-router) for more details).
186+
All options are passed to FlowRouter.route() which then creates a new custom route (see the official Flow Router documentation [here][1] for more details).
187187

188188
The `redirect` field permits to specify where to redirect the user after successful form submit. Actually, `redirect` can be a function so that, for example, the following:
189189

@@ -232,7 +232,6 @@ Or if you want to protect ALL routes in your app:
232232
FlowRouter.triggers.enter([AccountsTemplates.ensureSignedIn]);
233233
```
234234

235-
[1]: https://atmospherejs.com/kadira/flow-router
235+
[1]: https://atmospherejs.com/ostrio/flow-router-extra
236236
[2]: https://atmospherejs.com/kadira/blaze-layout
237-
[3]: https://atmospherejs.com/kadira/react-layout
238-
[4]: https://atmospherejs.com/gwendall/blaze-to-react
237+
[3]: https://atmospherejs.com/gadicc/blaze-react-component

lib/core.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -180,25 +180,29 @@ AccountsTemplates.configureRoute = function(route, options) {
180180
//
181181
// For now we need to render the main template using BlazeToReact
182182

183-
if (Package['react-runtime']) {
183+
if (require) {
184+
var React = require('react');
185+
} else if (Package['react-runtime']) {
184186
var React = Package['react-runtime'].React;
185187
} else {
186188
throw new Error("layoutTemplate is a React element but React runtime package is not found");
187189
}
188190

189-
if (Package['kadira:react-layout']) {
191+
if (require) {
192+
var ReactLayout = {render: require('react-mounter').mount};
193+
} else if (Package['kadira:react-layout']) {
190194
var ReactLayout = Package['kadira:react-layout'].ReactLayout;
191195
} else {
192196
throw new Error("useraccounts:flow-routing requires that your project includes kadira:react-layout package.");
193197
}
194198

195-
if (Package['gwendall:blaze-to-react']) {
196-
var BlazeToReact = Package['gwendall:blaze-to-react'].BlazeToReact;
199+
if (Package['gadicc:blaze-react-component']) {
200+
var BlazeToReact = Package['gadicc:blaze-react-component'].default;
197201
} else {
198-
throw new Error("useraccounts:flow-routing requires that your project includes the gwendall:blaze-to-react package.");
202+
throw new Error("useraccounts:flow-routing requires that your project includes the gadicc:blaze-react-component package.");
199203
}
200204

201-
layoutRegions[contentRegion] = React.createElement(BlazeToReact, { blazeTemplate: template });
205+
layoutRegions[contentRegion] = React.createElement(BlazeToReact, { template: template });
202206
}
203207

204208
function doLayout() {

package.js

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
// Package metadata for Meteor.js web platform (https://www.meteor.com/)
2-
// This file is defined within the Meteor documentation at
3-
//
4-
// http://docs.meteor.com/#/full/packagejs
5-
//
6-
// and it is needed to define a Meteor package
7-
'use strict';
8-
91
Package.describe({
10-
name: 'mealsunite:user-routing-extra',
2+
name: 'mealsunite:flow-routing-extra',
113
summary: 'UserAccounts package providing routes configuration capability via ostrio/flow-router-extra.',
12-
version: '1.14.2',
4+
version: '2.0.0',
135
git: 'https://github.com/MealsUnite/flow-routing.git',
146
});
157

168
Package.onUse(function(api) {
17-
api.versionsFrom('METEOR@1.5');
9+
api.versionsFrom('METEOR@1.3');
1810

1911
api.use([
2012
'check',
@@ -31,10 +23,9 @@ Package.onUse(function(api) {
3123
], ['client', 'server']);
3224

3325
api.use([
34-
'react@0.14.1_1',
26+
'react@15.0.1',
3527
36-
37-
'gwendall:[email protected]'
28+
3829
], ['client', 'server'], { weak: true });
3930

4031
api.addFiles([

0 commit comments

Comments
 (0)