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: Update Example App to angular v7, angular-redux v9 #55

Merged
merged 15 commits into from
Jan 7, 2019

Conversation

wtho
Copy link
Contributor

@wtho wtho commented Nov 24, 2018

This PR tackles and maybe even closes several issues (#54, #47, #43, #40, angular-redux/example-app#49 and mostly #8).

I did not change any of the logic.

I am aware Angular v7 does fulfill the peer dependency of angular-redux/store, but I know it works and I wanted to push the example app as far as possible, knowing that it might catch some dust again.
If this is an issue, the dependency can be downgraded to Angular v6.

An example of Lazy-Loading is not implemented in this PR.

Updates

  • Dependency angular-redux v9 and angular v7
  • Use Angular-cli v7 and angular.json instead of angular-cli.json
    The Config is not completely configured with tslint and integrated tests, I just took the generic config to make the app run with the current angular-cli
  • Refactor code to use rxjs v6
  • Use Jest as Unit-Test Library with jest-preset-angular
    This is a personal choice, but I saw you use jest in the root of this repository as well. For jasmine there are plenty of examples, whereas for jest and angular it keeps being shaky.
  • Improve type safety complying to Strict Class Initialization and removing implicit any
  • Avoiding Circular Dependency by moving action strings to ticket-actions.ts
  • Update @angular/http to @angular/common/http (HttpClient)
  • Change mocky.io links to https, taken from angular-redux/example-app PR, kudos to @antonshevyrin

Updates
  * Dependency angular-redux v9 and angular v7
  * Use Angular-cli v7 and angular.json instead of angular-cli.json
  * Refactor code to use rxjs v6
  * Use Jest as Unit-Test Library with jest-preset-angular
  * Improve type safety complying to Strict Class Initialization and
removing impicit any
  * Avoiding Circular Dependency by moving action strings to
ticket-actions.ts
  * Update @angular/http to @angular/common/http (HttpClient)
  * Change mocky.io links to https
@smithad15
Copy link
Member

This is great. Thank you very much for this. I will take a moment to review the code soon, but right now I'm a bit confused as to why the CircleCI hooks aren't firing. Is your branch up to date with the latest from master?

@smithad15
Copy link
Member

Looks like its an issue with how I setup npm auth tokens (https://circleci.com/gh/wtho/platform/2?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link). I'll look into it

@wtho wtho changed the title Update: Example App to angular v7, angular-redux v9 WIP: Update Example App to angular v7, angular-redux v9 Dec 12, 2018
@jamesbs
Copy link
Member

jamesbs commented Dec 12, 2018

Looks like its an issue with how I setup npm auth tokens (https://circleci.com/gh/wtho/platform/2?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link). I'll look into it

Probably a good idea to add .npmrc to .gitignore

Copy link
Member

@jamesbs jamesbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the two comments above, it just needs to be updated to match linting rules, the code looks solid otherwise.

packages/example-app/src/app/animals/animal/component.ts Outdated Show resolved Hide resolved
packages/example-app/package.json Outdated Show resolved Hide resolved
@wtho
Copy link
Contributor Author

wtho commented Dec 15, 2018

I do not know why the error with the index.d.ts in @types/ramda happened, but setting the version to 0.24 fixes it. Hope this is getting solved once @types/ramda@0.26 gets released.

Now the test fails, but I do not know why exactly. Seems to be an issue with yarn:

  • If I install the dependencies using npm install in example-app and run the tests, they pass
  • If I install the dependencies of the example app in an isolated folder (not inside angular-redux/platform) with yarn and run the tests, they pass
  • If I install with yarn inside angular-redux/platform/packages/example-app and run the tests, they fail. Somehow the installation depends on the ../../yarn.lock in the root folder. I do like yarn for its speed, but if it does things differently in a non-transparent way, it can be quite annoying.
  • If I run yarn install in the root repository, it installs most packages in the example app, but four are missing in node_modules: core-js, flux-standard-action, ramda and zone.js and the versions of many packages differ compared to the isolated example-app installation.

I do not know enough about how yarn install works with nested projects.

@jamesbs
Copy link
Member

jamesbs commented Dec 20, 2018

I would recommend only running scripts from the workspace folder rather than the individual package folders. This includes installs. I did some work in wtho#2 to get all of the versions synced up. For any package that is required in different places, we need to make sure those versions are the same otherwise we'll run into issues with code executing in different package versions causing defects.

If you are having installation issues, executing a clean and reinstall may help.

@jamesbs jamesbs changed the base branch from master to upgrade-angular-7 December 20, 2018 21:19
@jamesbs
Copy link
Member

jamesbs commented Dec 20, 2018

Updated the base branch to merge into upgrade-angular-7. Considering how many changes will need to be involved I'd like to separate the changes into multiple commits before moving forward with a new release.

@wtho
Copy link
Contributor Author

wtho commented Dec 21, 2018

Yeah, I totally agree, there are many changes in different places happening here.

I'd like to separate the changes into multiple commits

Do you mean multiple PRs or multiple commits inside this PR (and no squashing to keep the history)?

I can clean the current changes in several commits up a bit if you want, reorganizing the changes by concerns.

@jamesbs
Copy link
Member

jamesbs commented Jan 4, 2019

I meant multiple PRs, while squashing and merging incoming commits to the upgrade branch.

wtho and others added 3 commits January 7, 2019 16:53
* chore(store): update devtools window prop name

- update prop 'devToolsExtension' to '__REDUX_DEVTOOLS_EXTENSION__'
- add package redux-devtools-extension for typings
- define some typings for window

* Delete package-lock.json

Was added by mistake

* fix(devtools): add backwards compatibility

* fix(devtools): backwards compat deToolsExtension

* Add yarn.lock changes

* fix: adjust formatting to comply with prettier
Copy link
Member

@jamesbs jamesbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jamesbs jamesbs merged commit e259e48 into angular-redux:upgrade-angular-7 Jan 7, 2019
github-actions bot pushed a commit to adrianiy/platform that referenced this pull request Sep 28, 2021
# ngredux-store-v1.0.0 (2021-09-28)

### Bug Fixes

* fix eslint ([ab4d1d3](ab4d1d3))
* **build:** No chai for you ([#209](https://github.com/AdrianInsua/platform/issues/209)) ([be35f03](be35f03))
* **deps:** Change zone.js version ([#222](https://github.com/AdrianInsua/platform/issues/222)) ([e62e149](e62e149))
* **example:** Fix local dev mode ([angular-redux#80](https://github.com/AdrianInsua/platform/issues/80)) ([angular-redux#81](https://github.com/AdrianInsua/platform/issues/81)) ([b06721f](b06721f))
* **ngReduxModule:** Generate metadata ([#237](https://github.com/AdrianInsua/platform/issues/237)) ([8b4b9d8](8b4b9d8))
* **package.json:** add redux as dependencies ([angular-redux#132](https://github.com/AdrianInsua/platform/issues/132)) ([5fdeb19](5fdeb19))

### chore

* **build:** use ng-packagr ([angular-redux#37](https://github.com/AdrianInsua/platform/issues/37)) ([dffe23a](dffe23a)), closes [angular-redux#9](https://github.com/AdrianInsua/platform/issues/9)
* **linting:** add global tslint rules ([angular-redux#35](https://github.com/AdrianInsua/platform/issues/35)) ([336cc60](336cc60)), closes [angular-redux#4](https://github.com/AdrianInsua/platform/issues/4)

### Features

* add bootstraping script ([3fd7b32](3fd7b32))
* add new devtools window prop name ([angular-redux#58](https://github.com/AdrianInsua/platform/issues/58)) ([55b15a6](55b15a6))
* bump angular version to 11.0.5 ([1b8bb72](1b8bb72))
* Introduced a new function called provideStore() which accepts a already created Redux store ([angular-redux#142](https://github.com/AdrianInsua/platform/issues/142)) ([a6c4aaf](a6c4aaf)), closes [angular-redux#141](https://github.com/AdrianInsua/platform/issues/141)
* refactor packages to match new ng-packager ([710edef](710edef))
* upgrade to angular 7 ([angular-redux#72](https://github.com/AdrianInsua/platform/issues/72)) ([18d9245](18d9245)), closes [angular-redux#65](https://github.com/AdrianInsua/platform/issues/65) [angular-redux#66](https://github.com/AdrianInsua/platform/issues/66) [angular-redux#67](https://github.com/AdrianInsua/platform/issues/67) [angular-redux#68](https://github.com/AdrianInsua/platform/issues/68) [angular-redux#69](https://github.com/AdrianInsua/platform/issues/69) [angular-redux#70](https://github.com/AdrianInsua/platform/issues/70) [angular-redux#71](https://github.com/AdrianInsua/platform/issues/71) [angular-redux#74](https://github.com/AdrianInsua/platform/issues/74) [angular-redux#79](https://github.com/AdrianInsua/platform/issues/79)
* Typescript Port ([angular-redux#33](https://github.com/AdrianInsua/platform/issues/33)) ([33ea991](33ea991)), closes [angular-redux#35](https://github.com/AdrianInsua/platform/issues/35) [angular-redux#36](https://github.com/AdrianInsua/platform/issues/36) [angular-redux#37](https://github.com/AdrianInsua/platform/issues/37) [angular-redux#38](https://github.com/AdrianInsua/platform/issues/38) [angular-redux#39](https://github.com/AdrianInsua/platform/issues/39) [angular-redux#52](https://github.com/AdrianInsua/platform/issues/52) [angular-redux#50](https://github.com/AdrianInsua/platform/issues/50) [angular-redux#55](https://github.com/AdrianInsua/platform/issues/55) [angular-redux#53](https://github.com/AdrianInsua/platform/issues/53)
* **aot:** Support AoT - [#223](https://github.com/AdrianInsua/platform/issues/223) ([#226](https://github.com/AdrianInsua/platform/issues/226)) ([a6d7826](a6d7826))
* **dispatch:** Create dispatch decorator ([#385](https://github.com/AdrianInsua/platform/issues/385)) ([4513566](4513566))

### BREAKING CHANGES

* Upgrades Angular dependencies to v7
* **build:** - changes the output to conform to the Angular Package Format. This may cause subtle differences in consumption behaviour
- peer dependencies have been corrected to actual dependencies
* **linting:** - ConnectArray has been renamed to ConnectArrayDirective
- ReactiveConnect has been renamed to ReactiveConnectDirective
- Connect has been renamed to ConnectDirective
- interfaces with an "I" prefix have had that prefix removed (e.g "IAppStore" -> "AppStore")
github-actions bot pushed a commit to adrianiy/platform that referenced this pull request Sep 28, 2021
# @adrian.insua/ngredux-store-v1.0.0 (2021-09-28)

### Bug Fixes

* change package names to be user scoped ([c0c9d1d](c0c9d1d))
* fix eslint ([ab4d1d3](ab4d1d3))
* **build:** No chai for you ([#209](https://github.com/AdrianInsua/platform/issues/209)) ([be35f03](be35f03))
* **deps:** Change zone.js version ([#222](https://github.com/AdrianInsua/platform/issues/222)) ([e62e149](e62e149))
* **example:** Fix local dev mode ([angular-redux#80](https://github.com/AdrianInsua/platform/issues/80)) ([angular-redux#81](https://github.com/AdrianInsua/platform/issues/81)) ([b06721f](b06721f))
* **ngReduxModule:** Generate metadata ([#237](https://github.com/AdrianInsua/platform/issues/237)) ([8b4b9d8](8b4b9d8))
* **package.json:** add redux as dependencies ([angular-redux#132](https://github.com/AdrianInsua/platform/issues/132)) ([5fdeb19](5fdeb19))

### chore

* **build:** use ng-packagr ([angular-redux#37](https://github.com/AdrianInsua/platform/issues/37)) ([dffe23a](dffe23a)), closes [angular-redux#9](https://github.com/AdrianInsua/platform/issues/9)
* **linting:** add global tslint rules ([angular-redux#35](https://github.com/AdrianInsua/platform/issues/35)) ([336cc60](336cc60)), closes [angular-redux#4](https://github.com/AdrianInsua/platform/issues/4)

### Features

* add bootstraping script ([3fd7b32](3fd7b32))
* add new devtools window prop name ([angular-redux#58](https://github.com/AdrianInsua/platform/issues/58)) ([55b15a6](55b15a6))
* bump angular version to 11.0.5 ([1b8bb72](1b8bb72))
* Introduced a new function called provideStore() which accepts a already created Redux store ([angular-redux#142](https://github.com/AdrianInsua/platform/issues/142)) ([a6c4aaf](a6c4aaf)), closes [angular-redux#141](https://github.com/AdrianInsua/platform/issues/141)
* refactor packages to match new ng-packager ([710edef](710edef))
* upgrade to angular 7 ([angular-redux#72](https://github.com/AdrianInsua/platform/issues/72)) ([18d9245](18d9245)), closes [angular-redux#65](https://github.com/AdrianInsua/platform/issues/65) [angular-redux#66](https://github.com/AdrianInsua/platform/issues/66) [angular-redux#67](https://github.com/AdrianInsua/platform/issues/67) [angular-redux#68](https://github.com/AdrianInsua/platform/issues/68) [angular-redux#69](https://github.com/AdrianInsua/platform/issues/69) [angular-redux#70](https://github.com/AdrianInsua/platform/issues/70) [angular-redux#71](https://github.com/AdrianInsua/platform/issues/71) [angular-redux#74](https://github.com/AdrianInsua/platform/issues/74) [angular-redux#79](https://github.com/AdrianInsua/platform/issues/79)
* Typescript Port ([angular-redux#33](https://github.com/AdrianInsua/platform/issues/33)) ([33ea991](33ea991)), closes [angular-redux#35](https://github.com/AdrianInsua/platform/issues/35) [angular-redux#36](https://github.com/AdrianInsua/platform/issues/36) [angular-redux#37](https://github.com/AdrianInsua/platform/issues/37) [angular-redux#38](https://github.com/AdrianInsua/platform/issues/38) [angular-redux#39](https://github.com/AdrianInsua/platform/issues/39) [angular-redux#52](https://github.com/AdrianInsua/platform/issues/52) [angular-redux#50](https://github.com/AdrianInsua/platform/issues/50) [angular-redux#55](https://github.com/AdrianInsua/platform/issues/55) [angular-redux#53](https://github.com/AdrianInsua/platform/issues/53)
* **aot:** Support AoT - [#223](https://github.com/AdrianInsua/platform/issues/223) ([#226](https://github.com/AdrianInsua/platform/issues/226)) ([a6d7826](a6d7826))
* **dispatch:** Create dispatch decorator ([#385](https://github.com/AdrianInsua/platform/issues/385)) ([4513566](4513566))

### BREAKING CHANGES

* Upgrades Angular dependencies to v7
* **build:** - changes the output to conform to the Angular Package Format. This may cause subtle differences in consumption behaviour
- peer dependencies have been corrected to actual dependencies
* **linting:** - ConnectArray has been renamed to ConnectArrayDirective
- ReactiveConnect has been renamed to ReactiveConnectDirective
- Connect has been renamed to ConnectDirective
- interfaces with an "I" prefix have had that prefix removed (e.g "IAppStore" -> "AppStore")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants