ember-cli 4.0.0 → 4.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +4 -4
- package/CHANGELOG.md +17 -2
- package/blueprints/app/files/package.json +2 -2
- package/docs/build/data.json +3 -3
- package/lib/models/host-info-cache.js +3 -5
- package/lib/models/per-bundle-addon-cache/index.js +2 -3
- package/lib/utilities/get-lang-arg.js +45 -45
- package/package.json +25 -25
- package/.github/ISSUE_TEMPLATE.md +0 -12
- package/.github/dependabot.yml +0 -15
- package/.github/workflows/coverage.yml +0 -31
- package/docs/analytics.md +0 -44
- package/docs/architecture.md +0 -316
- package/docs/assets/architecture/Ember-CLI architecture.png +0 -0
- package/docs/assets/architecture/Ember-CLI architecture.xml +0 -1
- package/docs/assets/architecture/README.md +0 -5
- package/docs/brocfile-transition.md +0 -46
- package/docs/build/api.js +0 -44
- package/docs/build/assets/css/external-small.png +0 -0
- package/docs/build/assets/css/logo.png +0 -0
- package/docs/build/assets/css/main.css +0 -555
- package/docs/build/assets/favicon.ico +0 -0
- package/docs/build/assets/img/spinner.gif +0 -0
- package/docs/build/assets/index.html +0 -10
- package/docs/build/assets/js/api-filter.js +0 -56
- package/docs/build/assets/js/api-list.js +0 -255
- package/docs/build/assets/js/api-search.js +0 -98
- package/docs/build/assets/js/apidocs.js +0 -376
- package/docs/build/assets/js/yui-prettify.js +0 -17
- package/docs/build/assets/vendor/prettify/CHANGES.html +0 -130
- package/docs/build/assets/vendor/prettify/COPYING +0 -202
- package/docs/build/assets/vendor/prettify/README.html +0 -203
- package/docs/build/assets/vendor/prettify/prettify-min.css +0 -1
- package/docs/build/assets/vendor/prettify/prettify-min.js +0 -1
- package/docs/build/classes/Addon.html +0 -4318
- package/docs/build/classes/AmdTransformAddon.html +0 -202
- package/docs/build/classes/Blueprint.html +0 -4796
- package/docs/build/classes/Builder.html +0 -611
- package/docs/build/classes/CLI.html +0 -810
- package/docs/build/classes/Command.html +0 -1655
- package/docs/build/classes/DefaultPackager.html +0 -202
- package/docs/build/classes/EmberAddon.html +0 -2207
- package/docs/build/classes/EmberApp.html +0 -2225
- package/docs/build/classes/HardwareInfo.html +0 -620
- package/docs/build/classes/HistorySupportAddon.html +0 -203
- package/docs/build/classes/Instrumentation.html +0 -695
- package/docs/build/classes/NodeModulesList.html +0 -460
- package/docs/build/classes/NpmTask.html +0 -333
- package/docs/build/classes/PackageInfo.html +0 -1390
- package/docs/build/classes/PackageInfoCache.html +0 -963
- package/docs/build/classes/PerBundleAddonCache {.html +0 -1010
- package/docs/build/classes/Project.html +0 -2083
- package/docs/build/classes/ServeFilesAddon.html +0 -260
- package/docs/build/classes/TestsServerAddon.html +0 -203
- package/docs/build/classes/WatcherAddon.html +0 -204
- package/docs/build/classes/WindowsSymlinkChecker.html +0 -1505
- package/docs/build/files/lib_broccoli_default-packager.js.html +0 -1426
- package/docs/build/files/lib_broccoli_ember-addon.js.html +0 -159
- package/docs/build/files/lib_broccoli_ember-app.js.html +0 -1913
- package/docs/build/files/lib_cli_cli.js.html +0 -417
- package/docs/build/files/lib_models_addon-info.js.html +0 -112
- package/docs/build/files/lib_models_addon.js.html +0 -1866
- package/docs/build/files/lib_models_blueprint.js.html +0 -1678
- package/docs/build/files/lib_models_builder.js.html +0 -417
- package/docs/build/files/lib_models_command.js.html +0 -804
- package/docs/build/files/lib_models_hardware-info.js.html +0 -479
- package/docs/build/files/lib_models_host-info-cache.js.html +0 -428
- package/docs/build/files/lib_models_installation-checker.js.html +0 -181
- package/docs/build/files/lib_models_instantiate-addons.js.html +0 -191
- package/docs/build/files/lib_models_instrumentation.js.html +0 -433
- package/docs/build/files/lib_models_package-info-cache_index.js.html +0 -793
- package/docs/build/files/lib_models_package-info-cache_node-modules-list.js.html +0 -208
- package/docs/build/files/lib_models_package-info-cache_package-info.js.html +0 -661
- package/docs/build/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html +0 -252
- package/docs/build/files/lib_models_per-bundle-addon-cache_index.js.html +0 -485
- package/docs/build/files/lib_models_per-bundle-addon-cache_target-instance.js.html +0 -108
- package/docs/build/files/lib_models_project.js.html +0 -913
- package/docs/build/files/lib_models_task.js.html +0 -117
- package/docs/build/files/lib_tasks_build-watch.js.html +0 -157
- package/docs/build/files/lib_tasks_npm-task.js.html +0 -463
- package/docs/build/files/lib_tasks_serve.js.html +0 -207
- package/docs/build/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html +0 -127
- package/docs/build/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html +0 -158
- package/docs/build/files/lib_tasks_server_middleware_history-support_index.js.html +0 -181
- package/docs/build/files/lib_tasks_server_middleware_tests-server_index.js.html +0 -171
- package/docs/build/files/lib_tasks_test-server.js.html +0 -167
- package/docs/build/files/lib_tasks_transforms_amd_index.js.html +0 -143
- package/docs/build/files/lib_utilities_ember-app-utils.js.html +0 -292
- package/docs/build/files/lib_utilities_insert-into-file.js.html +0 -219
- package/docs/build/files/lib_utilities_is-lazy-engine.js.html +0 -125
- package/docs/build/files/lib_utilities_is-yarn-project.js.html +0 -120
- package/docs/build/files/lib_utilities_valid-project-name.js.html +0 -142
- package/docs/build/files/lib_utilities_will-interrupt-process.js.html +0 -290
- package/docs/build/files/lib_utilities_windows-admin.js.html +0 -230
- package/docs/build/index.html +0 -125
- package/docs/build/modules/ember-cli.html +0 -152
- package/docs/build/modules/is-lazy-engine.html +0 -106
- package/docs/build-concurrency.md +0 -15
- package/docs/build-pipeline-debugging.md +0 -33
- package/docs/code-coverage.md +0 -14
- package/docs/error-propagation.md +0 -136
- package/docs/experiments.md +0 -53
- package/docs/node-support.md +0 -43
- package/docs/perf-guide.md +0 -250
- package/docs/project_version_preprocessor.js +0 -8
- package/docs/sourcemaps.md +0 -60
- package/docs/yuidoc.json +0 -13
|
@@ -1,1010 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>PerBundleAddonCache { - ember-cli</title>
|
|
6
|
-
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
|
7
|
-
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
|
8
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/yui/3.18.0/yui/yui-min.js"></script>
|
|
9
|
-
</head>
|
|
10
|
-
<body class="yui3-skin-sam">
|
|
11
|
-
|
|
12
|
-
<div id="doc">
|
|
13
|
-
<div class="yui3-g">
|
|
14
|
-
<div id="sidebar" class="yui3-u">
|
|
15
|
-
<div class="logo">
|
|
16
|
-
<a href="../index.html">
|
|
17
|
-
<img src="https://ember-cli.com/assets/images/ember-cli-logo-small-dark.png">
|
|
18
|
-
</a>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div id="modules" class="sidebox">
|
|
22
|
-
<div class="hd">
|
|
23
|
-
<h2 class="no-toc">Modules</h2>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="bd">
|
|
26
|
-
<ul>
|
|
27
|
-
<li><a href="../modules/ember-cli.html">ember-cli</a>
|
|
28
|
-
</li>
|
|
29
|
-
<li><a href="../modules/is-lazy-engine.html">is-lazy-engine</a>
|
|
30
|
-
</li>
|
|
31
|
-
</ul>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<div id="classes" class="sidebox">
|
|
36
|
-
<div class="hd">
|
|
37
|
-
<h2 class="no-toc">Classes</h2>
|
|
38
|
-
</div>
|
|
39
|
-
<div class="bd">
|
|
40
|
-
<ul>
|
|
41
|
-
<li><a href="../classes/Addon.html">Addon</a></li>
|
|
42
|
-
<li><a href="../classes/AmdTransformAddon.html">AmdTransformAddon</a></li>
|
|
43
|
-
<li><a href="../classes/Blueprint.html">Blueprint</a></li>
|
|
44
|
-
<li><a href="../classes/Builder.html">Builder</a></li>
|
|
45
|
-
<li><a href="../classes/CLI.html">CLI</a></li>
|
|
46
|
-
<li><a href="../classes/Command.html">Command</a></li>
|
|
47
|
-
<li><a href="../classes/DefaultPackager.html">DefaultPackager</a></li>
|
|
48
|
-
<li><a href="../classes/EmberAddon.html">EmberAddon</a></li>
|
|
49
|
-
<li><a href="../classes/EmberApp.html">EmberApp</a></li>
|
|
50
|
-
<li><a href="../classes/HardwareInfo.html">HardwareInfo</a></li>
|
|
51
|
-
<li><a href="../classes/HistorySupportAddon.html">HistorySupportAddon</a></li>
|
|
52
|
-
<li><a href="../classes/Instrumentation.html">Instrumentation</a></li>
|
|
53
|
-
<li><a href="../classes/NodeModulesList.html">NodeModulesList</a></li>
|
|
54
|
-
<li><a href="../classes/NpmTask.html">NpmTask</a></li>
|
|
55
|
-
<li><a href="../classes/PackageInfo.html">PackageInfo</a></li>
|
|
56
|
-
<li><a href="../classes/PackageInfoCache.html">PackageInfoCache</a></li>
|
|
57
|
-
<li><a href="../classes/PerBundleAddonCache {.html">PerBundleAddonCache {</a></li>
|
|
58
|
-
<li><a href="../classes/Project.html">Project</a></li>
|
|
59
|
-
<li><a href="../classes/ServeFilesAddon.html">ServeFilesAddon</a></li>
|
|
60
|
-
<li><a href="../classes/TestsServerAddon.html">TestsServerAddon</a></li>
|
|
61
|
-
<li><a href="../classes/WatcherAddon.html">WatcherAddon</a></li>
|
|
62
|
-
<li><a href="../classes/WindowsSymlinkChecker.html">WindowsSymlinkChecker</a></li>
|
|
63
|
-
</ul>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<div id="sections" class="sidebox">
|
|
69
|
-
<div class="hd">
|
|
70
|
-
<h2 class="no-toc">PerBundleAddonCache {</h2>
|
|
71
|
-
</div>
|
|
72
|
-
<div class="bd">
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<div><a href="#method-summary">Method Summary</a></div>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<div><a href="#public-methods">Public Methods</a></div>
|
|
92
|
-
<ul>
|
|
93
|
-
<li><a href="#method_allowCachingPerBundle">allowCachingPerBundle</a></li>
|
|
94
|
-
<li><a href="#method_bundleHostOwnsInstance">bundleHostOwnsInstance</a></li>
|
|
95
|
-
<li><a href="#method_createAddonCacheEntry">createAddonCacheEntry</a></li>
|
|
96
|
-
<li><a href="#method_createBundleHostCacheEntry">createBundleHostCacheEntry</a></li>
|
|
97
|
-
<li><a href="#method_findBundleHost">findBundleHost</a></li>
|
|
98
|
-
<li><a href="#method_getAddonInstance">getAddonInstance</a></li>
|
|
99
|
-
<li><a href="#method_getAddonProxy">getAddonProxy</a></li>
|
|
100
|
-
<li><a href="#method_resolvePerBundleAddonCacheUtil">resolvePerBundleAddonCacheUtil</a></li>
|
|
101
|
-
<li><a href="#method_validateCacheKey">validateCacheKey</a></li>
|
|
102
|
-
</ul>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<div class="version-info">
|
|
111
|
-
Version: 4.0.0-release-b4cbb1029f
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<div id="main" class="yui3-u">
|
|
117
|
-
<div class="content"><div class="title">
|
|
118
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l46"><code>lib/models/per-bundle-addon-cache/index.js:46</code></a></span>
|
|
119
|
-
<h1 class="class-name">PerBundleAddonCache {</h1>
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<div class="class-description"><p>For large applications with many addons (and many instances of each, resulting in
|
|
126
|
-
potentially many millions of addon instances during a build), the build can become
|
|
127
|
-
very, very slow (tens of minutes) partially due to the sheer number of addon instances.
|
|
128
|
-
The PerBundleAddonCache deals with this slowness by doing 3 things:</p>
|
|
129
|
-
<p>(1) Making only a single copy of each of certain addons and their dependent addons
|
|
130
|
-
(2) Replacing any other instances of those addons with Proxy copies to the single instance
|
|
131
|
-
(3) Having the Proxies return an empty array for their dependent addons, rather
|
|
132
|
-
than proxying to the contents of the single addon instance. This gives up the
|
|
133
|
-
ability of the Proxies to traverse downward into their child addons,
|
|
134
|
-
something that many addons do not do anyway, for the huge reduction in duplications
|
|
135
|
-
of those child addons. For applications that enable <code>ember-engines</code> dedupe logic,
|
|
136
|
-
that logic is stateful, and having the Proxies allow access to the child addons array
|
|
137
|
-
just breaks everything, because that logic will try multiple times to remove items
|
|
138
|
-
it thinks are duplicated, messing up the single copy of the child addon array.
|
|
139
|
-
See the explanation of the dedupe logic in
|
|
140
|
-
{@link <a href="https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/deeply-non-duplicated-addon.js">https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/deeply-non-duplicated-addon.js</a>}</p>
|
|
141
|
-
<p>What follows are the more technical details of how the PerBundleAddonCache implements
|
|
142
|
-
the above 3 behaviors.</p>
|
|
143
|
-
<p>This class supports per-bundle-host (bundle host = project or lazy engine)
|
|
144
|
-
caching of addon instances. During addon initialization we cannot add a
|
|
145
|
-
cache to each bundle host object AFTER it is instantiated because running the
|
|
146
|
-
addon constructor ultimately causes Addon class <code>setupRegistry</code> code to
|
|
147
|
-
run which instantiates child addons, which need the cache to already be
|
|
148
|
-
in place for the parent bundle host.
|
|
149
|
-
We handle this by providing a global cache that exists independent of the
|
|
150
|
-
bundle host objects. That is this object.</p>
|
|
151
|
-
<p>There are a number of "behaviors" being implemented by this object and
|
|
152
|
-
its contents. They are:
|
|
153
|
-
(1) Any addon that is a lazy engine has only a single real instance per
|
|
154
|
-
project - all other references to the lazy engine are to be proxies. These
|
|
155
|
-
lazy engines are compared by name, not by packageInfo.realPath.
|
|
156
|
-
(2) Any addon that is not a lazy engine, there is only a single real instance
|
|
157
|
-
of the addon per "bundle host" (i.e. lazy engine or project).
|
|
158
|
-
(3) An optimization - any addon that is in a lazy engine but that is also
|
|
159
|
-
in bundled by its LCA host - the single instance is the one bundled by this
|
|
160
|
-
host. All other instances (in any lazy engine) are proxies.</p>
|
|
161
|
-
<p>NOTE: the optimization is only enabled if the environment variable that controls
|
|
162
|
-
<code>ember-engines</code> transitive deduplication (process.env.EMBER_ENGINES_ADDON_DEDUPE)
|
|
163
|
-
is set to a truthy value. For more info, see:
|
|
164
|
-
<a href="https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L396">https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L396</a></p>
|
|
165
|
-
</div>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<h2 id="method-summary">Method Summary</h2>
|
|
175
|
-
|
|
176
|
-
<table class="summary">
|
|
177
|
-
<thead>
|
|
178
|
-
<tr>
|
|
179
|
-
<th colspan="2">Public Methods</th>
|
|
180
|
-
</tr>
|
|
181
|
-
</thead>
|
|
182
|
-
<tbody>
|
|
183
|
-
<tr>
|
|
184
|
-
<td>
|
|
185
|
-
public
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
</td>
|
|
189
|
-
<td>
|
|
190
|
-
<div class="method-name ">
|
|
191
|
-
<a href="#method_allowCachingPerBundle">allowCachingPerBundle</a>(addonEntryPointModule): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>
|
|
192
|
-
</div>
|
|
193
|
-
<div class="short-description">
|
|
194
|
-
<p>The default implementation here is to indicate if the original addon entry point has the <code>allowCachingPerBundle</code> flag set either on itself or on its prototype.</p>
|
|
195
|
-
</div>
|
|
196
|
-
</td>
|
|
197
|
-
</tr>
|
|
198
|
-
<tr>
|
|
199
|
-
<td>
|
|
200
|
-
public
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
</td>
|
|
204
|
-
<td>
|
|
205
|
-
<div class="method-name ">
|
|
206
|
-
<a href="#method_bundleHostOwnsInstance">bundleHostOwnsInstance</a>((Object}, addonPkgInfo): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>
|
|
207
|
-
</div>
|
|
208
|
-
<div class="short-description">
|
|
209
|
-
<p>An optimization we support from lazy engines is the following:</p>
|
|
210
|
-
</div>
|
|
211
|
-
</td>
|
|
212
|
-
</tr>
|
|
213
|
-
<tr>
|
|
214
|
-
<td>
|
|
215
|
-
public
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</td>
|
|
219
|
-
<td>
|
|
220
|
-
<div class="method-name ">
|
|
221
|
-
<a href="#method_createAddonCacheEntry">createAddonCacheEntry</a>(addonInstance, addonRealPath): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
|
|
222
|
-
</div>
|
|
223
|
-
<div class="short-description">
|
|
224
|
-
<p>Create a cache entry object for a given (non-bundle-host) addon to put into an addon cache.</p>
|
|
225
|
-
</div>
|
|
226
|
-
</td>
|
|
227
|
-
</tr>
|
|
228
|
-
<tr>
|
|
229
|
-
<td>
|
|
230
|
-
public
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
</td>
|
|
234
|
-
<td>
|
|
235
|
-
<div class="method-name ">
|
|
236
|
-
<a href="#method_createBundleHostCacheEntry">createBundleHostCacheEntry</a>(bundleHostPkgInfo): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
|
|
237
|
-
</div>
|
|
238
|
-
<div class="short-description">
|
|
239
|
-
<p>Creates a cache entry for the bundleHostCache. Because we want to use the same sort of proxy for both bundle hosts and for 'regular' addon instances (though their cache entries have slightly different structures) we'll use the Symbol from getAddonProxy.</p>
|
|
240
|
-
</div>
|
|
241
|
-
</td>
|
|
242
|
-
</tr>
|
|
243
|
-
<tr>
|
|
244
|
-
<td>
|
|
245
|
-
public
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
</td>
|
|
249
|
-
<td>
|
|
250
|
-
<div class="method-name ">
|
|
251
|
-
<a href="#method_findBundleHost">findBundleHost</a>(addonParent, addonPkgInfo): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
|
|
252
|
-
</div>
|
|
253
|
-
<div class="short-description">
|
|
254
|
-
<p>Given a parent object of a potential addon (another addon or the project), go up the 'parent' chain to find the potential addon's bundle host object (i.e. lazy engine or project.) Because Projects are always bundle hosts, this should always pass, but we'll throw if somehow it doesn't work.</p>
|
|
255
|
-
</div>
|
|
256
|
-
</td>
|
|
257
|
-
</tr>
|
|
258
|
-
<tr>
|
|
259
|
-
<td>
|
|
260
|
-
public
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
</td>
|
|
264
|
-
<td>
|
|
265
|
-
<div class="method-name ">
|
|
266
|
-
<a href="#method_getAddonInstance">getAddonInstance</a>(parent, addonPkgInfo): <a href="../classes/Addon.html" class="crosslink">Addon</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy" class="crosslink external" target="_blank">Proxy</a>
|
|
267
|
-
</div>
|
|
268
|
-
<div class="short-description">
|
|
269
|
-
<p>Called from PackageInfo.getAddonInstance(), return an instance of the requested addon or a Proxy, based on the type of addon and its bundle host.</p>
|
|
270
|
-
</div>
|
|
271
|
-
</td>
|
|
272
|
-
</tr>
|
|
273
|
-
<tr>
|
|
274
|
-
<td>
|
|
275
|
-
public
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
</td>
|
|
279
|
-
<td>
|
|
280
|
-
<div class="method-name ">
|
|
281
|
-
<a href="#method_getAddonProxy">getAddonProxy</a>(targetCacheEntry, parent):
|
|
282
|
-
</div>
|
|
283
|
-
<div class="short-description">
|
|
284
|
-
<p>Returns a proxy to a target with specific handling for the <code>parent</code> property, as well has to handle the <code>app</code> property; that is, the proxy should maintain correct local state in closure scope for the <code>app</code> property if it happens to be set by <code>ember-cli</code>. Other than <code>parent</code> & <code>app</code>, this function also proxies <em>almost</em> everything to <code>target[TARGET_INSTANCE] with a few exceptions: we trap & return</code>[]<code>for</code>addons<code>, and we don't return the original</code>included<code>(it's already called on the "real" addon by</code>ember-cli`).</p>
|
|
285
|
-
</div>
|
|
286
|
-
</td>
|
|
287
|
-
</tr>
|
|
288
|
-
<tr>
|
|
289
|
-
<td>
|
|
290
|
-
public
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
</td>
|
|
294
|
-
<td>
|
|
295
|
-
<div class="method-name ">
|
|
296
|
-
<a href="#method_resolvePerBundleAddonCacheUtil">resolvePerBundleAddonCacheUtil</a>(project): AllowCachingPerBundle: Function
|
|
297
|
-
</div>
|
|
298
|
-
<div class="short-description">
|
|
299
|
-
<p>Resolves the perBundleAddonCacheUtil; this prefers the custom provided version by the consuming application, and defaults to an internal implementation here.</p>
|
|
300
|
-
</div>
|
|
301
|
-
</td>
|
|
302
|
-
</tr>
|
|
303
|
-
<tr>
|
|
304
|
-
<td>
|
|
305
|
-
public
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
</td>
|
|
309
|
-
<td>
|
|
310
|
-
<div class="method-name ">
|
|
311
|
-
<a href="#method_validateCacheKey">validateCacheKey</a>(realAddonInstance, treeType, newCacheKey)
|
|
312
|
-
</div>
|
|
313
|
-
<div class="short-description">
|
|
314
|
-
<p>Validates that a new cache key for a given tree type matches the previous cache key for the same tree type. To opt-in to bundle addon caching for a given addon it's assumed that it returns stable cache keys; specifically this is because the interplay between bundle addon caching and <code>ember-engines</code> when transitive deduplication is enabled assumes stable cache keys, so we validate for this case here.</p>
|
|
315
|
-
</div>
|
|
316
|
-
</td>
|
|
317
|
-
</tr>
|
|
318
|
-
</tbody>
|
|
319
|
-
</table>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
<div id="methods public">
|
|
336
|
-
<h2 id="public-methods">Public Methods</h2>
|
|
337
|
-
<div class="method item">
|
|
338
|
-
<div id="method_allowCachingPerBundle" class="title">
|
|
339
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l116"><code>lib/models/per-bundle-addon-cache/index.js:116</code></a></span>
|
|
340
|
-
<h3 class="">
|
|
341
|
-
public
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
allowCachingPerBundle(addonEntryPointModule): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>
|
|
345
|
-
</h3>
|
|
346
|
-
</div>
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
<div class="method-description"><p>The default implementation here is to indicate if the original addon entry point has
|
|
351
|
-
the <code>allowCachingPerBundle</code> flag set either on itself or on its prototype.</p>
|
|
352
|
-
<p>If a consuming application specifies a relative path to a custom utility via the
|
|
353
|
-
<code>ember-addon.perBundleAddonCacheUtil</code> configuration, we prefer the custom implementation
|
|
354
|
-
provided by the consumer.</p>
|
|
355
|
-
</div>
|
|
356
|
-
|
|
357
|
-
<div class="params">
|
|
358
|
-
<h4>Parameters:</h4>
|
|
359
|
-
<table>
|
|
360
|
-
<thead>
|
|
361
|
-
<tr>
|
|
362
|
-
<th>Name</th>
|
|
363
|
-
<th>Type</th>
|
|
364
|
-
<th>Attribute</th>
|
|
365
|
-
<th>Description</th>
|
|
366
|
-
</tr>
|
|
367
|
-
</thead>
|
|
368
|
-
<tbody>
|
|
369
|
-
<tr>
|
|
370
|
-
<td>addonEntryPointModule</td>
|
|
371
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a></td>
|
|
372
|
-
<td>
|
|
373
|
-
<ul>
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
</ul>
|
|
378
|
-
</td>
|
|
379
|
-
<td> </td>
|
|
380
|
-
</tr>
|
|
381
|
-
|
|
382
|
-
</tbody>
|
|
383
|
-
</table>
|
|
384
|
-
</div>
|
|
385
|
-
|
|
386
|
-
<div class="return">
|
|
387
|
-
<h4>Return:</h4>
|
|
388
|
-
<div>
|
|
389
|
-
<span class="return-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
|
|
390
|
-
<span class="return-description"><p>true if the given constructor function or class supports caching per bundle, false otherwise</p>
|
|
391
|
-
</span>
|
|
392
|
-
</div>
|
|
393
|
-
</div>
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
</div>
|
|
397
|
-
<div class="method item">
|
|
398
|
-
<div id="method_bundleHostOwnsInstance" class="title">
|
|
399
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l197"><code>lib/models/per-bundle-addon-cache/index.js:197</code></a></span>
|
|
400
|
-
<h3 class="">
|
|
401
|
-
public
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
bundleHostOwnsInstance((Object}, addonPkgInfo): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>
|
|
405
|
-
</h3>
|
|
406
|
-
</div>
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
<div class="method-description"><p>An optimization we support from lazy engines is the following:</p>
|
|
411
|
-
<p>If an addon instance is supposed to be bundled with a particular lazy engine, and
|
|
412
|
-
same addon is also to be bundled by a common LCA host, prefer the one bundled by the
|
|
413
|
-
host (since it's ultimately going to be deduped later by <code>ember-engines</code>).</p>
|
|
414
|
-
<p>NOTE: this only applies if this.engineAddonTransitiveDedupeEnabled is truthy. If it is not,
|
|
415
|
-
the bundle host always "owns" the addon instance.</p>
|
|
416
|
-
<p>If deduping is enabled and the LCA host also depends on the same addon,
|
|
417
|
-
the lazy-engine instances of the addon will all be proxies to the one in
|
|
418
|
-
the LCA host. This function indicates whether the bundle host passed in
|
|
419
|
-
(either the project or a lazy engine) is really the bundle host to "own" the
|
|
420
|
-
new addon.</p>
|
|
421
|
-
</div>
|
|
422
|
-
|
|
423
|
-
<div class="params">
|
|
424
|
-
<h4>Parameters:</h4>
|
|
425
|
-
<table>
|
|
426
|
-
<thead>
|
|
427
|
-
<tr>
|
|
428
|
-
<th>Name</th>
|
|
429
|
-
<th>Type</th>
|
|
430
|
-
<th>Attribute</th>
|
|
431
|
-
<th>Description</th>
|
|
432
|
-
</tr>
|
|
433
|
-
</thead>
|
|
434
|
-
<tbody>
|
|
435
|
-
<tr>
|
|
436
|
-
<td>(Object}</td>
|
|
437
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></td>
|
|
438
|
-
<td>
|
|
439
|
-
<ul>
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
</ul>
|
|
444
|
-
</td>
|
|
445
|
-
<td><p>bundleHost the project or lazy engine that is trying to "own"
|
|
446
|
-
the new addon instance specified by addonPkgInfo</p>
|
|
447
|
-
</td>
|
|
448
|
-
</tr>
|
|
449
|
-
|
|
450
|
-
<tr>
|
|
451
|
-
<td>addonPkgInfo</td>
|
|
452
|
-
<td><a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a></td>
|
|
453
|
-
<td>
|
|
454
|
-
<ul>
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
</ul>
|
|
459
|
-
</td>
|
|
460
|
-
<td><p>the PackageInfo of the potential new addon instance</p>
|
|
461
|
-
</td>
|
|
462
|
-
</tr>
|
|
463
|
-
|
|
464
|
-
</tbody>
|
|
465
|
-
</table>
|
|
466
|
-
</div>
|
|
467
|
-
|
|
468
|
-
<div class="return">
|
|
469
|
-
<h4>Return:</h4>
|
|
470
|
-
<div>
|
|
471
|
-
<span class="return-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
|
|
472
|
-
<span class="return-description"><p>true if the bundle host is to "own" the instance, false otherwise.</p>
|
|
473
|
-
</span>
|
|
474
|
-
</div>
|
|
475
|
-
</div>
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
</div>
|
|
479
|
-
<div class="method item">
|
|
480
|
-
<div id="method_createAddonCacheEntry" class="title">
|
|
481
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l145"><code>lib/models/per-bundle-addon-cache/index.js:145</code></a></span>
|
|
482
|
-
<h3 class="">
|
|
483
|
-
public
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
createAddonCacheEntry(addonInstance, addonRealPath): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
|
|
487
|
-
</h3>
|
|
488
|
-
</div>
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
<div class="method-description"><p>Create a cache entry object for a given (non-bundle-host) addon to put into
|
|
493
|
-
an addon cache.</p>
|
|
494
|
-
</div>
|
|
495
|
-
|
|
496
|
-
<div class="params">
|
|
497
|
-
<h4>Parameters:</h4>
|
|
498
|
-
<table>
|
|
499
|
-
<thead>
|
|
500
|
-
<tr>
|
|
501
|
-
<th>Name</th>
|
|
502
|
-
<th>Type</th>
|
|
503
|
-
<th>Attribute</th>
|
|
504
|
-
<th>Description</th>
|
|
505
|
-
</tr>
|
|
506
|
-
</thead>
|
|
507
|
-
<tbody>
|
|
508
|
-
<tr>
|
|
509
|
-
<td>addonInstance</td>
|
|
510
|
-
<td><a href="../classes/Addon.html" class="crosslink">Addon</a></td>
|
|
511
|
-
<td>
|
|
512
|
-
<ul>
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
</ul>
|
|
517
|
-
</td>
|
|
518
|
-
<td><p>the addon instance to cache</p>
|
|
519
|
-
</td>
|
|
520
|
-
</tr>
|
|
521
|
-
|
|
522
|
-
<tr>
|
|
523
|
-
<td>addonRealPath</td>
|
|
524
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
|
|
525
|
-
<td>
|
|
526
|
-
<ul>
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
</ul>
|
|
531
|
-
</td>
|
|
532
|
-
<td><p>the addon's pkgInfo.realPath</p>
|
|
533
|
-
</td>
|
|
534
|
-
</tr>
|
|
535
|
-
|
|
536
|
-
</tbody>
|
|
537
|
-
</table>
|
|
538
|
-
</div>
|
|
539
|
-
|
|
540
|
-
<div class="return">
|
|
541
|
-
<h4>Return:</h4>
|
|
542
|
-
<div>
|
|
543
|
-
<span class="return-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
|
|
544
|
-
<span class="return-description"><p>an object in the form of an addon-cache entry</p>
|
|
545
|
-
</span>
|
|
546
|
-
</div>
|
|
547
|
-
</div>
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
</div>
|
|
551
|
-
<div class="method item">
|
|
552
|
-
<div id="method_createBundleHostCacheEntry" class="title">
|
|
553
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l132"><code>lib/models/per-bundle-addon-cache/index.js:132</code></a></span>
|
|
554
|
-
<h3 class="">
|
|
555
|
-
public
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
createBundleHostCacheEntry(bundleHostPkgInfo): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
|
|
559
|
-
</h3>
|
|
560
|
-
</div>
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
<div class="method-description"><p>Creates a cache entry for the bundleHostCache. Because we want to use the same sort of proxy
|
|
565
|
-
for both bundle hosts and for 'regular' addon instances (though their cache entries have
|
|
566
|
-
slightly different structures) we'll use the Symbol from getAddonProxy.</p>
|
|
567
|
-
</div>
|
|
568
|
-
|
|
569
|
-
<div class="params">
|
|
570
|
-
<h4>Parameters:</h4>
|
|
571
|
-
<table>
|
|
572
|
-
<thead>
|
|
573
|
-
<tr>
|
|
574
|
-
<th>Name</th>
|
|
575
|
-
<th>Type</th>
|
|
576
|
-
<th>Attribute</th>
|
|
577
|
-
<th>Description</th>
|
|
578
|
-
</tr>
|
|
579
|
-
</thead>
|
|
580
|
-
<tbody>
|
|
581
|
-
<tr>
|
|
582
|
-
<td>bundleHostPkgInfo</td>
|
|
583
|
-
<td><a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a></td>
|
|
584
|
-
<td>
|
|
585
|
-
<ul>
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
</ul>
|
|
590
|
-
</td>
|
|
591
|
-
<td><p>bundle host's pkgInfo.realPath</p>
|
|
592
|
-
</td>
|
|
593
|
-
</tr>
|
|
594
|
-
|
|
595
|
-
</tbody>
|
|
596
|
-
</table>
|
|
597
|
-
</div>
|
|
598
|
-
|
|
599
|
-
<div class="return">
|
|
600
|
-
<h4>Return:</h4>
|
|
601
|
-
<div>
|
|
602
|
-
<span class="return-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
|
|
603
|
-
<span class="return-description"><p>an object in the form of a bundle-host cache entry</p>
|
|
604
|
-
</span>
|
|
605
|
-
</div>
|
|
606
|
-
</div>
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
</div>
|
|
610
|
-
<div class="method item">
|
|
611
|
-
<div id="method_findBundleHost" class="title">
|
|
612
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l158"><code>lib/models/per-bundle-addon-cache/index.js:158</code></a></span>
|
|
613
|
-
<h3 class="">
|
|
614
|
-
public
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
findBundleHost(addonParent, addonPkgInfo): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
|
|
618
|
-
</h3>
|
|
619
|
-
</div>
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
<div class="method-description"><p>Given a parent object of a potential addon (another addon or the project),
|
|
624
|
-
go up the 'parent' chain to find the potential addon's bundle host object
|
|
625
|
-
(i.e. lazy engine or project.) Because Projects are always bundle hosts,
|
|
626
|
-
this should always pass, but we'll throw if somehow it doesn't work.</p>
|
|
627
|
-
</div>
|
|
628
|
-
|
|
629
|
-
<div class="params">
|
|
630
|
-
<h4>Parameters:</h4>
|
|
631
|
-
<table>
|
|
632
|
-
<thead>
|
|
633
|
-
<tr>
|
|
634
|
-
<th>Name</th>
|
|
635
|
-
<th>Type</th>
|
|
636
|
-
<th>Attribute</th>
|
|
637
|
-
<th>Description</th>
|
|
638
|
-
</tr>
|
|
639
|
-
</thead>
|
|
640
|
-
<tbody>
|
|
641
|
-
<tr>
|
|
642
|
-
<td>addonParent</td>
|
|
643
|
-
<td><a href="../classes/Project.html" class="crosslink">Project</a> | <a href="../classes/Addon.html" class="crosslink">Addon</a></td>
|
|
644
|
-
<td>
|
|
645
|
-
<ul>
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
</ul>
|
|
650
|
-
</td>
|
|
651
|
-
<td><p>the direct parent object of a (potential or real) addon.</p>
|
|
652
|
-
</td>
|
|
653
|
-
</tr>
|
|
654
|
-
|
|
655
|
-
<tr>
|
|
656
|
-
<td>addonPkgInfo</td>
|
|
657
|
-
<td><a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a></td>
|
|
658
|
-
<td>
|
|
659
|
-
<ul>
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
</ul>
|
|
664
|
-
</td>
|
|
665
|
-
<td><p>the PackageInfo for an addon being instantiated. This is only
|
|
666
|
-
used for information if an error is going to be thrown.</p>
|
|
667
|
-
</td>
|
|
668
|
-
</tr>
|
|
669
|
-
|
|
670
|
-
</tbody>
|
|
671
|
-
</table>
|
|
672
|
-
</div>
|
|
673
|
-
|
|
674
|
-
<div class="return">
|
|
675
|
-
<h4>Return:</h4>
|
|
676
|
-
<div>
|
|
677
|
-
<span class="return-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
|
|
678
|
-
<span class="return-description"><p>the object in the 'parent' chain that is a bundle host.</p>
|
|
679
|
-
</span>
|
|
680
|
-
</div>
|
|
681
|
-
</div>
|
|
682
|
-
|
|
683
|
-
<div class="throws">
|
|
684
|
-
<h4>Throws:</h4>
|
|
685
|
-
<div>
|
|
686
|
-
<span class="throws-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error" class="crosslink external" target="_blank">Error</a></span>
|
|
687
|
-
<span class="throws-description"><p>if there is not bundle host</p>
|
|
688
|
-
</span>
|
|
689
|
-
</div>
|
|
690
|
-
</div>
|
|
691
|
-
|
|
692
|
-
</div>
|
|
693
|
-
<div class="method item">
|
|
694
|
-
<div id="method_getAddonInstance" class="title">
|
|
695
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l248"><code>lib/models/per-bundle-addon-cache/index.js:248</code></a></span>
|
|
696
|
-
<h3 class="">
|
|
697
|
-
public
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
getAddonInstance(parent, addonPkgInfo): <a href="../classes/Addon.html" class="crosslink">Addon</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy" class="crosslink external" target="_blank">Proxy</a>
|
|
701
|
-
</h3>
|
|
702
|
-
</div>
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
<div class="method-description"><p>Called from PackageInfo.getAddonInstance(), return an instance of the requested
|
|
707
|
-
addon or a Proxy, based on the type of addon and its bundle host.</p>
|
|
708
|
-
</div>
|
|
709
|
-
|
|
710
|
-
<div class="params">
|
|
711
|
-
<h4>Parameters:</h4>
|
|
712
|
-
<table>
|
|
713
|
-
<thead>
|
|
714
|
-
<tr>
|
|
715
|
-
<th>Name</th>
|
|
716
|
-
<th>Type</th>
|
|
717
|
-
<th>Attribute</th>
|
|
718
|
-
<th>Description</th>
|
|
719
|
-
</tr>
|
|
720
|
-
</thead>
|
|
721
|
-
<tbody>
|
|
722
|
-
<tr>
|
|
723
|
-
<td>parent</td>
|
|
724
|
-
<td><a href="../classes/Addon.html" class="crosslink">Addon</a> | <a href="../classes/Project.html" class="crosslink">Project</a></td>
|
|
725
|
-
<td>
|
|
726
|
-
<ul>
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
</ul>
|
|
731
|
-
</td>
|
|
732
|
-
<td><p>the parent Addon or Project this addon instance is
|
|
733
|
-
a child of.</p>
|
|
734
|
-
</td>
|
|
735
|
-
</tr>
|
|
736
|
-
|
|
737
|
-
<tr>
|
|
738
|
-
<td>addonPkgInfo</td>
|
|
739
|
-
<td></td>
|
|
740
|
-
<td>
|
|
741
|
-
<ul>
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
</ul>
|
|
746
|
-
</td>
|
|
747
|
-
<td><p>the PackageInfo for the addon being created.</p>
|
|
748
|
-
</td>
|
|
749
|
-
</tr>
|
|
750
|
-
|
|
751
|
-
</tbody>
|
|
752
|
-
</table>
|
|
753
|
-
</div>
|
|
754
|
-
|
|
755
|
-
<div class="return">
|
|
756
|
-
<h4>Return:</h4>
|
|
757
|
-
<div>
|
|
758
|
-
<span class="return-type"><a href="../classes/Addon.html" class="crosslink">Addon</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy" class="crosslink external" target="_blank">Proxy</a></span>
|
|
759
|
-
<span class="return-description"><p>An addon instance (for the first copy of the addon) or a Proxy.
|
|
760
|
-
An addon that is a lazy engine will only ever have a single copy in the cache.
|
|
761
|
-
An addon that is not will have 1 copy per bundle host (Project or lazy engine),
|
|
762
|
-
except if it is an addon that's also owned by a given LCA host and transitive
|
|
763
|
-
dedupe is enabled (<code>engineAddonTransitiveDedupeEnabled</code>), in which case it will
|
|
764
|
-
only have a single copy in the project's addon cache.</p>
|
|
765
|
-
</span>
|
|
766
|
-
</div>
|
|
767
|
-
</div>
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
</div>
|
|
771
|
-
<div class="method item">
|
|
772
|
-
<div id="method_getAddonProxy" class="title">
|
|
773
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_addon-proxy.js.html#l42"><code>lib/models/per-bundle-addon-cache/addon-proxy.js:42</code></a></span>
|
|
774
|
-
<h3 class="">
|
|
775
|
-
public
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
getAddonProxy(targetCacheEntry, parent):
|
|
779
|
-
</h3>
|
|
780
|
-
</div>
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
<div class="method-description"><p>Returns a proxy to a target with specific handling for the
|
|
785
|
-
<code>parent</code> property, as well has to handle the <code>app</code> property;
|
|
786
|
-
that is, the proxy should maintain correct local state in
|
|
787
|
-
closure scope for the <code>app</code> property if it happens to be set
|
|
788
|
-
by <code>ember-cli</code>. Other than <code>parent</code> & <code>app</code>, this function also
|
|
789
|
-
proxies <em>almost</em> everything to <code>target[TARGET_INSTANCE] with a few exceptions: we trap & return</code>[]<code>for</code>addons<code>, and we don't return the original</code>included<code>(it's already called on the "real" addon by</code>ember-cli`).</p>
|
|
790
|
-
<p>Note: the target is NOT the per-bundle cacheable instance of the addon. Rather,
|
|
791
|
-
it is a cache entry POJO from PerBundleAddonCache.</p>
|
|
792
|
-
</div>
|
|
793
|
-
|
|
794
|
-
<div class="params">
|
|
795
|
-
<h4>Parameters:</h4>
|
|
796
|
-
<table>
|
|
797
|
-
<thead>
|
|
798
|
-
<tr>
|
|
799
|
-
<th>Name</th>
|
|
800
|
-
<th>Type</th>
|
|
801
|
-
<th>Attribute</th>
|
|
802
|
-
<th>Description</th>
|
|
803
|
-
</tr>
|
|
804
|
-
</thead>
|
|
805
|
-
<tbody>
|
|
806
|
-
<tr>
|
|
807
|
-
<td>targetCacheEntry</td>
|
|
808
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></td>
|
|
809
|
-
<td>
|
|
810
|
-
<ul>
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
</ul>
|
|
815
|
-
</td>
|
|
816
|
-
<td><p>the PerBundleAddonCache cache entry we are to proxy. It
|
|
817
|
-
has one interesting property, the real addon instance the proxy is forwarding
|
|
818
|
-
calls to (that property is not globally exposed).</p>
|
|
819
|
-
</td>
|
|
820
|
-
</tr>
|
|
821
|
-
|
|
822
|
-
<tr>
|
|
823
|
-
<td>parent</td>
|
|
824
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></td>
|
|
825
|
-
<td>
|
|
826
|
-
<ul>
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
</ul>
|
|
831
|
-
</td>
|
|
832
|
-
<td><p>the parent object of the proxy being created (the same as
|
|
833
|
-
the 'parent' property of a normal addon instance)</p>
|
|
834
|
-
</td>
|
|
835
|
-
</tr>
|
|
836
|
-
|
|
837
|
-
</tbody>
|
|
838
|
-
</table>
|
|
839
|
-
</div>
|
|
840
|
-
|
|
841
|
-
<div class="return">
|
|
842
|
-
<h4>Return:</h4>
|
|
843
|
-
<div>
|
|
844
|
-
|
|
845
|
-
<span class="return-description"><p>Proxy</p>
|
|
846
|
-
</span>
|
|
847
|
-
</div>
|
|
848
|
-
</div>
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
</div>
|
|
852
|
-
<div class="method item">
|
|
853
|
-
<div id="method_resolvePerBundleAddonCacheUtil" class="title">
|
|
854
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_index.js.html#l17"><code>lib/models/per-bundle-addon-cache/index.js:17</code></a></span>
|
|
855
|
-
<h3 class="">
|
|
856
|
-
public
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
resolvePerBundleAddonCacheUtil(project): AllowCachingPerBundle: Function
|
|
860
|
-
</h3>
|
|
861
|
-
</div>
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
<div class="method-description"><p>Resolves the perBundleAddonCacheUtil; this prefers the custom provided version by
|
|
866
|
-
the consuming application, and defaults to an internal implementation here.</p>
|
|
867
|
-
</div>
|
|
868
|
-
|
|
869
|
-
<div class="params">
|
|
870
|
-
<h4>Parameters:</h4>
|
|
871
|
-
<table>
|
|
872
|
-
<thead>
|
|
873
|
-
<tr>
|
|
874
|
-
<th>Name</th>
|
|
875
|
-
<th>Type</th>
|
|
876
|
-
<th>Attribute</th>
|
|
877
|
-
<th>Description</th>
|
|
878
|
-
</tr>
|
|
879
|
-
</thead>
|
|
880
|
-
<tbody>
|
|
881
|
-
<tr>
|
|
882
|
-
<td>project</td>
|
|
883
|
-
<td><a href="../classes/Project.html" class="crosslink">Project</a></td>
|
|
884
|
-
<td>
|
|
885
|
-
<ul>
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
</ul>
|
|
890
|
-
</td>
|
|
891
|
-
<td> </td>
|
|
892
|
-
</tr>
|
|
893
|
-
|
|
894
|
-
</tbody>
|
|
895
|
-
</table>
|
|
896
|
-
</div>
|
|
897
|
-
|
|
898
|
-
<div class="return">
|
|
899
|
-
<h4>Return:</h4>
|
|
900
|
-
<div>
|
|
901
|
-
<span class="return-type">AllowCachingPerBundle: Function</span>
|
|
902
|
-
<span class="return-description"><p>}</p>
|
|
903
|
-
</span>
|
|
904
|
-
</div>
|
|
905
|
-
</div>
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
</div>
|
|
909
|
-
<div class="method item">
|
|
910
|
-
<div id="method_validateCacheKey" class="title">
|
|
911
|
-
<span class="source-link"><a href="../files/lib_models_per-bundle-addon-cache_addon-proxy.js.html#l7"><code>lib/models/per-bundle-addon-cache/addon-proxy.js:7</code></a></span>
|
|
912
|
-
<h3 class="">
|
|
913
|
-
public
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
validateCacheKey(realAddonInstance, treeType, newCacheKey)
|
|
917
|
-
</h3>
|
|
918
|
-
</div>
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
<div class="method-description"><p>Validates that a new cache key for a given tree type matches the previous
|
|
923
|
-
cache key for the same tree type. To opt-in to bundle addon caching for
|
|
924
|
-
a given addon it's assumed that it returns stable cache keys; specifically
|
|
925
|
-
this is because the interplay between bundle addon caching and <code>ember-engines</code>
|
|
926
|
-
when transitive deduplication is enabled assumes stable cache keys, so we validate
|
|
927
|
-
for this case here.</p>
|
|
928
|
-
</div>
|
|
929
|
-
|
|
930
|
-
<div class="params">
|
|
931
|
-
<h4>Parameters:</h4>
|
|
932
|
-
<table>
|
|
933
|
-
<thead>
|
|
934
|
-
<tr>
|
|
935
|
-
<th>Name</th>
|
|
936
|
-
<th>Type</th>
|
|
937
|
-
<th>Attribute</th>
|
|
938
|
-
<th>Description</th>
|
|
939
|
-
</tr>
|
|
940
|
-
</thead>
|
|
941
|
-
<tbody>
|
|
942
|
-
<tr>
|
|
943
|
-
<td>realAddonInstance</td>
|
|
944
|
-
<td><a href="../classes/Addon.html" class="crosslink">Addon</a></td>
|
|
945
|
-
<td>
|
|
946
|
-
<ul>
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
</ul>
|
|
951
|
-
</td>
|
|
952
|
-
<td><p>The real addon instance</p>
|
|
953
|
-
</td>
|
|
954
|
-
</tr>
|
|
955
|
-
|
|
956
|
-
<tr>
|
|
957
|
-
<td>treeType</td>
|
|
958
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
|
|
959
|
-
<td>
|
|
960
|
-
<ul>
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
</ul>
|
|
965
|
-
</td>
|
|
966
|
-
<td> </td>
|
|
967
|
-
</tr>
|
|
968
|
-
|
|
969
|
-
<tr>
|
|
970
|
-
<td>newCacheKey</td>
|
|
971
|
-
<td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
|
|
972
|
-
<td>
|
|
973
|
-
<ul>
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
</ul>
|
|
978
|
-
</td>
|
|
979
|
-
<td> </td>
|
|
980
|
-
</tr>
|
|
981
|
-
|
|
982
|
-
</tbody>
|
|
983
|
-
</table>
|
|
984
|
-
</div>
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
<div class="throws">
|
|
988
|
-
<h4>Throws:</h4>
|
|
989
|
-
<div>
|
|
990
|
-
<span class="throws-type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error" class="crosslink external" target="_blank">Error</a></span>
|
|
991
|
-
<span class="throws-description"><p>If the new cache key doesn't match the previous cache key</p>
|
|
992
|
-
</span>
|
|
993
|
-
</div>
|
|
994
|
-
</div>
|
|
995
|
-
|
|
996
|
-
</div>
|
|
997
|
-
</div>
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
</div>
|
|
1003
|
-
</div>
|
|
1004
|
-
</div>
|
|
1005
|
-
</div>
|
|
1006
|
-
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
|
1007
|
-
<script>prettyPrint();</script>
|
|
1008
|
-
<script src="../assets/js/yui-prettify.js"></script>
|
|
1009
|
-
</body>
|
|
1010
|
-
</html>
|