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

feat(form-plugin): add reset form action #1604

Merged
merged 7 commits into from
Jun 22, 2020

Conversation

ozanturhan
Copy link
Contributor

@ozanturhan ozanturhan commented May 26, 2020

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

ResetForm action added for form plugin.

@splincode
Copy link
Member

@ozanturhan update docs please, also

@ozanturhan
Copy link
Contributor Author

Hello @splincode I updated form.md is it enough?

@splincode splincode requested a review from markwhitfeld May 27, 2020 12:15
Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

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

@ozanturhan Thank you for your PR. Congratulations on your first one to NGXS!
Would you mind providing the motivation for this change in the description for the PR.
ie:

  • What is the use case?
  • What code would you have to write to achieve the same if this feature didn't exist?
  • How does this make things simpler or cleaner?

This will help us to decide the value that this feature brings.
Thank you 😄

@ozanturhan
Copy link
Contributor Author

@markwhitfeld Thanks a lot for your feedback.

I want to reset the form on the related page whenever the parameter changes in the resolver. I'am using the "UpdateFormValue" and "UpdateFormDirty" actions for this. But i couldn't reset form without passing all form members. You can compare the following two usages.

An example from our project:

  resolve() {
    return this.getSearchConfig().pipe(
      switchMap(() =>
        this.store.dispatch([
          new UpdateFormValue({
            value: {
              type: null,
              status: null,
              categoryId: null,
              coverage: null,
              commitmentEndDate: null,
              phoneNo: null,
              firstName: null,
              lastName: null,
              deviceType: null,
              brand: null,
              deviceCharModel: null,
              deviceCharCapacity: null,
              deviceCharColor: null,
            },
            path: 'ServiceState.searchForm',
          }),
          new UpdateFormDirty({ dirty: false, path: 'ServiceState.searchForm' }),
        ]),
      ),
      mapTo(null),
    );
  }

Example with ResetForm action:

  resolve() {
    return this.getSearchConfig().pipe(
      switchMap(() =>
        this.store.dispatch(
          new ResetForm({ path: 'ServiceState.searchForm' }),
        ),
      ),
      mapTo(null),
    );
  }

Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

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

Thank you for your motivation! I think it does make sense as a feature we need.
See the requested changes below.

packages/form-plugin/src/directive.ts Show resolved Hide resolved
packages/form-plugin/src/actions.ts Outdated Show resolved Hide resolved
packages/form-plugin/src/form.plugin.ts Show resolved Hide resolved
Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

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

Ok, I think that I need to get a deeper understanding from you as to what all the concerns are here.
I last worked with this plugin's code more than a year ago.
Could you explain what your expectations of this ResetForm action would be with regard to:

  • The final value that the model, status, dirty, errors, and disabled properties would be in the state.
  • The timing of how things would be set in relation to the debounce timeout
  • Any other actions that may get fired by NGXS as a result of dispatching this action
  • Any observable events that the form would publish as a result of this action
  • Anything else that I would need to understand?

packages/form-plugin/tests/form.plugin.spec.ts Outdated Show resolved Hide resolved
@markwhitfeld
Copy link
Member

If you could answer these questions with tests in this PR, I would be really impressed ;-)

@ozanturhan
Copy link
Contributor Author

@markwhitfeld Thank you for your comments. I will be working on this weekend.

@ozanturhan
Copy link
Contributor Author

Hi @markwhitfeld,

I have a question. I couldn't decide what it should be.

What should be expectation in below test case?

    await store.dispatch([
      new UpdateForm({
        errors: { something: true },
        dirty: true,
        status: 'INVALID',
        value: { name: 'Ozan Turhan' },
        path: 'student.studentForm'
      }),
      new ResetForm({ path: 'student.studentForm' })
    ]).toPromise();

When we run test without form, should these fields to be reset (errors, dirty, status etc.) ? I think it shouldn't be change. Because these parameters related to form.

For example in this test case ResetForm action changes only model. Because there is no form also ngxsForm directive.

Student Form Before Reset:

