forked from emberjs/ember.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Test new outlet #4
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
Open
BobrImperator
wants to merge
13
commits into
rfc-1169-route-manager
Choose a base branch
from
test-new-outlet
base: rfc-1169-route-manager
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
68fc807
small experiment with a new @outlet
mansona c0522c5
fix: invoke outlet helper before passing it as named arg
BobrImperator 4b0f767
feat: transform {{outlet}} to <@outlet />
BobrImperator b9663d8
WIP: fix debug render tree?
mansona eb25131
try to use renderComponent for toplevel
mansona 4ce9867
fix: error while rendering outlet without dynamicScope
BobrImperator e942972
feat: creat a root-outlet.ts to replace the -outlet view
BobrImperator 7b90594
refactor: cleanup OutletView and OutletTemplate
BobrImperator eb11aa1
fix: pass renderer to resolve {{mount}}. Fix rootElement on boot
BobrImperator 9d626c1
wip: bulk AI test fixes
BobrImperator 809cbc4
fix: avoid circular dependency cycle
BobrImperator 6382317
refactor: uncomment debug-render-tree tests
BobrImperator 523d52e
run format
BobrImperator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,14 @@ import type { Nullable } from '@ember/-internals/utility-types'; | |
| import { assert } from '@ember/debug'; | ||
| import type EngineInstance from '@ember/engine/instance'; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move to the route-managers/classic/ directory - this is where its only consumers are |
||
| import { _instrumentStart } from '@ember/instrumentation'; | ||
| import { precompileTemplate } from '@ember/template-compilation'; | ||
| import type { | ||
| CompilableProgram, | ||
| ComponentDefinition, | ||
| CustomRenderNode, | ||
| Destroyable, | ||
| Environment, | ||
| InternalComponentCapabilities, | ||
| TemplateFactory, | ||
| VMArguments, | ||
| WithCreateInstance, | ||
| WithCustomDebugRenderTree, | ||
|
|
@@ -23,7 +23,6 @@ import { unwrapTemplate } from './unwrap-template'; | |
|
|
||
| import type { DynamicScope } from '../renderer'; | ||
| import type { OutletState } from '../utils/outlet'; | ||
| import type OutletView from '../views/outlet'; | ||
|
|
||
| function instrumentationPayload(def: OutletDefinitionState) { | ||
| // "main" used to be the outlet name, keeping it around for compatibility | ||
|
|
@@ -43,10 +42,9 @@ export interface OutletDefinitionState { | |
| name: string; | ||
|
|
||
| /** | ||
| * What this outlet renders. The root `OutletView` provides the upgraded | ||
| * root template as `invokable`; per-outlet states built by the `{{outlet}}` | ||
| * helper carry the manager's `wrapper` (when present) plus `invokable` and | ||
| * `controller`, which the helper's stability check keys on. | ||
| * What this outlet renders. States built by the `{{outlet}}` helper carry | ||
| * the manager's `wrapper` (when present) plus `invokable` and `controller`, | ||
| * which the helper's stability check keys on. | ||
| */ | ||
| controller?: unknown; | ||
| wrapper?: object; | ||
|
|
@@ -180,16 +178,6 @@ class OutletComponentManager | |
|
|
||
| const OUTLET_MANAGER = /*@__PURE__*/ new OutletComponentManager(); | ||
|
|
||
| // The one outlet layout. `@Component` is always a value that already | ||
| // carries everything it needs — the outlet helper curries the args (the | ||
| // invokable/bucket/live context for wrapped renders, the live context for | ||
| // wrapper-less ones) onto the render target before handing it over, and the | ||
| // root outlet's invokable takes no args at all. Keeping the layout arg-less | ||
| // also keeps stray named args out of the debug render tree. | ||
| const OUTLET_COMPONENT_TEMPLATE = precompileTemplate('<@Component />', { | ||
| strictMode: true, | ||
| }); | ||
|
|
||
| export class OutletComponent implements ComponentDefinition< | ||
| OutletDefinitionState, | ||
| OutletInstanceState, | ||
|
|
@@ -204,12 +192,9 @@ export class OutletComponent implements ComponentDefinition< | |
|
|
||
| constructor( | ||
| owner: InternalOwner, | ||
| public state: OutletDefinitionState | ||
| public state: OutletDefinitionState, | ||
| template: TemplateFactory | ||
| ) { | ||
| this.compilable = unwrapTemplate(OUTLET_COMPONENT_TEMPLATE(owner)).asLayout(); | ||
| this.compilable = unwrapTemplate(template(owner)).asLayout(); | ||
| } | ||
| } | ||
|
|
||
| export function createRootOutlet(outletView: OutletView): OutletComponent { | ||
| return new OutletComponent(outletView.owner, outletView.state); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import { precompileTemplate } from '@ember/template-compilation'; | ||
| import { outletHelper } from '../syntax/outlet'; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above |
||
| import { outletHelper } from '../../../routing/route-managers/classic/outlet'; | ||
|
|
||
| export default precompileTemplate(`{{component (outletHelper)}}`, { | ||
| moduleName: 'packages/@ember/-internals/glimmer/lib/templates/outlet.hbs', | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will need a bunch more tests <3
in particular:
and do the reactivity of A and B stay in the same location and not re-order themselves?
(This was the issue I ran in to during implementation, in that whatever was updated last would become last in DOM-order)
(also, I think this behavior will need its own RFC, describing the stability of render-order (and update-order), and probably
appendTorather than a booling, imo -- boolean configurable options are a bit of an ick for me)