ember-fastboot / fastboot

FastBoot is a library for rendering Ember.js applications in Node.js.
http://ember-fastboot.com/
158 stars 69 forks source link

Remove najax from default set of sandbox globals. #247

Closed rwjblue closed 5 years ago

rwjblue commented 5 years ago

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):

const najax = require('najax');

let fastboot = new FastBoot({
  distPath: 'some/path/to/dist',
  buildSandboxGlobals(globals) {
    return Object.assign({}, globals, {
      najax,
    });
  }
});

See #246 for more details about this change.

Closes #246

runspired commented 3 years ago

fwiw you need najax even in current versions of ember-data if you don't have ember-fetch installed. This change trolled our fastboot tests in ember-data itself because when we test the jquery scenario we add @ember/jquery and remove ember-fetch, once we bump to fastboot 3 this fails (see https://github.com/embermap/ember-cli-fastboot-testing/issues/471 and https://github.com/ember-fastboot/ember-cli-fastboot/issues/829).

It's not clear how to add najax back in from this example for ember-cli-fastboot-testing.