{
  dirty: true,
  errors: { something: true  },
  model: {
      name: "Ozan Turhan",
  },
  status: "INVALID",
}

Student Form After Reset:

{
  dirty: true,
  errors: { something: true  },
  model: {},
  status: "INVALID",
}

But if we are run test with runtime behavior, also if we have a form with ngxsForm directive studentForm state will be like below (after reset form action called):

{
  dirty: false,
  errors: {},
  model: {
      name: null
  },
  status: "VALID",
}

Example Form:

      @Component({
        template: `
          <form [formGroup]="form" ngxsForm="todos.todosForm">
            <input formControlName="text" /> <button type="submit">Add todo</button>
          </form>
        `
      })
      class MockComponent {
        public form = new FormGroup({
          text: new FormControl()
        });
      }

I think runtime behavior is true. But I'm not sure about the first case (without ngxsDirective).

After your anwser i will be start to writing to the tests.

If you can help me to make decision for that, I would be glad.

Regards

@markwhitfeld
Copy link
Member

Apologies for the delay in getting back to you!

This is a very interesting case that you raise.
My gut feel is that if you are not bound with an ngxsForm then the model and everything else should be reset. ie. not dirty, not touched, no errors, reset status, etc.

Conceptually, when you dispatch actions there should be no observable difference in the state if something is bound to that state or not. In this case there is a subtle difference, which essentially is that if you are bound to a form then the model resets to an object with empty properties (as described in the form) instead of an empty object ({}). I am willing to live with this because there is no way for the state to know what properties are on the form if it has never been bound.
Do you agree?

@markwhitfeld
Copy link
Member

PS. With regard to the debounce. I think that this action should result in an immediate change to the state and the form, and that any pending changes that are being debounced should be ignored.
For example... let's say that we had a debounce of 500ms and we type into one of the inputs.
The model in the state would only be updated after 500ms as expected.
But, if we were to dispatch the ResetForm action before that 500ms was up then the input change should never reach the state.

If we do not address this then we could have this strange scenario (500ms debounce):

  • user types input
  • after 200ms, ResetForm is dispatched by some code
  • form model and all other props are rest
  • at 500ms the new value arrives in the state!
  • this would not be expected

Some test cases added:
- reset form state without bounding ngxsForm
- reset form with bounding with ngxsForm with 500 ms debounce time
@ozanturhan
Copy link
Contributor Author

@splincode Thanks a lot for your support.

Apologies for the delay in getting back to you!

This is a very interesting case that you raise.
My gut feel is that if you are not bound with an ngxsForm then the model and everything else should be reset. ie. not dirty, not touched, no errors, reset status, etc.

Conceptually, when you dispatch actions there should be no observable difference in the state if something is bound to that state or not. In this case there is a subtle difference, which essentially is that if you are bound to a form then the model resets to an object with empty properties (as described in the form) instead of an empty object ({}). I am willing to live with this because there is no way for the state to know what properties are on the form if it has never been bound.
Do you agree?

Yes i agree. Form state should be reset without bounding to ngxsForm. Reset action will reset dirty, status etc.

But if we have ngsxForm state will be reseting by form raw values.

I got it. I covered these cases with unit tests. I am going to commit these tests.

PS. With regard to the debounce. I think that this action should result in an immediate change to the state and the form, and that any pending changes that are being debounced should be ignored.
For example... let's say that we had a debounce of 500ms and we type into one of the inputs.
The model in the state would only be updated after 500ms as expected.
But, if we were to dispatch the ResetForm action before that 500ms was up then the input change should never reach the state.

If we do not address this then we could have this strange scenario (500ms debounce):

  • user types input
  • after 200ms, ResetForm is dispatched by some code
  • form model and all other props are rest
  • at 500ms the new value arrives in the state!
  • this would not be expected

Also i added new test case for this.

Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

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

Please remove the propertyPath because, as stated below, I don't think it makes sense in this case.
Do you agree?
Are there any other aspects you feel that we still need to discuss/cover?

