Skip to content

Commit

Permalink
refactor(controller): remove lifecycle flags (#1707)
Browse files Browse the repository at this point in the history
* refactor(ci): remove e2e safari from pipeline

* refactor(tests): disable hook tests
  • Loading branch information
bigopon committed Mar 12, 2023
1 parent 6b02bc4 commit a31cd75
Show file tree
Hide file tree
Showing 47 changed files with 5,981 additions and 7,234 deletions.
14 changes: 8 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -894,12 +894,14 @@ workflows:
requires:
- build_release

- e2e_safari:
<<: *filter_ignore_develop_release
name: safari16_select
path: "packages/__e2e__/select-safari16"
requires:
- check_doc_abort
# no longer necessary since the changes related to fragment adoption has been reverted
# though keeping it around for a bit longer in case there's a need again
# - e2e_safari:
# <<: *filter_ignore_develop_release
# name: safari16_select
# path: "packages/__e2e__/select-safari16"
# requires:
# - check_doc_abort
- e2e_test:
<<: *filter_ignore_develop_release
name: e2e_hmr_webpack
Expand Down
4 changes: 2 additions & 2 deletions examples/navigation-skeleton/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable import/no-unassigned-import */
import { IRouter, HookTypes } from '@aurelia/router';
import { customElement, IObserverLocator, LifecycleFlags } from '@aurelia/runtime-html';
import { customElement, IObserverLocator } from '@aurelia/runtime-html';
import html from './app.html';

import 'bootstrap/dist/css/bootstrap.min.css';
Expand Down Expand Up @@ -45,7 +45,7 @@ export class App {

public binding(): void {
const observerLocator = this.router.container.get(IObserverLocator);
const observer = observerLocator.getArrayObserver(LifecycleFlags.none, this.windows) as any;
const observer = observerLocator.getArrayObserver(this.windows) as any;
observer.subscribeToCollection(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,28 +588,6 @@ describe('3-runtime-html/binding-commands.throttle-debounce.spec.ts', function (
});
});

// TODO: fix throttle
// it(`throttleBindingBehavior - input.value`, done => {
// const { au, lifecycle, host, component } = createFixture(`<template><input value.to-view="message & throttle:50"></template>`);
// au.app({ host, component }).start();
// assert.strictEqual(host.firstChild['value'], '', `host.firstChild['value']`);
// component.message = 'hello!';
// lifecycle.flush(LifecycleFlags.none);
// assert.strictEqual(host.firstChild['value'], 'hello!', `host.firstChild['value']`);
// component.message = 'hello!!';
// lifecycle.flush(LifecycleFlags.none);
// assert.strictEqual(host.firstChild['value'], 'hello!', `host.firstChild['value']`);
// component.message = 'hello!!!';
// lifecycle.flush(LifecycleFlags.none);
// assert.strictEqual(host.firstChild['value'], 'hello!', `host.firstChild['value']`);
// setTimeout(() => {
// component.message = 'hello!!!!';
// lifecycle.flush(LifecycleFlags.none);
// assert.strictEqual(host.firstChild['value'], 'hello!!!!', `host.firstChild['value']`);
// done();
// }, 75);
// });

it('works with updateTrigger', async function () {
const { ctx, component, startPromise, tearDown } = createFixture(
`<input ref="inputEl" value.bind="value & updateTrigger:'blur'" />`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Registration, Writable, DI } from '@aurelia/kernel';
import {
LifecycleFlags as LF,
Aurelia,
customElement,
ICustomElementController,
Expand Down Expand Up @@ -1716,20 +1715,20 @@ abstract class TestVM implements IViewModel {
this.disposeDI = dispose(mgr, p);
}

public binding(i: HC, p: HPC, f: LF): void | Promise<void> { return this.bindingDI.invoke(this, () => { this.$binding(i, p, f); }); }
public bound(i: HC, p: HPC, f: LF): void | Promise<void> { return this.boundDI.invoke(this, () => { this.$bound(i, p, f); }); }
public attaching(i: HC, p: HPC, f: LF): void | Promise<void> { return this.attachingDI.invoke(this, () => { this.$attaching(i, p, f); }); }
public attached(i: HC, f: LF): void | Promise<void> { return this.attachedDI.invoke(this, () => { this.$attached(i, f); }); }
public detaching(i: HC, p: HPC, f: LF): void | Promise<void> { return this.detachingDI.invoke(this, () => { this.$detaching(i, p, f); }); }
public unbinding(i: HC, p: HPC, f: LF): void | Promise<void> { return this.unbindingDI.invoke(this, () => { this.$unbinding(i, p, f); }); }
public binding(i: HC, p: HPC): void | Promise<void> { return this.bindingDI.invoke(this, () => { this.$binding(i, p); }); }
public bound(i: HC, p: HPC): void | Promise<void> { return this.boundDI.invoke(this, () => { this.$bound(i, p); }); }
public attaching(i: HC, p: HPC): void | Promise<void> { return this.attachingDI.invoke(this, () => { this.$attaching(i, p); }); }
public attached(i: HC): void | Promise<void> { return this.attachedDI.invoke(this, () => { this.$attached(i); }); }
public detaching(i: HC, p: HPC): void | Promise<void> { return this.detachingDI.invoke(this, () => { this.$detaching(i, p); }); }
public unbinding(i: HC, p: HPC): void | Promise<void> { return this.unbindingDI.invoke(this, () => { this.$unbinding(i, p); }); }
public dispose(): void { void this.disposeDI.invoke(this, () => { this.$dispose(); }); }

protected $binding(_i: HC, _p: HPC, _f: LF): void { /* do nothing */ }
protected $bound(_i: HC, _p: HPC, _f: LF): void { /* do nothing */ }
protected $attaching(_i: HC, _p: HPC, _f: LF): void { /* do nothing */ }
protected $attached(_i: HC, _f: LF): void { /* do nothing */ }
protected $detaching(_i: HC, _p: HPC, _f: LF): void { /* do nothing */ }
protected $unbinding(_i: HC, _p: HPC, _f: LF): void { /* do nothing */ }
protected $binding(_i: HC, _p: HPC): void { /* do nothing */ }
protected $bound(_i: HC, _p: HPC): void { /* do nothing */ }
protected $attaching(_i: HC, _p: HPC): void { /* do nothing */ }
protected $attached(_i: HC): void { /* do nothing */ }
protected $detaching(_i: HC, _p: HPC): void { /* do nothing */ }
protected $unbinding(_i: HC, _p: HPC): void { /* do nothing */ }
protected $dispose(this: Partial<Writable<this>>): void {
this.bindingDI = void 0;
this.boundDI = void 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
LifecycleFlags,
Aurelia,
customElement,
ICustomElementController,
Expand Down Expand Up @@ -70,16 +69,16 @@ describe('3-runtime-html/controller.host-sharing.integration.spec.ts', function
}
public attaching(initiator: IHydratedController): void {
// No async hooks so all of these are synchronous.
void this.childController.activate(initiator, this.$controller, LifecycleFlags.none);
void this.childController.activate(initiator, this.$controller);
}
public detaching(initiator: IHydratedController): void {
void this.childController.deactivate(initiator, this.$controller, LifecycleFlags.none);
void this.childController.deactivate(initiator, this.$controller);
}
public activateChild(): void {
void this.childController.activate(this.childController, this.$controller, LifecycleFlags.none);
void this.childController.activate(this.childController, this.$controller);
}
public deactivateChild(): void {
void this.childController.deactivate(this.childController, this.$controller, LifecycleFlags.none);
void this.childController.deactivate(this.childController, this.$controller);
}
}

Expand Down
Loading

0 comments on commit a31cd75

Please sign in to comment.