Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: emberjs/ember.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 77ef48ebdb793e5c4cd7d462fb280382247d6116
Choose a base ref
..
head repository: emberjs/ember.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b88ce4b468e3d650ca2c5d07cc7f6fc12ed2955f
Choose a head ref
18 changes: 5 additions & 13 deletions packages/@ember/-internals/glimmer/lib/templates/input.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { precompileTemplate } from '@ember/template-compilation';
import { on } from '@ember/modifier';
export default precompileTemplate(
`<input
import { hbs } from '@lifeart/gxt';
export default function InputTemplate() {
hbs`<input
{{!-- for compatibility --}}
id={{this.id}}
class={{this.class}}
@@ -17,12 +16,5 @@ export default precompileTemplate(
{{on "keyup" this.keyUp}}
{{on "paste" this.valueDidChange}}
{{on "cut" this.valueDidChange}}
/>`,
{
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/input.hbs',
strictMode: true,
scope() {
return { on };
},
}
);
/>`;
}
41 changes: 16 additions & 25 deletions packages/@ember/-internals/glimmer/lib/templates/link-to.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import { precompileTemplate } from '@ember/template-compilation';
import { on } from '@ember/modifier';
import { hbs } from '@lifeart/gxt';

export default precompileTemplate(
`<a
{{!-- for compatibility --}}
id={{this.id}}
class={{this.class}}
export default function LinkToTemplate() {
return hbs`<a
{{!-- for compatibility --}}
id={{this.id}}
class={{this.class}}
{{!-- deprecated attribute bindings --}}
role={{this.role}}
title={{this.title}}
rel={{this.rel}}
tabindex={{this.tabindex}}
target={{this.target}}
{{!-- deprecated attribute bindings --}}
role={{this.role}}
title={{this.title}}
rel={{this.rel}}
tabindex={{this.tabindex}}
target={{this.target}}
...attributes
...attributes
href={{this.href}}
href={{this.href}}
{{on 'click' this.click}}
>{{yield}}</a>`,
{
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/link-to.hbs',
strictMode: true,
scope() {
return { on };
},
}
);
{{on 'click' this.click}} >{{yield}}</a>`;
}
18 changes: 5 additions & 13 deletions packages/@ember/-internals/glimmer/lib/templates/textarea.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { precompileTemplate } from '@ember/template-compilation';
import { on } from '@ember/modifier';
import { hbs } from '@lifeart/gxt';

export default precompileTemplate(
`<textarea
export default function TextareaTemplate() {
return hbs`<textarea
{{!-- for compatibility --}}
id={{this.id}}
class={{this.class}}
@@ -16,12 +15,5 @@ export default precompileTemplate(
{{on "keyup" this.keyUp}}
{{on "paste" this.valueDidChange}}
{{on "cut" this.valueDidChange}}
/>`,
{
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/textarea.hbs',
strictMode: true,
scope() {
return { on };
},
}
);
/>`;
}
12 changes: 6 additions & 6 deletions packages/@ember/routing/route.ts
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ import type { AnyFn } from '@ember/-internals/utility-types';
import Controller from '@ember/controller';
import type { ControllerQueryParamType } from '@ember/controller';
import { assert, info, isTesting } from '@ember/debug';
// import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations';
import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations';
import EngineInstance from '@ember/engine/instance';
import { dependentKeyCompat } from '@ember/object/compat';
import { once } from '@ember/runloop';
@@ -1256,11 +1256,11 @@ class Route<Model = unknown> extends EmberObject.extend(ActionHandler, Evented)
if (ENV._NO_IMPLICIT_ROUTE_MODEL) {
return;
}
// deprecateUntil(
// `The implicit model loading behavior for routes is deprecated. ` +
// `Please define an explicit model hook for ${this.fullRouteName}.`,
// DEPRECATIONS.DEPRECATE_IMPLICIT_ROUTE_MODEL
// );
deprecateUntil(
`The implicit model loading behavior for routes is deprecated. ` +
`Please define an explicit model hook for ${this.fullRouteName}.`,
DEPRECATIONS.DEPRECATE_IMPLICIT_ROUTE_MODEL
);

const store = 'store' in this ? this.store : get(this, '_store');
assert('Expected route to have a store with a find method', isStoreLike(store));
6 changes: 5 additions & 1 deletion packages/demo/compat/deprecate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export function deprecateUntil() {

}
export const DEPRECATIONS = {};
export const DEPRECATIONS = {
DEPRECATE_IMPORT_EMBER() {
//
},
};
6 changes: 0 additions & 6 deletions packages/demo/src/config/breakpoints.ts

This file was deleted.

11 changes: 2 additions & 9 deletions packages/demo/src/config/initializer.ts
Original file line number Diff line number Diff line change
@@ -2,21 +2,15 @@ import ENV from './env';
import registry from './registry';
import type ApplicationClass from '@ember/application';
import type RouteClass from './router';
import { default as initializer } from '../initializers/logger';
import { default as logger } from '../instance-initializers/logger';
// import { default as modalDialog } from '../instance-initializers/ember-modal-dialog';
// import { default as emberDataInitializer } from '../initializers/ember-data';
// import { default as emberResponsive } from '../initializers/ember-responsive';
import breakpoints from './breakpoints';
import { default as initializer } from '@/initializers/logger';
import { default as logger } from '@/instance-initializers/logger';

export function init(
Application: typeof ApplicationClass,
Router: typeof RouteClass
) {
// Init initializers
Application.initializer(initializer);
// Application.initializer(emberDataInitializer);
// Application.initializer(emberResponsive);

// Init instance initializers
Application.instanceInitializer(logger);
@@ -37,7 +31,6 @@ export function init(

app.register('config:environment', ENV);
app.register('router:main', Router);
app.register('breakpoints:main', breakpoints);

return app;
}
132 changes: 19 additions & 113 deletions packages/demo/src/config/registry.ts
Original file line number Diff line number Diff line change
@@ -1,130 +1,36 @@
import type { IRegistry } from './utils';
// import { DEBUG } from '@glimmer/env';
/* imported routes */
import { ApplicationRoute } from '../routes/application';
import ApplicationTemplate from './../components/Application';
import ProfileTemplate from './../components/Profile';
import MainTemplate from './../components/Main';
// import LoginRoute from '../routes/login';
// import LogoutRoute from '../routes/logout';
// import { MainRoute } from '../routes/main';
import ProfileRoute from '../routes/profile';

/* imported authenticators */
// import CustomAuthenticator from '../authenticators/custom';
import { ApplicationRoute } from '@/routes/application';
import ApplicationTemplate from '@/components/Application';
import ProfileTemplate from '@/components/Profile';
import MainTemplate from '@/components/Main';

import ProfileRoute from '@/routes/profile';


/* imported controllers */
import { ApplicationController } from '@/controllers/application';
import { ProfileController } from '@/controllers/profile';
// import { LoginController } from '@/controllers/login';

/* imported templates */
// import ApplicationTemplate from '@/templates/application.hbs';
// import AboutTemplate from '@/templates/about.hbs';
// import LoginTemplate from '@/templates/login.hbs';

/* imported services */
// import DateService from '@/services/date';

/* imported components */
// import HelloWorld from '@/components/HelloWorld';
// import Button from '@/components/Button';
// import Header from '@/components/Header';
// import Footer from '@/components/Footer';
// import Hot from '@/components/Hot';
/* imported helpers */
// import MemoryUsage from '@/helpers/memory-usage';
// import IsDev from '@/helpers/is-dev';

/* imported modifiers */
// import ClickTracker from '@/modifiers/click-tracker';

// ember-data debug adapter
// import StoreService from '@/services/store';
/* ember-data stuff */
// import Pet from '@/models/pet';
// import Person from '@/models/person';
function asTemplate(ComponentKlass: any) {
return (_owner: any) => {
// template lookup
return () => {
// template init
return ComponentKlass;
};
};
}

const InitialRegistry = {
// 'service:store': StoreService,
// 'model:pet': Pet,
// 'model:person': Person,
// debug ember-data adapter
// 'authenticator:custom': CustomAuthenticator,
// 'service:date': DateService,
'controller:application': ApplicationController,
'controller:profile': ProfileController,
// 'controller:login': LoginController,
'route:application': ApplicationRoute,
'route:profile': ProfileRoute,
'template:main': asTemplate(MainTemplate),
'template:application': asTemplate(ApplicationTemplate),
'template:profile': asTemplate(ProfileTemplate),

// 'route:login': LoginRoute,
// 'route:logout': LogoutRoute,
'template:main': (owner) => {
console.log('template: main', owner);
return function() {
console.log('template: main - init', ...arguments);

// debugger;
return MainTemplate;
}
},
'template:application': (owner) => {
console.log('template: application', owner);
return function() {
console.log('template: application - init', ...arguments);

// debugger;
return ApplicationTemplate;
}
},
'template:profile': (owner) => {
return function() {
return ProfileTemplate;
}
},
// 'template:about': AboutTemplate,
// 'template:login': LoginTemplate,

// 'component:hello-world': HelloWorld,
// 'component:button': Button,
// 'component:header': Header,
// 'component:footer': Footer,

// 'component:hot': DEBUG ? Hot : null,

// 'helper:memory-usage': MemoryUsage as unknown as () => string, // glint fix
// 'helper:is-dev': IsDev,

// 'modifier:click-tracker': ClickTracker,

/* embroider compatibility */

'helper:ensure-safe-component': function (a: string) {
return a;
},
'helper:macroCondition': function (a: string) {
// ember-bootstrap compat
if (typeof a === 'boolean') {
return a;
}
console.log('macroCondition', a);
return a;
},
'helper:macroGetOwnConfig': function (a: string) {
// ember-bootstrap compat
if (a === 'isNotBS5') {
return false;
}
if (a === 'isBS5') {
return true;
}
if (a === 'isBS4') {
return false;
}
console.log('macroGetOwnConfig', a);
return a;
},
};

function registry(): IRegistry {
8 changes: 0 additions & 8 deletions packages/demo/src/templates/main.ts

This file was deleted.

20 changes: 20 additions & 0 deletions packages/demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// "extends": "./../tsconfig.json",
"compilerOptions": {
"paths": {
"@/config/*": ["./src/config/*"],
"@/addons/*": ["./src/addons/*"],
"@/addons": ["./src/addons"],
"@/components/*": ["./src/components/*"],
"@/controllers/*": ["./src/controllers/*"],
"@/templates/*": ["./src/templates/*"],
"@/helpers/*": ["./src/helpers/*"],
"@/modifiers/*": ["./src/modifiers/*"],
"@/models/*": ["./src/models/*"],
"@/services/*": ["./src/services/*"],
"@/tests/*": ["./tests/*"],
"@/initializers/*": ["./src/initializers/*"],
"@/instance-initializers/*": ["./src/instance-initializers/*"],
}
}
}
18 changes: 9 additions & 9 deletions packages/ember/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations';
import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations';
import doNotUseThis from './barrel';

export default new Proxy(doNotUseThis, {
get(target, key, receiver) {
// We don't have symbol exports, so this is probably fine.
if (typeof key === 'string') {
// deprecateUntil(
// `importing ${key} from the 'ember' barrel file is deprecated.`,
// DEPRECATIONS.DEPRECATE_IMPORT_EMBER(key)
// );
deprecateUntil(
`importing ${key} from the 'ember' barrel file is deprecated.`,
DEPRECATIONS.DEPRECATE_IMPORT_EMBER(key)
);
}

return Reflect.get(target, key, receiver);
},
getOwnPropertyDescriptor(target, key) {
if (typeof key === 'string') {
// deprecateUntil(
// `importing ${key} from the 'ember' barrel file is deprecated.`,
// DEPRECATIONS.DEPRECATE_IMPORT_EMBER(key)
// );
deprecateUntil(
`importing ${key} from the 'ember' barrel file is deprecated.`,
DEPRECATIONS.DEPRECATE_IMPORT_EMBER(key)
);
}

return Object.getOwnPropertyDescriptor(target, key);