|
1 | 1 | import type { InternalOwner } from '@ember/-internals/owner';
|
2 |
| -import { assert } from '@ember/debug'; |
| 2 | +import { assert, deprecate } from '@ember/debug'; |
3 | 3 | import { DEBUG } from '@glimmer/env';
|
4 | 4 | import type { CapturedArguments, DynamicScope } from '@glimmer/interfaces';
|
5 | 5 | import { CurriedType } from '@glimmer/interfaces';
|
@@ -124,6 +124,36 @@ function stateFor(ref: Reference, outlet: OutletState | undefined): OutletDefini
|
124 | 124 | // and is no longer considered supported
|
125 | 125 | if (isTemplateFactory(template)) {
|
126 | 126 | template = template(render.owner);
|
| 127 | + |
| 128 | + if (DEBUG) { |
| 129 | + let message = |
| 130 | + 'The `template` property of `OutletState` should be a ' + |
| 131 | + '`Template` rather than a `TemplateFactory`. This is known to be a ' + |
| 132 | + "problem in older versions of `@ember/test-helpers`. If you haven't " + |
| 133 | + 'done so already, try upgrading to the latest version.\n\n'; |
| 134 | + |
| 135 | + if (template.result === 'ok' && typeof template.moduleName === 'string') { |
| 136 | + message += |
| 137 | + 'The offending template has a moduleName `' + |
| 138 | + template.moduleName + |
| 139 | + '`, which might be helpful for identifying ' + |
| 140 | + 'source of this issue.\n\n'; |
| 141 | + } |
| 142 | + |
| 143 | + message += |
| 144 | + 'Please note that `OutletState` is a private API in Ember.js ' + |
| 145 | + "and not meant to be used outside of the framework's internal code."; |
| 146 | + |
| 147 | + deprecate(message, false, { |
| 148 | + id: 'outlet-state-template-factory', |
| 149 | + until: '5.9.0', |
| 150 | + for: 'ember-source', |
| 151 | + since: { |
| 152 | + available: '5.5.0', |
| 153 | + enabled: '5.5.0', |
| 154 | + }, |
| 155 | + }); |
| 156 | + } |
127 | 157 | }
|
128 | 158 |
|
129 | 159 | return {
|
|
0 commit comments