PS. I really appreciate and find it really encouraging that you have engaged so well about getting this feature implemented. Often people drop a PR and are not willing to discuss or put extra effort in. You have really gone the extra mile! Your contribution is definitely a highlight in the often thankless task of open source work 😀

packages/form-plugin/src/actions.ts Outdated Show resolved Hide resolved
@ozanturhan
Copy link
Contributor Author

Please remove the propertyPath because, as stated below, I don't think it makes sense in this case.
Do you agree?
Are there any other aspects you feel that we still need to discuss/cover?

PS. I really appreciate and find it really encouraging that you have engaged so well about getting this feature implemented. Often people drop a PR and are not willing to discuss or put extra effort in. You have really gone the extra mile! Your contribution is definitely a highlight in the often thankless task of open source work

Okay, you are right. i will remove it tomorrow. I don't think there's anything left to discuss.

Thank you very much for your positive comments.

Thank you for your interest and support in this PR. This will be my second contribution to an open source project. It was a very good experience for me. Also your comments were useful and I really learned something.

@markwhitfeld
Copy link
Member

markwhitfeld commented Jun 18, 2020

Thank you so much for this work. I would like to release this soon in the next version.
Would you mind adding one more thing to this PR?
Could you add a section to the announcement article with a brief overview of this feature.
Edit this file: publication/announcing_ngxs_next/article.md
This would really help out.

@ozanturhan
Copy link
Contributor Author

@markwhitfeld of course i will add as soon as possible.

Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

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

A few small suggested language changes and a question on a previous comment.

docs/plugins/form.md Outdated Show resolved Hide resolved
publication/announcing_ngxs_next/article.md Outdated Show resolved Hide resolved
publication/announcing_ngxs_next/article.md Outdated Show resolved Hide resolved
packages/form-plugin/src/form.plugin.ts Show resolved Hide resolved
@markwhitfeld markwhitfeld merged commit 4f757fa into ngxs:master Jun 22, 2020
@nickroberts
Copy link

This is great! We are currently using the form plugin for several different forms on a single page, and resetting them is a huge pain.

Any idea when the next release will be? I was hoping this was in the latest dev version, and I was going to use that, but it doesn't look like it is, as that version was from May

Keep up the great work!

