Skip to content

Commit

Permalink
[FEATURE modernized-built-in-components] Implement <LinkTo>
Browse files Browse the repository at this point in the history
Part of #19270
  • Loading branch information
chancancode committed Feb 25, 2021
1 parent 06e434e commit 3d02784
Show file tree
Hide file tree
Showing 20 changed files with 2,291 additions and 1,118 deletions.
2 changes: 1 addition & 1 deletion packages/@ember/-internals/glimmer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export { default as RootTemplate } from './lib/templates/root';
export { default as Checkbox } from './lib/components/checkbox';
export { default as TextField } from './lib/components/text-field';
export { default as TextArea } from './lib/components/-textarea';
export { default as LinkComponent } from './lib/components/link-to';
export { default as LinkComponent } from './lib/components/-link-to';
export { default as Input } from './lib/components/input';
export { default as Textarea } from './lib/components/textarea';
export { default as Component } from './lib/component';
Expand Down
16 changes: 11 additions & 5 deletions packages/@ember/-internals/glimmer/lib/component-managers/curly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { assign } from '@ember/polyfills';
import { DEBUG } from '@glimmer/env';
import {
Bounds,
CapturedArguments,
CompilableProgram,
Destroyable,
ElementOperations,
Expand Down Expand Up @@ -178,14 +179,19 @@ export default class CurlyComponentManager

prepareArgs(ComponentClass: ComponentFactory, args: VMArguments): Option<PreparedArguments> {
if (args.named.has('__ARGS__')) {
assert(
'[BUG] cannot pass both __ARGS__ and positional arguments',
args.positional.length === 0
);

let { __ARGS__, ...rest } = args.named.capture();

// does this need to be untracked?
let __args__ = valueForRef(__ARGS__) as CapturedArguments;

let prepared = {
positional: EMPTY_POSITIONAL_ARGS,
named: {
...rest,
...(valueForRef(__ARGS__) as { [key: string]: Reference }),
},
positional: __args__.positional,
named: { ...rest, ...__args__.named },
};

return prepared;
Expand Down
Loading

0 comments on commit 3d02784

Please sign in to comment.