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

[WIP] 1.0 #377

Merged
merged 111 commits into from
Nov 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
a4232ef
Monorepo
kamilkisiela Oct 11, 2017
b327fc3
Skip few tests
kamilkisiela Oct 11, 2017
b6675b4
chore: move things
kamilkisiela Oct 11, 2017
980698b
feat: HttpLink
kamilkisiela Oct 11, 2017
9c59d3e
feat: Add apollo-angular
kamilkisiela Oct 11, 2017
e15ef7a
test: Apollo.watchQuery with MockLink
kamilkisiela Oct 12, 2017
ffb353c
fix: let Angular do the body serialization
kamilkisiela Oct 12, 2017
33df38d
build: put globally as link.http instead of httpLink
kamilkisiela Oct 12, 2017
cac322a
chore: add prettier
kamilkisiela Oct 12, 2017
3efcd98
chore: prepare package.json of each package
kamilkisiela Oct 12, 2017
6e6842e
feat: introduce Watcher
kamilkisiela Oct 12, 2017
541b3ea
feat(apollo): allow for multiple clients
kamilkisiela Oct 12, 2017
e576673
test: use test() instead of it()
kamilkisiela Oct 12, 2017
962c655
feat(apollo): add SelectPipe
kamilkisiela Oct 13, 2017
5247b3f
test(link-http): server-side rendering
kamilkisiela Oct 13, 2017
6cd6bde
test(core): add more tests of Apollo
kamilkisiela Oct 13, 2017
1c77e79
feat(core): put SelectPipe in ApolloModule
kamilkisiela Oct 13, 2017
c76a5a9
refactor(core): add info about ApolloClientOptions
kamilkisiela Oct 13, 2017
667e87a
test(core): add more tests of Apollo
kamilkisiela Oct 13, 2017
7c0d390
test(core): more tests
kamilkisiela Oct 13, 2017
9ca0cdc
test(core): use mockLinks.ts instead of MockLink.ts
kamilkisiela Oct 13, 2017
bf0fa7f
chore(core): RC 2 of ApolloClient
kamilkisiela Oct 13, 2017
d2ea7ba
chore: deploy, LICENSE, gitignore update
kamilkisiela Oct 13, 2017
3b2a208
feat(core): expose Watcher
kamilkisiela Oct 13, 2017
dcdb468
chore: use global jest configuration
kamilkisiela Oct 15, 2017
8a9bfe6
chore: use global deploy script
kamilkisiela Oct 15, 2017
47cda48
refactor(core): QueryRef replaces Watcher, getter for accesing client
kamilkisiela Oct 15, 2017
3d1aca6
chore: add types for jest
kamilkisiela Oct 15, 2017
35c7f9b
chore: setup tests
kamilkisiela Oct 15, 2017
33e8efc
chore: use prettier on staged files
kamilkisiela Oct 15, 2017
7f88051
refactor: test lint-staged
kamilkisiela Oct 15, 2017
9e38bb4
chore: add code coverage
kamilkisiela Oct 15, 2017
7069858
fix(core): startPolling was calling itself
kamilkisiela Oct 15, 2017
6382870
test(core): More tests for QueryRef
kamilkisiela Oct 15, 2017
de32f2c
refactor: prettier on all files
kamilkisiela Oct 15, 2017
bd75815
chore: update vscode's settings
kamilkisiela Oct 15, 2017
9541bb3
docs: update markdown files
kamilkisiela Oct 15, 2017
595673a
chore: remove apollo-angular
kamilkisiela Oct 15, 2017
99504aa
chore: remove hello-world example
kamilkisiela Oct 15, 2017
bfee1ab
chore: move new core to apollo-angular dir
kamilkisiela Oct 15, 2017
e15c9ac
docs: update README
kamilkisiela Oct 15, 2017
67fcf6d
chore(core): update package.json
kamilkisiela Oct 15, 2017
31ca628
chore: setup travis
kamilkisiela Oct 15, 2017
51523af
chore: setup coverage in travis
kamilkisiela Oct 15, 2017
0730645
chore: use tslint (with prettier)
kamilkisiela Oct 15, 2017
e92603d
refactor: apply changes after TSLint
kamilkisiela Oct 15, 2017
5612e72
test(core): should handle multiple subscribers
kamilkisiela Oct 15, 2017
563a254
refactor: tslint - ban console
kamilkisiela Oct 15, 2017
935ffcb
feat(core): turn QueryRef.valueChanges into property
kamilkisiela Oct 15, 2017
daf2c42
docs: Migration
kamilkisiela Oct 15, 2017
a21345a
docs: use named exports in Migration (cache-inmemory)
kamilkisiela Oct 15, 2017
771ba10
docs: update changelog for 1.0
kamilkisiela Oct 15, 2017
8c3e7cd
Create renovate.json
kamilkisiela Oct 16, 2017
f5ebe55
feat: implement ZoneScheduler
kamilkisiela Oct 17, 2017
3f03775
chore(link-http): add repository to package.json
kamilkisiela Oct 17, 2017
122ca4c
feat(link-http): introduce extensions
kamilkisiela Oct 18, 2017
cfe0aac
chore(link-http): require peerDeps of ng core and common
kamilkisiela Oct 18, 2017
b411ae3
test: fix tests for QueryRef - missing Zone.js
kamilkisiela Oct 18, 2017
e2b6aba
feat(link-http): introduce withCredentials
kamilkisiela Oct 18, 2017
59ef902
feat(link-http): introduce headers
kamilkisiela Oct 18, 2017
a7b6ca2
chore: don't clean up after deployed
kamilkisiela Oct 18, 2017
23d92de
chore: bring back deploy script to action
kamilkisiela Oct 18, 2017
46737d9
chore: fix build and tests, update packages
kamilkisiela Oct 18, 2017
bf4fc30
chore: add lint testint to travis
kamilkisiela Oct 19, 2017
24bd61a
refactor(core): lint - used before declaration
kamilkisiela Oct 19, 2017
4a8949e
chore: release beta.0
kamilkisiela Oct 19, 2017
77d6e6f
chore: add README.md to deployed files
kamilkisiela Oct 19, 2017
fd6224b
chore: run lint not just lint
kamilkisiela Oct 19, 2017
642541f
chore: disable codecov's comments
kamilkisiela Oct 19, 2017
82f2632
Merge branch 'master' of github.com:apollographql/apollo-angular into…
kamilkisiela Oct 24, 2017
a31bdc1
chore: update all to latest
kamilkisiela Oct 25, 2017
85d7a91
test(core): don't reuse options object for mutate and query
kamilkisiela Oct 25, 2017
f3a379a
chore: bump all to 1.0.0-beta.1
kamilkisiela Oct 25, 2017
d50a83e
docs: update link to new docs
kamilkisiela Oct 25, 2017
c6b5853
Merge branch 'master' of github.com:apollographql/apollo-angular into…
kamilkisiela Oct 26, 2017
8ea8e3e
feat(link-http): allow to define a method
kamilkisiela Oct 27, 2017
fcff092
docs(link-http): method option
kamilkisiela Oct 27, 2017
bd3c5c3
Add missing .valueChanges for .watchQuery call (#383)
Oct 29, 2017
cc99514
docs: organize and update setup, queries and mutations
kamilkisiela Oct 29, 2017
5a86387
docs: caching, network-layer
kamilkisiela Oct 30, 2017
5c1a6be
docs: error handling
kamilkisiela Oct 30, 2017
f4ffbad
docs: features/caching
kamilkisiela Oct 30, 2017
7299d17
docs: Optimistic UI
kamilkisiela Oct 30, 2017
54bc369
docs: features/cache-updates
kamilkisiela Oct 30, 2017
8de804d
docs: fragments
kamilkisiela Oct 30, 2017
5a4d077
docs: developer tooling
kamilkisiela Oct 30, 2017
161e074
docs: missing images
kamilkisiela Oct 30, 2017
640eb32
docs: subscriptions
kamilkisiela Oct 30, 2017
8da42b4
docs: nativescript
kamilkisiela Oct 30, 2017
7051bb3
docs: static typing
kamilkisiela Oct 30, 2017
f520709
feat(core): Allows to type the operation variables
kamilkisiela Oct 30, 2017
aeed0d4
docs: static typing
kamilkisiela Oct 30, 2017
20c73d5
refactor(core): use ApolloClientOptions and change range to 2.0.0
kamilkisiela Oct 30, 2017
a0167fc
docs: query splitting
kamilkisiela Oct 30, 2017
0fb24e9
refactor(core): no longer expose ApolloOptions
kamilkisiela Oct 30, 2017
46744d4
docs: pagination
kamilkisiela Oct 30, 2017
0fe2b8f
docs: authentication
kamilkisiela Oct 30, 2017
f6e138c
docs: prefetching
kamilkisiela Oct 30, 2017
496d251
docs: server-side rendering
kamilkisiela Oct 30, 2017
5efa05b
docs: webpack
kamilkisiela Oct 30, 2017
2ca88cb
docs: meteor
kamilkisiela Oct 30, 2017
dfb26fe
docs: simple example
kamilkisiela Oct 30, 2017
2c787cd
docs: multiple clients
kamilkisiela Oct 30, 2017
bae326c
docs: remove unused
kamilkisiela Oct 30, 2017
7d55037
docs: clean up
kamilkisiela Oct 30, 2017
b9cd884
docs: few fixes
kamilkisiela Oct 30, 2017
8274fdf
docs: use @beta
kamilkisiela Oct 30, 2017
9369abe
chore(link-http): release 1.0.0-beta.2
kamilkisiela Oct 30, 2017
3ec24f3
fix(link-http): allow to use HttpParams on GET requests
kamilkisiela Oct 31, 2017
2e05ce7
feat(link-http): allow for dynamic uri (from context) (#386)
kamilkisiela Nov 2, 2017
eb07575
test(core): fix
Urigo Nov 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .bithoundrc

This file was deleted.

21 changes: 10 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
logs
*.log
npm-debug.log*
lerna-debug.log

# Runtime data
pids
Expand All @@ -13,7 +14,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
coverage
packages/*/coverage

# nyc test coverage
.nyc_output
Expand All @@ -25,10 +26,10 @@ coverage
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/
compiled
packages/*/build/

# Dependency directories
packages/*/node_modules
node_modules
jspm_packages

Expand All @@ -50,13 +51,11 @@ jspm_packages
# Packages lock
package-lock.json
yarn.lock
packages/**/package-lock.json
packages/**/yarn.lock

.DS_Store
Thumbs.db
db.json
*.log

docs/public/*
!docs/public/_redirects
# npm directories (for deploying)
packages/*/npm/

.idea/
# docs
docs/public/docs
18 changes: 0 additions & 18 deletions .npmignore

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"bracketSpacing": false,
"singleQuote": true,
"trailingComma": "all"
}
32 changes: 6 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,17 @@ sudo: false
language: node_js

node_js:
- "6"

cache:
directories:
# cache node modules
- $HOME/.npm
- $HOME/.yarn-cache
- node_modules
- examples/hello-world/node_modules
- "8"

notifications:
# disable email notification
email: false

before_install:
# Repo for Yarn
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add coveralls
# remove unused node modules from cache
- npm prune
- (cd examples/hello-world && npm prune)

install:
- yarn
- (cd examples/hello-world && rm -rf node_modules/apollo-angular && npm i)
- npm run bootstrap
- npm prune

script:
- yarn test
- (cd examples/hello-world && npm test)
- npm test
- npm run lint

after_script:
# send code-coverage report to coveralls
- coveralls < ./coverage/remapped/lcov.info || true
after_success: npm run coverage
4 changes: 0 additions & 4 deletions .typingsrc

This file was deleted.

10 changes: 3 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
"editor.rulers": [100],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.wrappingColumn": 100,
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules/**": true,
"build": true,
"coverage": true,
"compiled": true,
"examples/hello-world/dist": true,
"npm": true,
"yarn.lock": true
"**/build/**": true,
"**/coverage/**": true,
"**/npm/**": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}
34 changes: 17 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ If you encounter a bug, please file an issue on GitHub via the repository of the
While we will try to be as helpful as we can on any issue reported, please include the following to maximize the chances of a quick fix:

1. **Intended outcome:** What you were trying to accomplish when the bug occurred, and as much code as possible related to the source of the problem.
2. **Actual outcome:** A description of what actually happened, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. Please avoid non-specific phrases like “didn’t work” or “broke”.
3. **How to reproduce the issue:** Instructions for how the issue can be reproduced by a maintainer or contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be.
1. **Actual outcome:** A description of what actually happened, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. Please avoid non-specific phrases like “didn’t work” or “broke”.
1. **How to reproduce the issue:** Instructions for how the issue can be reproduced by a maintainer or contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be.

Creating a good reproduction really helps contributors investigate and resolve your issue quickly. In many cases, the act of creating a minimal reproduction illuminates that the source of the bug was somewhere outside the library in question, saving time and effort for everyone.

Expand All @@ -46,8 +46,8 @@ For a small bug fix change (less than 20 lines of code changed), feel free to op
Most of the features in Apollo came from suggestions by you, the community! We welcome any ideas about how to make Apollo better for your use case. Unless there is overwhelming demand for a feature, it might not get implemented immediately, but please include as much information as possible that will help people have a discussion about your proposal:

1. **Use case:** What are you trying to accomplish, in specific terms? Often, there might already be a good way to do what you need and a new feature is unnecessary, but it’s hard to know without information about the specific use case.
2. **Could this be a plugin?** In many cases, a feature might be too niche to be included in the core of a library, and is better implemented as a companion package. If there isn’t a way to extend the library to do what you want, could we add additional plugin APIs? It’s important to make the case for why a feature should be part of the core functionality of the library.
3. **Is there a workaround?** Is this a more convenient way to do something that is already possible, or is there some blocker that makes a workaround unfeasible?
1. **Could this be a plugin?** In many cases, a feature might be too niche to be included in the core of a library, and is better implemented as a companion package. If there isn’t a way to extend the library to do what you want, could we add additional plugin APIs? It’s important to make the case for why a feature should be part of the core functionality of the library.
1. **Is there a workaround?** Is this a more convenient way to do something that is already possible, or is there some blocker that makes a workaround unfeasible?

Feature requests will be labeled as such, and we encourage using GitHub issues as a place to discuss new features and possible implementation designs. Please refrain from submitting a pull request to implement a proposed feature until there is consensus that it should be included. This way, you can avoid putting in work that can’t be merged in.

Expand All @@ -57,26 +57,26 @@ Once there is a consensus on the need for a new feature, proceed as listed below

This includes:

- Big bug fixes
- New features
* Big bug fixes
* New features

For significant changes to a repository, it’s important to settle on a design before starting on the implementation. This way, we can make sure that major improvements get the care and attention they deserve. Since big changes can be risky and might not always get merged, it’s good to reduce the amount of possible wasted effort by agreeing on an implementation design/plan first.

1. **Open an issue.** Open an issue about your bug or feature, as described above.
2. **Reach consensus.** Some contributors and community members should reach an agreement that this feature or bug is important, and that someone should work on implementing or fixing it.
3. **Agree on intended behavior.** On the issue, reach an agreement about the desired behavior. In the case of a bug fix, it should be clear what it means for the bug to be fixed, and in the case of a feature, it should be clear what it will be like for developers to use the new feature.
4. **Agree on implementation plan.** Write a plan for how this feature or bug fix should be implemented. What modules need to be added or rewritten? Should this be one pull request or multiple incremental improvements? Who is going to do each part?
5. **Submit PR.** In the case where multiple dependent patches need to be made to implement the change, only submit one at a time. Otherwise, the others might get stale while the first is reviewed and merged. Make sure to avoid “while we’re here” type changes - if something isn’t relevant to the improvement at hand, it should be in a separate PR; this especially includes code style changes of unrelated code.
6. **Review.** At least one core contributor should sign off on the change before it’s merged. Look at the “code review” section below to learn about factors are important in the code review. If you want to expedite the code being merged, try to review your own code first!
7. **Merge and release!**
1. **Reach consensus.** Some contributors and community members should reach an agreement that this feature or bug is important, and that someone should work on implementing or fixing it.
1. **Agree on intended behavior.** On the issue, reach an agreement about the desired behavior. In the case of a bug fix, it should be clear what it means for the bug to be fixed, and in the case of a feature, it should be clear what it will be like for developers to use the new feature.
1. **Agree on implementation plan.** Write a plan for how this feature or bug fix should be implemented. What modules need to be added or rewritten? Should this be one pull request or multiple incremental improvements? Who is going to do each part?
1. **Submit PR.** In the case where multiple dependent patches need to be made to implement the change, only submit one at a time. Otherwise, the others might get stale while the first is reviewed and merged. Make sure to avoid “while we’re here” type changes - if something isn’t relevant to the improvement at hand, it should be in a separate PR; this especially includes code style changes of unrelated code.
1. **Review.** At least one core contributor should sign off on the change before it’s merged. Look at the “code review” section below to learn about factors are important in the code review. If you want to expedite the code being merged, try to review your own code first!
1. **Merge and release!**

### Code review guidelines

It’s important that every piece of code in Apollo packages is reviewed by at least one core contributor familiar with that codebase. Here are some things we look for:

1. **Required CI checks pass.** This is a prerequisite for the review, and it is the PR author's responsibility. As long as the tests don’t pass, the PR won't get reviewed.
2. **Simplicity.** Is this the simplest way to achieve the intended goal? If there are too many files, redundant functions, or complex lines of code, suggest a simpler way to do the same thing. In particular, avoid implementing an overly general solution when a simple, small, and pragmatic fix will do.
3. **Testing.** Do the tests ensure this code won’t break when other stuff changes around it? When it does break, will the tests added help us identify which part of the library has the problem? Did we cover an appropriate set of edge cases? Look at the test coverage report if there is one. Are all significant code paths in the new code exercised at least once?
4. **No unnecessary or unrelated changes.** PRs shouldn’t come with random formatting changes, especially in unrelated parts of the code. If there is some refactoring that needs to be done, it should be in a separate PR from a bug fix or feature, if possible.
5. **Code has appropriate comments.** Code should be commented, or written in a clear “self-documenting” way.
6. **Idiomatic use of the language.** In TypeScript, make sure the typings are specific and correct. In ES2015, make sure to use imports rather than require and const instead of var, etc. Ideally a linter enforces a lot of this, but use your common sense and follow the style of the surrounding code.
1. **Simplicity.** Is this the simplest way to achieve the intended goal? If there are too many files, redundant functions, or complex lines of code, suggest a simpler way to do the same thing. In particular, avoid implementing an overly general solution when a simple, small, and pragmatic fix will do.
1. **Testing.** Do the tests ensure this code won’t break when other stuff changes around it? When it does break, will the tests added help us identify which part of the library has the problem? Did we cover an appropriate set of edge cases? Look at the test coverage report if there is one. Are all significant code paths in the new code exercised at least once?
1. **No unnecessary or unrelated changes.** PRs shouldn’t come with random formatting changes, especially in unrelated parts of the code. If there is some refactoring that needs to be done, it should be in a separate PR from a bug fix or feature, if possible.
1. **Code has appropriate comments.** Code should be commented, or written in a clear “self-documenting” way.
1. **Idiomatic use of the language.** In TypeScript, make sure the typings are specific and correct. In ES2015, make sure to use imports rather than require and const instead of var, etc. Ideally a linter enforces a lot of this, but use your common sense and follow the style of the surrounding code.
Loading