@markwhitfeld markwhitfeld added this to the v3.7.0 milestone Sep 9, 2020
richarddavenport added a commit to richarddavenport/store that referenced this pull request Oct 8, 2020
* Update authentication.md (ngxs#1408)

Fix 66 line

* test(store): add test for propGetter (ngxs#1460)

* test(store): add test for propGetter

* small fix

* small fix

* chore: update CHANGELOG.md

* chore(deps): update all dependencies

* docs: add attach-action as labs project (ngxs#1470)

* feat: drop support for Angular 5 (ngxs#1464)

* build: skip support Angular 5

* build: skip support Angular 5

* small fix

* use angular.json instead .angular-cli.json

* update CHANGELOG.md

* update CHANGELOG.md

* revert

* chore: update CHANGELOG.md

* fix: use generic `ModuleWithProviders` type for Ivy compatiblility (ngxs#1469)

* fix(logger-plugin): overload `ModuleWithProviders` type to make it Ivy compatible

* feat: overload `ModuleWithProviders` everywhere

* feat: overload `ModuleWithProviders` everywhere

* chore: made a small change to force rebuild

* revert: undo random change

* fix typo

* chore: update CHANGELOG.md

[skip ci]

* docs: add Ivy migration guide (ngxs#1468)

* chore: update CHANGELOG.md

* feat(store): warn about undecorated state class if Ivy and JIT are both enabled (ngxs#1472)

* feat(store): warn about undecorated state class if Ivy and JIT are both enabled

* fix: condition

* fix:

* fix: move function to another file

* fix: make bundlesize happy

* chore: update CHANGELOG.md

[skip ci]

* refactor(store): remove unneeded mergeObject function (ngxs#1463)

* fix(store): reduce bundle size

* breaking: remove ObjectUtils

* small fix

* small fix

* chore: add new funding npm package property

* build(router-plugin): provide UMD name of the external module (ngxs#1475)

* ci: workaround build failed for Travis CI (ngxs#1481)

* ci: disable cache for Travis CI (ngxs#1484)

* use cache yarn

* small fix

* small fix

* feat(store): warn about undecorated state class if Ivy is enabled in dev (both JIT/AOT) (ngxs#1474)

* feat(store): warn about undecorated state class if Ivy is enabled in dev (both JIT/AOT)

* fix: rename

* fix: dont invoke in tests

* refactor(store): remove unneeded mergeObject function (ngxs#1463)

* fix(store): reduce bundle size

* breaking: remove ObjectUtils

* small fix

* small fix

* chore: add new funding npm package property

* fix: make bundlesize happy

* fix: remove async behavior

* test: add Ivy test

* fix: linter

* fix: move cpx to root

* fix: move cpx to root

* fix: resolve invalid path for NGCC compiled package

* fix: restore `yarn.lock` removed by mistake

* chore: update CHANGELOG.md

[skip ci]

* refactor: correct usage host tokens (ngxs#1489)

* chore: updatec CHANGELOG.md

[skip ci]

* chore: update CHANGELOG.md

* chore: update CHANGELOG.md

[skip ci]

* fix(devtools-plugin): remove `NgxsModule` from imports to ensure Ivy compatibility (ngxs#1491)

* chore: update CHANGELOG.md

* build: add E2E tests for the Ivy integration (ngxs#1492)

* chore: update CHANGELOG.md

* docs(projects): adding a new project (ngxs#1493)

* chore: prepare 3.6 release article (ngxs#1488)

* chore: prepare 3.6 release article

* chore: preparing release article

* chore: a few more tweaks to the release article

* chore: unicorn for Ivy it is

* chore: small tweaks

* chore: more work on the release article

* chore: more improvements to the announcement post

* chore: added intro

* chore: last few tweaks

* chore: update CHANGELOG.md in preparation for release

* chore: release v3.6.0

* build: upgrade to Angular 9.rc-6 (ngxs#1496)

* build: run sync ngcc (ngxs#1497)

* docs: update token.md - fix example (ngxs#1498)

@selector() expects an array. Current preview does not work. Type error.

* chore: update CHANGELOG.md

* chore: update intro.md

* chore: update intro.md

* docs: sync with master (ngxs#1505)

* docs: update token.md - fix example (ngxs#1498)

@selector() expects an array. Current preview does not work. Type error.

* chore: update intro.md

Co-authored-by: PVermeer <[email protected]>

* build: add router-plugin back to ivy integration test (ngxs#1506)

* chore: update CHANGELOG.md

[skip ci]

* chore: clean up articles after release

* chore: add vNext article template

* fix: selectors should be deterministic based on store being used (ngxs#1508)

* test: add failing test proving lack of isolation

* test: improve store isolation tests

* docs: fix spelling mistake

* refactor: remove unnecessary code

* fix: make selectors more deterministic based on calling store

* chore: add note about v4 changes to exposed metadata api

* refactor: rename depth to path to avoid confusion around the concept

* test: add additional tests for @selector determinism

* chore: increase bundle size accordingly

* fix: handle lazy loaded scenario

* test: improve ssr cypress tests

* chore: update CHANGELOG.md

[skip ci]

* chore: increase bundle size accordingly

* chore: update CHANGELOG.md

* build: add funding metadata to packages

* fix: add support for using state tokens in sub states (ngxs#1509)

* fix: add support for using state tokens in sub states

* chore: update CHANGELOG.md

* chore(deps): update all dependencies

* fix(store): optimize selector runtime binding (ngxs#1510)

* fix: optimize selector runtime binding

* fix: remove unused selectFromAppState function

* refactor: hide new metadata methods from the exposed API

* refactor: remove unused type

* test: fix typings in tests

* chore: update bundlesize

* chore: use existing type alias

* chore: update CHANGELOG.md

* chore: CHANGELOG.md

* fix: selectors should not be declaration order sensitive (ngxs#1514)

* fix: selectors should not be declaration order sensitive

* docs: remove the info related to the selector ordering issue

* chore: update CHANGELOG.md

* chore: update bundle sizes

* chore: bundlesize config tweak

* chore: update CHANGELOG.md in preparation for release

* chore: release v3.6.1

* chore: upgrade to rc.11 (ngxs#1518)

* fix(store): fix regression after upgrade to angular.rc-11 (ngxs#1526)

* fix(store): fix regression after upgrade to angular.rc-11

* fixup

* chore: update CHANGELOG.md

[skip ci]

* chore(deps): update all dependencies

* chore: prettier format (ngxs#1527)

* fix(store): handle empty array dispatch edge case (ngxs#1521)

* chore: update CHANGELOG.md

* chore: update Ivy integration project to Angular v9.0.0

* Revert "chore: prettier format (ngxs#1527)"

This reverts commit e0480a1.

* chore: update CHANGELOG.md in preparation for release

* chore: release v3.6.2

* docs: fix links (ngxs#1530)

* docs: update example to provide service in the root injector (ngxs#1538)

* docs: add noticable links to ivy migration guide (ngxs#1542)

* feat(storage-plugin): add before and after serialize hooks (ngxs#1513)

* chore(deps): update all dependencies

* feat(storage-plugin): reset

* Revert "chore(deps): update all dependencies"

This reverts commit 3d96df0.

* Update bundlesize.config.json

Co-authored-by: Renovate Bot <[email protected]>

* chore: update CHANGELOG.md

* perf(logger): lazy inject the store once only (ngxs#1550)

* perf(logger): improve speed by using lazy injection once only

* refactor: name private variables correctly

* chore: update CHANGELOG.md

* chore: update bundlesize

* @Injectable() added to top of the Class for IVY Support (ngxs#1553)

* Angular9 @Injectable updates (ngxs#1552)

* Angular9 @Injectable updates

* Update authentication.md

* @Injectable() added to top of the Class for IVY Support (ngxs#1554)

* @Injectable() added to top of the Class for IVY Support

* update @Injectable()

* @Injectable() added to top of the Class for IVY Support (ngxs#1555)

* @Injectable() added to top of the Class for IVY Support

* update @Injectable()

* @Injectable() added to top of the Class for IVY Support (ngxs#1553) (ngxs#1556)

* @Injectable() added to top of the Class for IVY Support (ngxs#1553)

* Angular9 @Injectable updates (ngxs#1552)

* Angular9 @Injectable updates

* Update authentication.md

* @Injectable() added to top of the Class for IVY Support (ngxs#1554)

* @Injectable() added to top of the Class for IVY Support

* update @Injectable()

* @Injectable() added to top of the Class for IVY Support (ngxs#1555)

* @Injectable() added to top of the Class for IVY Support

* update @Injectable()

Co-authored-by: Alp <[email protected]>

* docs: added simple exmple on how to unsubscribe from action handlers (ngxs#1557)

* added simple exmple on how to unsubscribe from action handlers

* docs(website): improved docs on action handlers

* improved sentence

* docs: add @Injectable above every state class declaration (ngxs#1560)

* docs: fix typo (ngxs#1562)

* docs: fix typo (ngxs#1562)

(cherry picked from commit 7bcba2b)

* docs: improve intro root module sample (ngxs#1563)

* docs: fix inherited selector example

fixes ngxs#1564

* docs(ngxs-labs): include firestore plugin (ngxs#1566)

* docs: remove deprecated testbed.get (ngxs#1569)

* docs: remove deprecated testbed.get (ngxs#1569) (ngxs#1570)

Co-authored-by: Dimitri Bret <[email protected]>

* feat(logger-plugin): action filter in Logger Plugin (ngxs#1571)

* feat(logger-plugin): add filter to NgxsLoggerPluginOptions

* feat(logger-plugin): add filter to loggerOptionsFactory

* feat(logger-plugin): handle filter predicate

* feat(logger-plugin): add state as predicate parameter

* feat(logger-plugin): pass state snapshot to filter predicate

* docs(logger-plugin): add description for filter option

* docs: add logger plugin filter to announcement article

* ci(logger-plugin): update bundle sizes

* ci(logger-plugin): increase fesm5 bundle size to 12.614KB

* ci(logger-plugin): increase fesm5 bundle size to 12.619KB

* chore: update CHANGELOG.md

(skip ci)

* chore: update CHANGELOG.md

(skip ci)

* chore: update packages (ngxs#1576)

* build: add the missing decorator before upgrading to Angular 9 (ngxs#1577)

* build: upgrade dtslint (ngxs#1580)

* Update form.md (ngxs#1581)

Update form.md to contain a FormFuilder example.

* Update form.md (ngxs#1581) (ngxs#1582)

Update form.md to contain a FormFuilder example.

Co-authored-by: Jose E <[email protected]>

* docs(form-plugin): updated form.md (ngxs#1583)

* docs(form-plugin): updated form.md

Added an ngOnInit as well as the imports in order to help people who might not be as familiar.

* docs(form-plugin): update form.md 

Moved the FormBuilder into the constructor

* chore: update CHANGELOG.md

* docs(storage-plugin): update changelog related to serialization interceptors (ngxs#1587)

* Update article.md

* Update storage.md

* build: add build integration test with Angular 8 (ngxs#1591)

* build: add build integration test with Angular 8

* !fixup

* feat: upgrade to support Angular 9 (ngxs#1596)

#1 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

Update config.yml

ngxs#2 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

ngxs#3 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

ngxs#4 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

ngxs#5 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

ngxs#6 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

ngxs#6 Error applying workspace layer for job: Concurrent upstream jobs persisted the same file(s)

chore: remove redundant

revert ng test

ngxs#2 revert ng test

ngxs#3 revert ng test

* chore: update CHANGELOG.md

* chore: fix typo

* chore(deps): update all dependencies

* Update hmr.md (ngxs#1608)

Update hmr.md so that <project-name> can be seen in the docs

* fix(router-plugin): update state after route successfully activates (ngxs#1606)

Co-authored-by: Troy <[email protected]>

* chore: update CHANGELOG.md

* docs(projects): add a new community project (ngxs#1611)

* fix(hmr-plugin): show error when use Angular Ivy with JIT mode (ngxs#1607)

* fix(hmr-plugin): show error when use Angular Ivy with JIT mode

* fix(hmr-plugin): local handling ivy mode + detect jit

* fix: bundlesize.config.json

* revert

* fix: use __annotation__ for detect JIT, remove Ivy() fn

* fix typo

* fix: correct detect ivy mode

* revert bundlesize.config.json

* Update CHANGELOG.md

* doc: better documentation for the reset function (ngxs#1614)

* doc: better documentation for the reset function 

- the reset function needs as key value the state name which needs to be reseted

* docs(unit-testing): extend documentation with snapshot

- add snapshot to have a merged state after reset

* docs(testing): better hint of store.reset usage

- Add better note and understanding that reset will restore the whole stage we the new given

* fix: do not cancel actions if action handler completes without emitting (ngxs#1615)

* fix: do not cancel actions if action handler completes without emitting

* chore: update CHANGELOG.md

* fix: ofAction* methods should prevent passing anything except of `ActionType` (ngxs#1616)

* fix: ofAction* methods should prevent passing anything except of `ActionType`

* chore: update CHANGELOG.md

* fix(logger-plugin): filter out only `undefined` payloads (ngxs#1617)

* fix(logger-plugin): filter out only `undefined` payloads

* chore: update CHANGELOG.md

* test: change setup to setupWithLogger

* docs: create optimizing-selectors page (ngxs#1622)

* docs(optimizing-selectors): create doc

docs(optimizing-selectors): fix typo

* docs(optimizing-selectors): add more information

* docs(optimizing-selectors): fix white space

Co-authored-by: Artur Androsovych <[email protected]>

* docs(optimizing-selectors): fix white space

Co-authored-by: Artur Androsovych <[email protected]>

* docs(optimizing-selectors): fix meta-selector

* docs(optimizing-selectors): update selector options text

* docs(optimizing-selectors): update selector class name

Co-authored-by: Mark Whitfeld <[email protected]>

Co-authored-by: Troy <[email protected]>
Co-authored-by: Artur Androsovych <[email protected]>
Co-authored-by: Mark Whitfeld <[email protected]>

* perf: do not create `new Observable()` every time when subscribing to `ivyEnabledInDevMode$` (ngxs#1624)

* feat(form-plugin): add reset form action (ngxs#1604)

* feat(form-plugin): add reset form action

* docs(form-plugin): add reset form action information

* refactor(form-plugin): reset action logic changed

Some test cases added:
- reset form state without bounding ngxsForm
- reset form with bounding with ngxsForm with 500 ms debounce time

* refactor(form-plugin): update bundlesize.config.json

* refactor(form-plugin): remove propertyPath on reset action

* docs(form-plugin): brief overview added

* docs(form-plugin): small language changes

Co-authored-by: Mehmet Ozan Turhan <[email protected]>

* chore: update CHANGELOG.md

* build: upgrade TS to 3.9 to ensure that no breaking changes get added (ngxs#1626)

* fix(devtools-plugin): actions with "action" property end up logged with <UNDEFINED> (ngxs#1628)

* fix: actions with "action" property end up logged with <UNDEFINED>

make action:null before sending to devtools

* test(devtools-plugin): test make action=null

* chore: update CHANGELOG.md

* feat: throw an error when actions do not have a static type property (ngxs#1625)

* feat: throw an error when actions do not have a static type property

* feat: throw an error when actions do not have a static type property

* chore: update CHANGELOG.md

* test: ensure that plain objects w/o type also are not allowed

* feat: replace throw with `throwError`

* test: update spec names

* chore: revert type def according PR review

* chore: remove some whitespace

Co-authored-by: Mark Whitfeld <[email protected]>

* fix(store): remove the recent `@Select` type safety check due to issues with private/protected properties (ngxs#1623)

* test: expect errors when using private/protected with select decorator

* chore: rename state

* !fixup

* fix(store): remove implement SelectType<T> due to cannot assign @select to private/protected property

* chore: modifications method name

* chore: update CHANGELOG.md

* chore: update CHANGELOG.md

* chore: tweak CHANGELOG.md wording

* chore: tweak test name

Co-authored-by: Mark Whitfeld <[email protected]>

* docs: add a side note about strict mode (ngxs#1635)

* docs: add a side note about strict mode

* chore: added extra note

Co-authored-by: Mark Whitfeld <[email protected]>

* ci: set default reviewers (ngxs#1639)

* chore(deps): update dependency typescript to ^3.9.6

* chore(deps): update dependency typescript to ^3.9.7

* chore: bump angular version in peerDependencies (ngxs#1645)

* test(integrations): add ng 10 ivy (ngxs#1641)

* chore(ng-10-ivy): ng new

* chore: fix script integration:ng10ivy

* chore: install scripts

* chore: yarn.lock

* chore: make sure ivy is enabled

* chore: ng-10-ivy app

* test: include e2e test

* docs: update doc

* test: migrate to jest

* chore(deps): ng-10-ivy integration

* test: delete

* chore: deleted per artur

* chore: ignore yarn-error.log

* ci: run ng10 integration test

* test: add test

* ci: run tests on ci

* test: remove jest-preset-angular

* test: set config emitDecoratorMetadata=true

* test(integrations): add ng 10 ivy off (ngxs#1647)

* test(integrations): add ng 10 ivy off

* ci: fix step command

Co-authored-by: Mark Whitfeld <[email protected]>

* chore: update CHANGELOG.md

[skip ci]

* chore: rename integration step (ngxs#1652)

* docs(hmr): deprecation note (ngxs#1654)

* docs(hmr): include workaround using storage-plugin (ngxs#1656)

* docs(hmr): deprecation note

* docs(hmr): include workaround using storage-plugin

* chore: update bundlesize after hmr update

* Feature/ng9 ivy integration tests (ngxs#1649)

* chore: rename integrations/ivy to integrations/hello-world-ng9-ivy

* test: create ng9 no ivy integration tests

* test: add new integration tests to ci and onfigure ng9 without ivy

* test: remove ngcc in non ivy test and negate ivy tests in ivyoff

* ci: add ng9 checks to travisci

* ci: try running no ivy before with ivy

* ci: fix format

* test: ng9 e2e deps

* chore: update CHANGELOG.md

[skip ci]

* fix(docs): add new slack invite link

* test: integrations ng9 ivy (ngxs#1664)

pin jest and jest-preset-angular versions

* test(integration): create ng7 integration tests (ngxs#1659)

* test: create ng7 integration tests

* chore: add e2e for ng7

* test: remove unit test run from integration

* test: remove test because jest builder conflicts with angular 7

* test(integration): readd tests to ng7 integration project (ngxs#1665)

* feature(form-plugin): ngxsFormClearOnDestroy should allow the attribute with no value (ngxs#1662)

* Update actions.md

* putting full stop

* adding constructor to add class

* spacing between the class and upper case

* add more explanation to group action

* fix(form-plugin): adding coerceBoolean method

* style(form-plugin): removing the console.log

* removing console.log

* fix(form-plugin): adding unit test for ngxsFormClearOnDestroy

* fix(form-plugin): inline the function

* fix(form-plugin): strict type check for null

* fix(form-plugin): change !== to !=

Co-authored-by: Mark Whitfeld <[email protected]>

* test(form-plugin): clean up ngxsFormClearOnDestroy tests (ngxs#1666)

* chore: update CHANGELOG.md

* chore: update CHANGELOG.md in preparation for release

* chore: release v3.7.0

* chore: prepare publication folder for next release notes

* docs(plugins): add link in readme for ngxs-loading-plugin (ngxs#1671)

* docs: fix wording in unit-testing.md (ngxs#1667)

Fix incorrect wording

* fix: release NGXS resources when the root module gets destroyed (ngxs#1669)

* fix: release NGXS resources when the root module gets destroyed

* fix: update bundlesize

* fix: lint

* chore: update CHANGELOG.md

* fix: update bundlesize

* fix(storage-plugin): resolve state name correctly if the state class has been provided (ngxs#1670)

* fix(storage-plugin): resolve state name correctly if the state class has been provided

* chore: update CHANGELOG.md

Co-authored-by: Mark Whitfeld <[email protected]>

Co-authored-by: Daniil Gorodilov <[email protected]>
Co-authored-by: Max Ivanov <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: David Leitner <[email protected]>
Co-authored-by: Artur Androsovych <[email protected]>
Co-authored-by: Mark Whitfeld <[email protected]>
Co-authored-by: Mustapha Aouas <[email protected]>
Co-authored-by: PVermeer <[email protected]>
Co-authored-by: Levent Arman Özak <[email protected]>
Co-authored-by: David Morissette <[email protected]>
Co-authored-by: Alp <[email protected]>
Co-authored-by: Florin Cosmin <[email protected]>
Co-authored-by: Ilia Ametov <[email protected]>
Co-authored-by: Joaquin Cid <[email protected]>
Co-authored-by: Dimitri Bret <[email protected]>
Co-authored-by: Jose E <[email protected]>
Co-authored-by: Scott Reed <[email protected]>
Co-authored-by: Troy Dietz <[email protected]>
Co-authored-by: Troy <[email protected]>
Co-authored-by: sandb0x4477 <[email protected]>
Co-authored-by: Mitko Tschimev <[email protected]>
Co-authored-by: Mehmet Ozan Turhan <[email protected]>
Co-authored-by: Mehmet Ozan Turhan <[email protected]>
Co-authored-by: Agustin Polo <[email protected]>
Co-authored-by: Mark Whitfeld <[email protected]>
Co-authored-by: Agustin Polo <[email protected]>
Co-authored-by: shahid ahmad <[email protected]>
Co-authored-by: Lucas Frecia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants