Skip to content

Instantly share code, notes, and snippets.

@michaelnero
Last active May 21, 2021 19:26
Show Gist options
  • Save michaelnero/47b4b854b00d9dd87ab5ccd95fb655c9 to your computer and use it in GitHub Desktop.
Save michaelnero/47b4b854b00d9dd87ab5ccd95fb655c9 to your computer and use it in GitHub Desktop.
Aurelia Caching Bug?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber Gist uses dumber bundler, the default bundle file
is /dist/entry-bundle.js.
The starting module is pointed to "main" (data-main attribute on script)
which is your src/main.ts.
-->
<body>
<my-app></my-app>
<script src="/dist/entry-bundle.js" data-main="main"></script>
</body>
</html>
{
"dependencies": {
"aurelia": "latest"
}
}
<import from="../components/listbox"></import>
<listbox value.two-way="value">
<template au-slot>
${value}
</template>
</listbox>
import { bindable} from "aurelia";
let i = 0;
export class AssigneeFixed {
value;
define(controller, parentContainer, definition) {
return { ...definition };
}
binding() {
this.value = i++;
}
}
<import from="./assignee-fixed"></import>
<div>
<assignee-fixed></assignee-fixed>
</div>
export class ItemRowFixed {
}
<import from="../components/listbox"></import>
<listbox value.two-way="value">
<template au-slot>
${value}
</template>
</listbox>
import { bindable} from "aurelia";
let i = 0;
export class Assignee {
value;
binding() {
this.value = i++;
}
}
<import from="./assignee"></import>
<div>
<assignee></assignee>
</div>
export class ItemRow {
}
<div>
<au-slot></au-slot>
</div>
import { bindable} from "aurelia";
export class Listbox {
@bindable() value: unknown;
define(controller, parentContainer, definition) {
return { ...definition };
}
}
import Aurelia from 'aurelia';
import { MyApp } from './my-app';
Aurelia.app(MyApp).start();
<import from="./backlog/item-row"></import>
<import from="./backlog-fixed/item-row-fixed"></import>
<h1>${message}</h1>
<p>This one is behaves unexpectedly</p>
<item-row repeat.for="item of items"></item-row>
<p>This one is behaves like I expect</p>
<item-row-fixed repeat.for="item of items"></item-row-fixed>
export class MyApp {
public message: string = 'Hello Aurelia 2!';
public items = [{}, {}, {}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment