Skip to content

Commit 7571745

Browse files
author
Guillaume Chau
committed
Browser version
1 parent 49bb4a3 commit 7571745

File tree

7 files changed

+50
-10
lines changed

7 files changed

+50
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
![schema](https://cdn-images-1.medium.com/max/800/1*H9AANoofLqjS10Xd5TwRYw.png)
77

8-
Integrates [apollo](http://www.apollostack.com/) in your [Vue](http://vuejs.org) components with declarative queries. Compatible with Vue 1.0+ and 2.0+
8+
Integrates [apollo](http://www.apollostack.com/) in your [Vue](http://vuejs.org) components with declarative queries. Compatible with Vue 1.0+ and 2.0+. [Live demo](https://jsfiddle.net/Akryum/oyejk2qL/)
99

1010
[<img src="https://assets-cdn.github.com/favicon.ico" alt="icon" width="16" height="16"/> More vue-apollo examples](https://github.com/Akryum/vue-apollo-example)
1111

dist/vue-apollo.esm.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3447,4 +3447,17 @@ function install(Vue, options) {
34473447

34483448
ApolloProvider$1.install = install;
34493449

3450-
export { willPrefetch };export default ApolloProvider$1;
3450+
var ApolloProvider$$1 = ApolloProvider$1;
3451+
3452+
// Auto-install
3453+
var GlobalVue = null;
3454+
if (typeof window !== 'undefined') {
3455+
GlobalVue = window.Vue;
3456+
} else if (typeof global !== 'undefined') {
3457+
GlobalVue = global.Vue;
3458+
}
3459+
if (GlobalVue) {
3460+
GlobalVue.use(ApolloProvider$1);
3461+
}
3462+
3463+
export { install, ApolloProvider$$1 as ApolloProvider, willPrefetch };export default ApolloProvider$1;

dist/vue-apollo.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-apollo.umd.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3453,6 +3453,21 @@ function install(Vue, options) {
34533453

34543454
ApolloProvider$1.install = install;
34553455

3456+
var ApolloProvider$$1 = ApolloProvider$1;
3457+
3458+
// Auto-install
3459+
var GlobalVue = null;
3460+
if (typeof window !== 'undefined') {
3461+
GlobalVue = window.Vue;
3462+
} else if (typeof global !== 'undefined') {
3463+
GlobalVue = global.Vue;
3464+
}
3465+
if (GlobalVue) {
3466+
GlobalVue.use(ApolloProvider$1);
3467+
}
3468+
3469+
exports.install = install;
3470+
exports.ApolloProvider = ApolloProvider$$1;
34563471
exports['default'] = ApolloProvider$1;
34573472
exports.willPrefetch = willPrefetch;
34583473

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-apollo",
3-
"version": "2.1.0-beta.12",
3+
"version": "2.1.0-beta.18",
44
"description": "Vue apollo integration",
55
"main": "dist/vue-apollo.umd.js",
66
"module": "dist/vue-apollo.esm.js",
@@ -35,7 +35,6 @@
3535
"apollo-client": "^1.0.1"
3636
},
3737
"dependencies": {
38-
"graphql-tag": "^2.0.0",
3938
"lodash.debounce": "^4.0.8",
4039
"lodash.omit": "^4.5.0",
4140
"lodash.throttle": "^4.1.1"

rollup.config.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
dest: 'dist/vue-apollo.min.js',
1010
format: 'iife',
1111
exports: 'named',
12-
moduleName: 'vue-apollo',
12+
moduleName: 'VueApollo',
1313
plugins: [
1414
resolve({
1515
jsnext: true,

src/index.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import omit from 'lodash.omit'
22
import { DollarApollo } from './dollar-apollo'
3-
import { ApolloProvider } from './apollo-provider'
3+
import { ApolloProvider as apolloProvider } from './apollo-provider'
44
import { Globals } from './utils'
55

66
const keywords = [
@@ -71,7 +71,7 @@ function defineReactiveSetter ($apollo, key, value) {
7171
}
7272
}
7373

74-
function install (Vue, options) {
74+
export function install (Vue, options) {
7575
if (install.installed) return
7676
install.installed = true
7777

@@ -129,8 +129,21 @@ function install (Vue, options) {
129129
})
130130
}
131131

132-
ApolloProvider.install = install
132+
apolloProvider.install = install
133133

134-
export default ApolloProvider
134+
export const ApolloProvider = apolloProvider
135135

136136
export { willPrefetch } from './apollo-provider'
137+
138+
// Auto-install
139+
let GlobalVue = null
140+
if (typeof window !== 'undefined') {
141+
GlobalVue = window.Vue
142+
} else if (typeof global !== 'undefined') {
143+
GlobalVue = global.Vue
144+
}
145+
if (GlobalVue) {
146+
GlobalVue.use(apolloProvider)
147+
}
148+
149+
export default apolloProvider

0 commit comments

Comments
 (0)