{"action":"created","issue":{"url":"https://api.github.com/repos/apollographql/apollo-client/issues/4261","repository_url":"https://api.github.com/repos/apollographql/apollo-client","labels_url":"https://api.github.com/repos/apollographql/apollo-client/issues/4261/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/apollo-client/issues/4261/comments","events_url":"https://api.github.com/repos/apollographql/apollo-client/issues/4261/events","html_url":"https://github.com/apollographql/apollo-client/pull/4261","id":393946059,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwODIxMjc2","number":4261,"title":"Typescript incremental builds using project references, test type checking, better dev workflow","user":{"login":"rosskevin","id":136564,"node_id":"MDQ6VXNlcjEzNjU2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/136564?v=4","gravatar_id":"","url":"https://api.github.com/users/rosskevin","html_url":"https://github.com/rosskevin","followers_url":"https://api.github.com/users/rosskevin/followers","following_url":"https://api.github.com/users/rosskevin/following{/other_user}","gists_url":"https://api.github.com/users/rosskevin/gists{/gist_id}","starred_url":"https://api.github.com/users/rosskevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosskevin/subscriptions","organizations_url":"https://api.github.com/users/rosskevin/orgs","repos_url":"https://api.github.com/users/rosskevin/repos","events_url":"https://api.github.com/users/rosskevin/events{/privacy}","received_events_url":"https://api.github.com/users/rosskevin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-12-25T01:53:14Z","updated_at":"2018-12-26T03:34:21Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/apollographql/apollo-client/pulls/4261","html_url":"https://github.com/apollographql/apollo-client/pull/4261","diff_url":"https://github.com/apollographql/apollo-client/pull/4261.diff","patch_url":"https://github.com/apollographql/apollo-client/pull/4261.patch"},"body":"### Checklist:\r\n\r\n- [ ] If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)\r\n- [ ] Make sure all of the significant new logic is covered by tests\r\n\r\n## What it does\r\n\r\nThis PR improves developer workflow, addresses some maintenance issues and simplifies builds with common configs.  It also builds faster using ts incremental builds and adds type checking to all `src` including tests.\r\n\r\n## Rationale\r\n\r\nI got into the code to look at contributing to another issue, and noticed ts errors in my vscode workspace, specifically the tests.  As I dug in, I noticed that tests aren't run against tsc, and the tsconfigs were duplicative and sometimes differing.  \r\n\r\n## Goals\r\n- enable type checking on all `src` including tests\r\n- simpler tsconfigs\r\n- simpler developer workflow\r\n- faster builds\r\n- maintainability and cleanup since joining individual projects together\r\n\r\n## Changes\r\n\r\n**IMPORTANT REVIEW NOTE** `.ts` code changes were solely either a) adding `any`; or b) the result of testing scripts and running `prettier` or `lint:fix` on files which hadn't previously been touched.  There is no intent here to change any runtime code, only build process and minimal changes to get tests type checking.  Using diff options without spaces may help.  To simplify getting tests to typecheck, they were left as much as-is as possible.  These types can be incrementally improved moving forward.\r\n\r\n- use yarn workspaces - much more conducive to monorepos with less maintenance.  I'm very familiar with this and it is my go-to method.  Simplified intra-project dependencies with symbolic links automatically + lerna integration.\r\n- use typescript 3.x project references - again simplifies dependencies and work specifically in monorepos with the added benefit of incremental builds\r\n- use es5/common js tsc builds by default - important for ts project references to resolve/build incrementally\r\n- since default builds are now commonjs, added the rollup esm bundle\r\n- validate tests with typescript (remove tests from `excludes` in tsconfigs) \r\n- upgrade ts-jest - newer versions have type checking \r\n- changes to parallelize tasks loads with lerna making for faster experience on post-install and other tasks\r\n- move prettier settings to `.prettierrc` to prevent fighting between lint-staged and vscode prettier plugin\r\n- use more common tsconfig base settings\r\n- fix exclusions in tsconfigs\r\n- where ts errors were revealed by the use of common settings, used `any` for now to move past (effectively the same as before).  These should be systematically improved in further PRs.\r\n- use jest multi-project runner\r\n- share jest configs\r\n- share circleci configs and used prerequisite/shared step called `Prepare`\r\n\r\n## To be done in different PRs\r\n\r\nI want to limit the size of _this_ PR, so I have not continued on with my ultimate goals but will do the following using this PR as the basis: \r\n- enable `strict: true` to expose more static type issues\r\n- start removing `any` in tests incrementally\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apollographql/apollo-client/issues/comments/449896905","html_url":"https://github.com/apollographql/apollo-client/pull/4261#issuecomment-449896905","issue_url":"https://api.github.com/repos/apollographql/apollo-client/issues/4261","id":449896905,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTg5NjkwNQ==","user":{"login":"rosskevin","id":136564,"node_id":"MDQ6VXNlcjEzNjU2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/136564?v=4","gravatar_id":"","url":"https://api.github.com/users/rosskevin","html_url":"https://github.com/rosskevin","followers_url":"https://api.github.com/users/rosskevin/followers","following_url":"https://api.github.com/users/rosskevin/following{/other_user}","gists_url":"https://api.github.com/users/rosskevin/gists{/gist_id}","starred_url":"https://api.github.com/users/rosskevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosskevin/subscriptions","organizations_url":"https://api.github.com/users/rosskevin/orgs","repos_url":"https://api.github.com/users/rosskevin/repos","events_url":"https://api.github.com/users/rosskevin/events{/privacy}","received_events_url":"https://api.github.com/users/rosskevin/received_events","type":"User","site_admin":false},"created_at":"2018-12-26T03:34:21Z","updated_at":"2018-12-26T03:34:21Z","author_association":"NONE","body":"I have changed the umd rollup to process the index.ts - that should put fix those bundles (and bundle sizes).\r\n\r\nBut, I have one umd bundle issue with `apollo-boost`:\r\n\r\n```\r\n./src/index.ts → lib/bundle.umd.js...\r\n[!] Error: 'print' is not exported by ../../node_modules/graphql/language/index.js\r\nhttps://rollupjs.org/guide/en#error-name-is-not-exported-by-module-\r\n../../node_modules/graphql/index.mjs (51:0)\r\n```\r\n\r\nUMD's arguably are not my area of expertise - I stick to es2015.  Can anyone help me with the globals for apollo-boost?\r\n\r\n- clone https://github.com/rosskevin/apollo-client/tree/ts-ship-shape\r\n- `yarn install` (it will break on `postinstall`)\r\n- `cd packages/apollo-boost`\r\n- attempt `rm -rf lib/bundle.* || true && yarn bundle` and fixup the globals.\r\n\r\nAny umd rollup help is much appreciated.  I think this is the very last thing to finish up this big batch of work."}}
{"actor":{"display_login":"rosskevin"}}