Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies & improvements for Apollo skeleton #11172

Merged
merged 4 commits into from Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions History.md
Expand Up @@ -12,6 +12,8 @@ N/A

* `--apollo` skeleton was missing client cache setup [PR #11146](https://github.com/meteor/meteor/pull/11146)

* All skeletons got their `npm` dependencies updated. [PR #11172](https://github.com/meteor/meteor/pull/11172)

## v1.11, 2020-08-18

### Breaking changes
Expand Down
24 changes: 14 additions & 10 deletions tools/static-assets/skel-apollo/imports/ui/App.jsx
@@ -1,19 +1,23 @@
import React from 'react';
import { ApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client';
import { InMemoryCache, ApolloProvider, ApolloClient, ApolloLink } from '@apollo/client';
import { BatchHttpLink } from '@apollo/client/link/batch-http'
// import { MeteorAccountsLink } from 'meteor/apollo'
import { Hello } from './Hello.jsx';
import { Info } from './Info.jsx';

const cache = new InMemoryCache().restore(window.__APOLLO_STATE__);

const link = ApolloLink.from([
// MeteorAccountsLink(),
new BatchHttpLink({
uri: '/graphql'
})
]);

const client = new ApolloClient({
uri: '/graphql',
cache: new InMemoryCache(),
/* Uncomment this for accounts use
request: operation =>
operation.setContext(() => ({
headers: {
authorization: Accounts._storedLoginToken()
}
}))
*/
cache,
link,
});

export const App = () => (
Expand Down
8 changes: 4 additions & 4 deletions tools/static-assets/skel-apollo/package.json
Expand Up @@ -8,12 +8,12 @@
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@apollo/client": "^3.1.1",
"@babel/runtime": "^7.10.5",
"@apollo/client": "^3.1.5",
"@babel/runtime": "^7.11.2",
"apollo-boost": "^0.4.9",
"apollo-server-express": "^2.16.1",
"apollo-server-express": "^2.17.0",
"graphql": "^15.3.0",
"meteor-node-stubs": "^1.0.0",
"meteor-node-stubs": "^1.0.1",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
Expand Down
8 changes: 1 addition & 7 deletions tools/static-assets/skel-apollo/server/apollo.js
Expand Up @@ -21,11 +21,5 @@ const server = new ApolloServer({

server.applyMiddleware({
app: WebApp.connectHandlers,
path: '/graphql'
});

WebApp.connectHandlers.use('/graphql', (req, res) => {
if (req.method === 'GET') {
res.end();
}
cors: true
});
2 changes: 1 addition & 1 deletion tools/static-assets/skel-bare/package.json
Expand Up @@ -5,7 +5,7 @@
"start": "meteor run"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@babel/runtime": "^7.11.2",
"meteor-node-stubs": "^1.0.1"
}
}
2 changes: 1 addition & 1 deletion tools/static-assets/skel-full/package.json
Expand Up @@ -6,7 +6,7 @@
"test": "meteor test --once --driver-package meteortesting:mocha"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@babel/runtime": "^7.11.2",
"jquery": "^3.5.1",
"meteor-node-stubs": "^1.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion tools/static-assets/skel-minimal/package.json
Expand Up @@ -8,7 +8,7 @@
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@babel/runtime": "^7.11.2",
"meteor-node-stubs": "^1.0.1"
},
"meteor": {
Expand Down
2 changes: 1 addition & 1 deletion tools/static-assets/skel-react/package.json
Expand Up @@ -8,7 +8,7 @@
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@babel/runtime": "^7.11.2",
"meteor-node-stubs": "^1.0.1",
"react": "^16.13.1",
"react-dom": "^16.13.1"
Expand Down
10 changes: 5 additions & 5 deletions tools/static-assets/skel-typescript/package.json
Expand Up @@ -8,17 +8,17 @@
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@babel/runtime": "^7.11.2",
"meteor-node-stubs": "^1.0.1",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@types/meteor": "^1.4.48",
"@types/mocha": "^8.0.0",
"@types/react": "^16.9.43",
"@types/meteor": "^1.4.49",
"@types/mocha": "^8.0.3",
"@types/react": "^16.9.49",
"@types/react-dom": "^16.9.8",
"typescript": "^3.9.7"
"typescript": "^4.0.2"
},
"meteor": {
"mainModule": {
Expand Down
4 changes: 2 additions & 2 deletions tools/static-assets/skel-vue/package.json
Expand Up @@ -8,9 +8,9 @@
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@babel/runtime": "^7.11.2",
"meteor-node-stubs": "^1.0.1",
"vue": "^2.6.11",
"vue": "^2.6.12",
"vue-meteor-tracker": "^2.0.0-beta.5"
},
"meteor": {
Expand Down
2 changes: 1 addition & 1 deletion tools/static-assets/skel/package.json
Expand Up @@ -8,7 +8,7 @@
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.10.4",
"@babel/runtime": "^7.11.2",
"jquery": "^3.5.1",
"meteor-node-stubs": "^1.0.1"
},
Expand Down