Releases: aurelia/aurelia
v2.0.0-beta.22
What's Changed
BREAKING CHANGES:
-
ast: correct null/undefined handling (#2055) by @bigopon (b96d7c4)
the default non-strict mode now behaves like optional syntax: property access on null/undefined will return undefined
null/undefined function calls will return undefined. The rest will behave like standard JS, including strict mode -
observers: change callback timing to after notify (#2039) by @ekzobrain, @bigopon (1e587e1)
bindable callback will be called with the timing as "after all have settled", instead of "right when new value comes"
-
parser: no longer provide default to exp parser interface (#2024) by @bigopon (b55cbcd)
In build time compilation, template expressions are parsed at build time, we don't need to bundle the expression parser code again.
This cleanup is to prepare for that. -
ast: separate & allow binding behavior and value converter evaluation to be optional (#2058) by @bigopon (7d7e21b)
Try simplify the interface of ast evaluator so that evaluating ast doesn't always require value converter/binding behavior to be supported.
This is useful in scenarios where we dont need those two: watch/effect/computed/validation message etc...
Features:
- observation: ability to watch an expression (#2059) by @ekzobrain, @bigopon (6cd6b8d)
- runtime-html: reuse host and hostController (#2043) by @Sayan751 (0fe216e)
- bindable: support aggregated callback (#2033) by @ekzobrain, @bigopon (7cdf3f0)
Bug Fixes:
- router-lite: allowed dot in parameter value (#2057) by @Sayan751 (9337c84)
- watch: initialise only once (#2056) by @bigopon (7ae2cfa)
- router: fix refresh with url params issue (#2051) by @jwx (6b733b1)
- repeat: fix update issues when there are duplicates (#2050) by @aegenet, @fkleuver (9834c40)
- router: fix redirect to async raise cond issue (#2046) by @jwx (c5dfca3)
- router-lite: element injection issue (#2045) by @Sayan751 (4d93507)
- validation-i18n: prioritization of translated messages (#2029) by @ivanbacher, @Sayan751 (a5340f8)
- radio: handle repeated start/stop correctly (#2031) by @oskar-anderson, @bigopon (430b8f0)
- validation-html: reset binding while unbinding BB (#2027) by @Sayan751 (a3b1d09)
Docs:
- vite-plugin: add vite instruction for tailwindcss-integration.md (#2028) by @hdzcalmir (47913c5)
New Contributors
- @hdzcalmir made their first contribution in #2028
Full Changelog: v2.0.0-beta.21...v2.0.0-beta.22
v2.0.0-beta.21
2.0.0-beta.21 (2024-08-08)
Features:
Bug Fixes:
- state: ensure all actions queued are called by @bigopon (#2023) (062f398)
- binding: handle glitch by @bigopon (#2020) (0f3dbee)
- router: fix missing filter part for available endpoints by @jwx (#2013) (af7c252)
- router-lite: element injection for routed view-model by @Sayan751 (#2012) (b1508fb)
- types: bindable definitions by @Sayan751 (#2010) (d81b471)
- task-queue: fix timing issue by @fkleuver (#2007) (6777dba)
- router-lite: location URL with no history and fragment routing by @Sayan751 (#2005) (8a84b09)
- vite-plugin: fix vitest Windows issue with html file by @3cp (#2006) (27ec4dd)
Refactorings:
Full Changelog: v2.0.0-beta.20...v2.0.0-beta.21
v2.0.0-beta.20
2.0.0-beta.20 (2024-07-07)
BREAKING CHANGES:
- router-lite: can* hook semantics by @Sayan751 (#2002) (ac5359f)
canLoad
/canUnload
hooks now only treatfalse
asfalse
.
PreviouslycanLoad
andcanUnload
only considertrue
as can do, which means if a routing component has either the hookcanLoad
/canUnload
,
those hooks must returntrue
toload
/unload
. This is not consistent with the rest of the framework, and generally will be easier to miss during refactoring. - router: navigation coordinator refactor by @jwx (#1997) (1b97340)
canLoad
/canUnload
hooks now only treatfalse
asfalse
.
Move responsibilities and recursive code from routing scope to iterative code in navigation coordinator.
Refresh, browser back and forward now behave the same way deep links do: if a viewport with a default component/route has been emptied/cleared the mentioned browser actions will now load the default (instead of keeping the viewport empty). - tooling: bindable inheritance (bb1fe26)
When generating code for.html
file with convention,bindables
export will be a record, instead of an array.
Applications migrating frombeta.15
-beta.19
will need to change the types for.html
modules inresource.d.ts
like the following example:or if it doesn't matter to your applications, simply having... export const bindables: Record<string, Partial<BindableDefinition>> ...
will also work.... export const bindables: Record<string, any> ...
- metadata: metadata is defined on the immediate target class, instead of the first available metadata source (i.e inherited from parent) by @Sayan751 (#1992) (bb1fe26)
Bug Fixes:
Refactorings:
v2.0.0-beta.19
What's Changed
Features:
- feat(dialog): ability to animate not using lifecycles by @ekzobrain & @bigopon in #1986
- feat(plugin-conventions): support foo.module.css CSS module convention by @3cp in #1988
- feat(validation): state rule by @Sayan751 in #1985
- feat(kernel): add ability to deregister di dependencies by @Vheissu in #1981
- feat(event): support common event modifier on all events by @bigopon in #1994
Bug fixes:
- fix(router-lite): replace transition plan for same component with different paths by @Sayan751 in #1982
- fix(css-modules): avoid duplicate registrations by @bigopon & @hdzcalmir in #1989
Refactorings:
Docs:
Chores:
Full Changelog: v2.0.0-beta.18...v2.0.0-beta.19
v2.0.0-beta.18
What's Changed
BREAKING CHANGES:
-
refactor(dom-queue): merge dom read and write queue by @bigopon in #1970
when first started, we went overboard with optimization & many other trends, which resulted in a cumbersome dom queue system. Simplifying them to reduce the number of APIs as well as potential issues.
Features:
- feat(router-lite): current route by @Sayan751 in #1966
- feat(kernel): add last resolver by @Vheissu in #1976
- feat(dialog): ability to specify dialog per open call by @bigopon in #1978
- feat(dialog): ability to customize dialog event management @bigopon in #1978
Bug Fixes:
- fix(convention): typings - use array for bindables isntead of object by @bigopon in #1967
- fix(di): use metadata instead of weakmap @Sayan751 in #1977
Refactoring:
- refactor(fetch-client): extract error codes and cleanup by @bigopon in #1974
- refactor(i18n-validation): replace errors with error codes by @bigopon in #1972
- refactor: define map & set overrides on the instance instead of prototype by @bigopon in #1975
Docs:
- Updated ISignaler documentation example by @ivanbacher in #1973
Full Changelog: v2.0.0-beta.17...v2.0.0-beta.18
v2.0.0-beta.17
What's Changed
BREAKING CHANGES:
-
template: auto infer binding expression when empty by @bigopon in #1963
Previously only the expression of binding to element bindables get auto inferred, now it's expanded to all bindings
with.bind
/.to-view
/.from-view
/.two-way
/.one-time
Examples:<div some-prop.bind=""> means <div some-prop.bind="someProp"> <div some-prop.bind> means <div some-prop.bind="someProp"> <div some-prop.one-time> means <div some-prop.one-time="someProp"> ...
-
convention: rewrite runtime-html decorators by @Sayan751 in #1960
With tooling in the instable state for the tc39 decorator support, we will generate standard fn call code instead of decorator.
This will likely be changed when browsers start officially supporting it, or at least when the tooling (both spec & tooling stability + compat) gets betterIf you are using convention plugin in an existing app, to migrate, update the
resource.d.ts
declaration like the following for*.html
:declare module '*.html' { import { IContainer, PartialBindableDefinition } from 'aurelia'; export const name: string; export const template: string; export default template; export const dependencies: string[]; export const containerless: boolean | undefined; export const bindables: ( | string | (PartialBindableDefinition & { name: string }) )[]; export const shadowOptions: { mode: 'open' | 'closed' } | undefined; export function register(container: IContainer): void; } // ... other declaration like css etc..
Features:
- feat(repeat): allow custom repeatable value by @bigopon in #1962
- feat(template): support spread syntax ... by @bigopon in #1965
Bug fixes:
Refactoring:
Full Changelog: v2.0.0-beta.16...v2.0.0-beta.17
v2.0.0-beta.16
What's Changed
Bug fixes:
- fix(rendering): correctly handle compilation cache by @bigopon in #1955
- fix(au-slot): ensure passthrough slot get the right host value by @bigopon in #1959
Refactorings:
- refactor: move scope to runtime html by @bigopon in #1945
- refactor: cleanup deco code by @bigopon in #1947
- refactor(compiler): simplify definition creation by @bigopon in #1950
- refactor: extract template compiler into own package by @bigopon in #1954
- refactor(router-lite): avoided duplicate CE defn reg to same container by @Sayan751 in #1956
Docs:
Chores:
Full Changelog: v2.0.0-beta.15...v2.0.0-beta.16
v2.0.0-beta.15
What's Changed
BREAKING CHANGES:
- refactor(runtime): migration to TC39 decorators + metadata simplification by @Sayan751 in #1932
- refactor(exp-parser): move to own package by @bigopon in #1943
- refactor(bindings): move binding infra to runtime html by @bigopon in #1944
Features:
Bug fixes:
- fix(vite-plugin): when using ShadowDOM, need to load css as string by @3cp in #1934
- fix(vite-plugin): missed some default options in "load" preprocess by @3cp in #1936
- chore: default options for internal ts-jest instance by @3cp in #1941
Full Changelog: v2.0.0-beta.14...v2.0.0-beta.15
Decorator migration guide
For the Aurelia 2 codebase, the usage of experimental decorators is turned off in #1932, and all the decorators are migrated to the TC39 decorators. This means when you update your Aurelia2 dependencies to v2.0.0-beta.15 or higher, you need to do the following.
- Ensure that you are using the latest TypeScript version, if you are a TypeScript user.
- Remove the following 2 properties from the effective
tsconfig.json
:"emitDecoratorMetadata": true
and"experimentalDecorators": true
. This activates the native/TC39 decorator. - Ensure that the
target
property is set to something lower thanesnext
. If this is set toesnext
, then TypeScript assumes reasonably that the target runtime supports decorators natively, and hence does not transpile those. - The decorator proposal does not support parameter decorators (yet). Hence, the following code won't work any longer.
Instead, use the
class MyClass { public constructor( @IBar private readonly bar: IBar, @IFoo foo: IFoo, ) {} }
resolve
function.import { resolve } from 'aurelia'; // also can be exported from `@aurelia/kernel`. class MyClass { private readonly bar: IBar = resolve(IBar); public constructor( // alternative#1 foo: IFoo = resolve(IFoo) ) { // alternative#2 const foo: IFoo = resolve(IFoo) } }
- If you are a TypeScript user, and were already using bindable coercers, it might not work after the update. Previously, this feature depended on the emission of design time type metadata. However, TypeScript does not emit this metadata any more with the standardized decorators (yet). Refer microsoft/TypeScript#55788 and microsoft/TypeScript#57533 for more information. For now, you can explicitly specify the type when declaring bindables.
- If you are using only Aurelia decorators in your code, it should be fine if the aforementioned changes are performed. In case you have developed your own decorators, then you need to migrate those by yourself. Here are a couple of resources that can be helpful:
- JavaScript metaprogramming with the 2022-03 decorators API by Dr. Axel Rauschmayer
- TypeScript 5.0 release notes.
- Use the TypeScript playground to check the transpiled code to make you aware of the timings, at which different parts of your decorators are invoked.
- If you are using the Aurelia2 convention plugin, in most case it should work as it supposed to. In case it does not, please inform us.
- If you are not using TypeScript and were already using decorators somehow, consult your transpiler tool docs on how to use the new standard/native decorators.
v2.0.0-beta.14
What's Changed
Features:
- feat(i18n): support multiple versions of i18next by @bigopon in #1927
- feat(custom-attribute): ability to find closest attr by name or ctor by @bigopon in #1928
Refactoring:
Bug fixes:
- fix(form): prevent actionless submission by @bigopon in #1931
- fix(enhance): dont call app tasks from parent container by @bigopon in #1933
Full Changelog: v2.0.0-beta.13...v2.0.0-beta.14
v2.0.0-beta.13
What's Changed
BREAKING CHANGES:
Features:
- feat(template-controller): ability to have a container per factory by @bigopon in #1924
- feat(process-content): ability to add information to a data object by @bigopon in #1925
- feat(dev): better DI error messages for instantiation by @bigopon in #1917
- feat(convention): add import as support by @bigopon in #1920
Refactoring:
- refactor(resource): cleanup registration, APIs by @bigopon in #1918
- chore: cleanup, better router error messages by @bigopon in #1922
Docs:
Full Changelog: v2.0.0-beta.12...v2.0.0-beta.13