Skip to content

Commit

Permalink
somehow mostly working
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Mar 16, 2023
1 parent 0c3508e commit 754afa3
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/-ember-data/addon/setup-container.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type Application from '@ember/application';

import Store from '@ember-data/store';
import Store from 'ember-data/store';

function initializeStore(application: Application) {
application.registerOptionsForType('serializer', { singleton: false });
Expand Down
1 change: 1 addition & 0 deletions packages/adapter/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
external: [
'@embroider/macros',
'@ember/service',
'@ember-data/store/-private',
'require',
'rsvp',
'ember-inflector',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function addonBuildConfigForDataPackage(PackageName) {
'@ember-data/store',
'@ember-data/adapter',
'@ember-data/serializer',
'@ember-data/request',
'@ember-data/model',
'@ember-data/json-api',
'@ember-data/debug',
Expand Down
1 change: 0 additions & 1 deletion packages/request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@ember-data/request",
"description": "⚡️ A simple, small and fast framework-agnostic library to make `fetch` happen",
"version": "4.12.0-alpha.8",
"private": true,
"license": "MIT",
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/request/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
plugins: [
// These are the modules that users should be able to import from your
// addon. Anything not listed here may get optimized away.
addon.publicEntrypoints(['index.js', '-private.js']),
addon.publicEntrypoints(['index.js', 'fetch.js']),

nodeResolve({ extensions: ['.ts'] }),
babel({
Expand Down
4 changes: 4 additions & 0 deletions packages/request/src/-private/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import type { ImmutableHeaders, RequestInfo } from './types';
const ValidKeys = new Map<string, string | string[]>([
['data', 'json'],
['options', 'object'],
['cacheOptions', 'object'],
['op', ['findAll', 'query', 'queryRecord']],
['store', 'object'],
['url', 'string'],
['cache', ['default', 'force-cache', 'no-cache', 'no-store', 'only-if-cached', 'reload']],
['credentials', ['include', 'omit', 'same-origin']],
Expand Down Expand Up @@ -107,6 +110,7 @@ export function deepFreeze<T = unknown>(value: T): T {
return Object.freeze(value);
case 'headers':
return freezeHeaders(value as Headers) as T;
case 'Store':
case 'AbortSignal':
return value;
case 'date':
Expand Down
2 changes: 1 addition & 1 deletion packages/request/src/-private/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function executeNextHandler<T>(
try {
outcome = wares[i].request<T>(context, next);
if (macroCondition(isDevelopingApp())) {
if (!(outcome instanceof Promise)) {
if (!(outcome instanceof Promise) && !('then' in outcome)) {
// eslint-disable-next-line no-console
console.log({ request, handler: wares[i], outcome });
if (outcome === undefined) {
Expand Down
2 changes: 2 additions & 0 deletions packages/store/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export default {

'@ember-data/tracking/-private',
'@ember-data/private-build-infra/deprecations',
'@ember/-internals/metal',
'@glimmer/validator',

// to eliminate
'@ember/object/compat',
Expand Down
6 changes: 3 additions & 3 deletions packages/store/src/-private/store-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ class Store {
data: {
type: normalizeModelName(modelName),
query,
options,
options: options || {},
},
});

Expand Down Expand Up @@ -1659,7 +1659,7 @@ class Store {
data: {
type: normalizeModelName(modelName),
query,
options,
options: options || {},
},
});

Expand Down Expand Up @@ -1874,7 +1874,7 @@ class Store {
op: 'findAll',
data: {
type: normalizeModelName(modelName),
options,
options: options || {},
},
});

Expand Down
4 changes: 0 additions & 4 deletions tests/main/tests/acceptance/tracking-create-record-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';

import Model, { attr } from '@ember-data/model';
import Store from '@ember-data/store';
import { memoTransact, transact, untracked } from '@ember-data/tracking';

module('acceptance/tracking-transactions', function (hooks) {
Expand Down Expand Up @@ -48,7 +47,6 @@ module('acceptance/tracking-transactions', function (hooks) {
</ul>
`;

owner.register('service:store', Store);
owner.register('model:widget', Widget);
owner.register('component:widget-creator', WidgetCreator);
owner.register('template:components/widget-creator', layout);
Expand Down Expand Up @@ -105,7 +103,6 @@ module('acceptance/tracking-transactions', function (hooks) {
</ul>
`;

owner.register('service:store', Store);
owner.register('model:widget', Widget);
owner.register('component:widget-creator', WidgetCreator);
owner.register('template:components/widget-creator', layout);
Expand Down Expand Up @@ -185,7 +182,6 @@ module('acceptance/tracking-transactions', function (hooks) {
</ul>
`;

owner.register('service:store', Store);
owner.register('model:widget', Widget);
owner.register('component:widget-creator', WidgetCreator);
owner.register('template:components/widget-creator', layout);
Expand Down

0 comments on commit 754afa3

Please sign in to comment.