Commit bab91cf
Robert Jackson
Remove najax from default set of sandbox globals.
* Recent versions of ember-data (3.12+) will automatically use
`ember-fetch` (or global `fetch`) if present, and does not need
special logic around `najax`
* New applications (as of [email protected]) include `ember-fetch` by
default, and do **not** include jQuery by default. Considering that
`najax` is a `jQuery.ajax` emulation API, I think this library should
avoid exposing it.
* `najax` (as a dependency of this library) is difficult for the host
application to control (e.g. get their own version), and would be
better if they provided it themselves (via `buildSandboxGlobals` API)
* Providing backwards compatibility is **very** easy (add `najax:
require('najax')` via `buildSandboxGlobals`)
* It seems better to "follow a spec" (suggesting `fetch` usage)
For applications that still need `najax` (for example, if they are using
an older ember-data version), they can do (example uses new
`buildSandboxGlobals` API):
```js
const najax = require('najax');
let fastboot = new FastBoot({
distPath: 'some/path/to/dist',
buildSandboxGlobals(globals) {
return Object.assign({}, globals, {
najax,
});
}
});
```1 parent ed9b9d1 commit bab91cf
5 files changed
Lines changed: 0 additions & 32 deletions
File tree
- src
- test
- fixtures/custom-sandbox/assets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
| |||
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | | - | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
| |||
264 | 262 | | |
265 | 263 | | |
266 | 264 | | |
267 | | - | |
268 | 265 | | |
269 | 266 | | |
270 | 267 | | |
| |||
279 | 276 | | |
280 | 277 | | |
281 | 278 | | |
282 | | - | |
283 | 279 | | |
284 | 280 | | |
285 | 281 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1971 | 1971 | | |
1972 | 1972 | | |
1973 | 1973 | | |
1974 | | - | |
1975 | | - | |
1976 | | - | |
1977 | | - | |
1978 | | - | |
1979 | 1974 | | |
1980 | 1975 | | |
1981 | 1976 | | |
| |||
2095 | 2090 | | |
2096 | 2091 | | |
2097 | 2092 | | |
2098 | | - | |
2099 | | - | |
2100 | | - | |
2101 | | - | |
2102 | | - | |
2103 | 2093 | | |
2104 | 2094 | | |
2105 | 2095 | | |
| |||
2391 | 2381 | | |
2392 | 2382 | | |
2393 | 2383 | | |
2394 | | - | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
2401 | | - | |
2402 | | - | |
2403 | 2384 | | |
2404 | 2385 | | |
2405 | 2386 | | |
| |||
2878 | 2859 | | |
2879 | 2860 | | |
2880 | 2861 | | |
2881 | | - | |
2882 | | - | |
2883 | | - | |
2884 | | - | |
2885 | | - | |
2886 | 2862 | | |
2887 | 2863 | | |
2888 | 2864 | | |
| |||
0 commit comments