Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to get ember 3.25 working #83

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added compat/ember-array/index.ts
Empty file.
6 changes: 6 additions & 0 deletions compat/ember-owner/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function getOwner(context) {
console.log('getOwner', context);
}
export function setOwner(context, owner) {
console.log('setOwner', context, owner);
}
Empty file added compat/ember-routing/route.ts
Empty file.
Empty file added compat/ember-routing/router.ts
Empty file.
Empty file.
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions compat/ember-template/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function isHTMLSafe() {
return true;
}
3 changes: 3 additions & 0 deletions compat/ember-test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function registerWaiter() {
console.log('registerWaiter');
}
Empty file added compat/ember-utils/index.ts
Empty file.
18 changes: 9 additions & 9 deletions compat/embroider-macros/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as renderer from '@ember/renderer';
// import * as renderer from '@ember/renderer';
import * as validator from '@glimmer/validator';
import * as manager from '@glimmer/manager';
import { DEBUG } from '@glimmer/env';
import * as recordData from '@ember-data/json-api';
import * as model from '@ember-data/model/-private';
import * as graph from '@ember-data/graph/-private';
import { getDataConfig } from './../ember-data-private-build-infra';
// import * as recordData from '@ember-data/json-api';
// import * as model from '@ember-data/model/-private';
// import * as graph from '@ember-data/graph/-private';
// import { getDataConfig } from './../ember-data-private-build-infra';
import * as owner from '@ember/owner';

export function isDevelopingApp() {
Expand Down Expand Up @@ -62,7 +62,7 @@ export function macroCondition(value: boolean) {

export function importSync(name: string) {
if (name === '@ember/renderer') {
return renderer;
return {};
}
if (name === '@glimmer/validator') {
return validator;
Expand All @@ -71,13 +71,13 @@ export function importSync(name: string) {
return manager;
}
if (name === '@ember-data/json-api') {
return recordData;
// return recordData;
}
if (name === '@ember-data/model/-private') {
return model;
// return model;
}
if (name === '@ember-data/graph/-private') {
return graph;
// return graph;
}
if (name === '@ember/owner') {
return owner;
Expand Down
5 changes: 5 additions & 0 deletions compat/emner-template-compilation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function precompileTemplate() {
return null;
}

export type PrecompiledTemplate = unknown;
Empty file added compat/glimmer-manager/index.ts
Empty file.
5 changes: 5 additions & 0 deletions compat/glimmer-tracking/primitives/cache.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function createCache() {

}
export function getValue() {
}
2 changes: 2 additions & 0 deletions compat/node-module/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const IS_NODE = false;
export const module = globalThis;
28 changes: 10 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,16 @@
"@ember-data/json-api": "5.1.1",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^2.9.3",
"@glimmer/compiler": "0.84.3",
"@glimmer/component": "^1.1.2",
"@glimmer/destroyable": "0.84.3",
"@glimmer/compiler": "0.65.4",
"@glimmer/env": "^0.1.7",
"@glimmer/global-context": "0.84.3",
"@glimmer/interfaces": "0.84.3",
"@glimmer/manager": "0.84.3",
"@glimmer/node": "0.84.3",
"@glimmer/opcode-compiler": "0.84.3",
"@glimmer/owner": "0.84.3",
"@glimmer/program": "0.84.3",
"@glimmer/reference": "0.84.3",
"@glimmer/runtime": "0.84.3",
"@glimmer/syntax": "0.84.3",
"@glimmer/util": "0.84.3",
"@glimmer/validator": "0.84.3",
"@glimmer/vm-babel-plugins": "0.84.3",
"@glimmer/tracking": "^1.1.2",
"@glimmer/global-context": "0.65.4",
"@glimmer/interfaces": "0.65.4",
"@glimmer/node": "0.65.4",
"@glimmer/opcode-compiler": "0.65.4",
"@glimmer/program": "0.65.4",
"@glimmer/reference": "0.65.4",
"@glimmer/runtime": "0.65.4",
"@glimmer/validator": "0.65.4",
"@glint/environment-ember-template-imports": "^0.9.7",
"@types/ember": "^4.0.3",
"@types/jest": "^29.5.0",
Expand All @@ -104,7 +96,7 @@
"ember-resources": "^6.3.1",
"ember-responsive": "^5.0.0",
"ember-simple-auth": "6.0.0-rc.1",
"ember-source": "5.4.0",
"ember-source": "3.24.6",
"ember-truth-helpers": "^3.1.1",
"jest": "^29.5.0",
"nyc": "^15.1.0",
Expand Down
6 changes: 3 additions & 3 deletions plugins/ember-vendor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export function internalPackages(mode: string) {
'@ember/test-helpers/addon-test-support/@ember/test-helpers'
),

Addon('@ember/test-waiters', mode).addSelfAlias(
'@ember/test-waiters/addon/@ember/test-waiters'
),
// Addon('@ember/test-waiters', mode).addSelfAlias(
// '@ember/test-waiters/addon/@ember/test-waiters'
// ),

Addon('ember-compatibility-helpers', mode).addSelfAlias(
compatPath('ember-compatibility-helpers/index.ts')
Expand Down
26 changes: 13 additions & 13 deletions src/addons/ember-truth-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import and from 'ember-truth-helpers/addon/helpers/and.js';
import eq from 'ember-truth-helpers/addon/helpers/equal.js';
import or from 'ember-truth-helpers/addon/helpers/or.js';
import not from 'ember-truth-helpers/addon/helpers/not.js';
import notEq from 'ember-truth-helpers/addon/helpers/not-equal.js';
// import and from 'ember-truth-helpers/addon/helpers/and.js';
// import eq from 'ember-truth-helpers/addon/helpers/equal.js';
// import or from 'ember-truth-helpers/addon/helpers/or.js';
// import not from 'ember-truth-helpers/addon/helpers/not.js';
// import notEq from 'ember-truth-helpers/addon/helpers/not-equal.js';

const registry = {
'helper:and': and,
'helper:eq': eq,
'helper:or': or,
'helper:not': not,
'helper:not-eq': notEq,
};
// const registry = {
// 'helper:and': and,
// 'helper:eq': eq,
// 'helper:or': or,
// 'helper:not': not,
// 'helper:not-eq': notEq,
// };

export default registry;
// export default registry;
8 changes: 4 additions & 4 deletions src/addons/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EmberSimpleAuthRegistry from './ember-simple-auth';
// import EmberSimpleAuthRegistry from './ember-simple-auth';
import EmberTruthHelpers from './ember-truth-helpers';
import EmberPowerSelect from './ember-power-select';
import EmberBasicDropdown from './ember-basic-dropdown';
Expand All @@ -8,7 +8,7 @@ import EmberRenderModifiers from './ember-render-modifiers';
import EmberStyleModifier from './ember-style-modifier';
import EmberIntl from './ember-intl';
import EmberPageTitle from './ember-page-title';
import EmberData from './ember-data';
// import EmberData from './ember-data';
import EmberNotify from './ember-notify';
import EmberModalDialog from './ember-modal-dialog';
import EmberResponsive from './ember-responsive';
Expand All @@ -25,11 +25,11 @@ const registry = {
...EmberPowerSelect,
...EmberIntl,
...EmberPageTitle,
...EmberData,
// ...EmberData,
...EmberNotify,
...EmberModalDialog,
...EmberResponsive,
...EmberEventHelpers,
};

export default registry;
export default {};
5 changes: 4 additions & 1 deletion src/authenticators/custom.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import Base from 'ember-simple-auth/authenticators/base';
// import Base from 'ember-simple-auth/authenticators/base';

interface IUserData {
id: string;
name: string;
}

class Base {

}
export default class CustomAuthenticator extends Base {
restore(data: IUserData): Promise<IUserData> {
return Promise.resolve(data);
Expand Down
54 changes: 27 additions & 27 deletions src/components/HelloWorld/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export default class HelloWorld extends Component {
`

<FeaturePanel>
<:title><code>t</code> helper test:</:title>
<:description>
<title><code>t</code> helper test:</title>
<description>
<div class="mt-2" data-test-welcome-msg>
{{t 'hello.world'}}
</div>
Expand All @@ -37,62 +37,62 @@ export default class HelloWorld extends Component {
<Button data-test-lang="fr-fr" {{on "click" (fn this.setLanguage "fr-fr")}}>fr-fr</Button>
<Button data-test-lang="ru-ru" {{on "click" (fn this.setLanguage "ru-ru")}}>ru-ru</Button>
</div>
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>Reactivity test:</:title>
<:description>
<title>Reactivity test:</title>
<description>
<pre class="font-mono">{{format-date this.dateService._date}} {{this.dateService.date}}</pre>
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title><code>eq</code>, <code>and</code> helpers test:</:title>
<:description>
<title><code>eq</code>, <code>and</code> helpers test:</title>
<description>
{{if (eq "a" "a") "equal" "not equal"}}
{{if (and (eq "a" "a") (eq "b" "b")) "equal" "not equal"}}
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>Template only component test:</:title>
<:description>
<title>Template only component test:</title>
<description>
<TemplateOnlyComponent />
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>Local imported component:</:title>
<:description>
<title>Local imported component:</title>
<description>
<Local />
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>Summary calculation helper test:</:title>
<:description>
<title>Summary calculation helper test:</title>
<description>
{{calculateSummary 3 2}}
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>Ember Power Select test:</:title>
<:description>
<title>Ember Power Select test:</title>
<description>
<Select />
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>.gts component test:</:title>
<:description>
<title>.gts component test:</title>
<description>
<Sample />
</:description>
</description>
</FeaturePanel>

<FeaturePanel>
<:title>ember-resources</:title>
<:description>
<title>ember-resources</title>
<description>
<h4 class="text-md mt-2 font-medium leading-5">Cell</h4>
<Cell />

Expand All @@ -104,7 +104,7 @@ export default class HelloWorld extends Component {

<h4 class="text-md mt-2 font-medium leading-5">RemoteData</h4>
<RemoteData />
</:description>
</description>
</FeaturePanel>

`,
Expand Down
4 changes: 2 additions & 2 deletions src/config/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 emberDataInitializer } from '../initializers/ember-data';
import { default as emberResponsive } from '../initializers/ember-responsive';
import breakpoints from './breakpoints';

Expand All @@ -15,7 +15,7 @@ export function init(
) {
// Init initializers
Application.initializer(initializer);
Application.initializer(emberDataInitializer);
// Application.initializer(emberDataInitializer);
Application.initializer(emberResponsive);

// Init instance initializers
Expand Down
26 changes: 13 additions & 13 deletions src/config/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ import IsDev from '@/helpers/is-dev';
import ClickTracker from '@/modifiers/click-tracker';

// ember-data debug adapter
import DataDebugAdapter from '@ember-data/debug';
import StoreService from '@/services/store';
// import DataDebugAdapter from '@ember-data/debug';
// import StoreService from '@/services/store';
/* ember-data stuff */
import Pet from '@/models/pet';
import Person from '@/models/person';
// import Pet from '@/models/pet';
// import Person from '@/models/person';

const InitialRegistry = {
'service:store': StoreService,
'model:pet': Pet,
'model:person': Person,
// 'service:store': StoreService,
// 'model:pet': Pet,
// 'model:person': Person,
// debug ember-data adapter
'data-adapter:main': DataDebugAdapter,
// 'data-adapter:main': DataDebugAdapter,

'authenticator:custom': CustomAuthenticator,
'service:date': DateService,
Expand All @@ -61,12 +61,12 @@ const InitialRegistry = {
'template:about': AboutTemplate,
'template:login': LoginTemplate,

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

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

'helper:memory-usage': MemoryUsage as unknown as () => string, // glint fix
'helper:is-dev': IsDev,
Expand Down
2 changes: 1 addition & 1 deletion src/config/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import EmberRouter from '@ember/routing/router';
import config from './env';
import type Controller from '@ember/controller';
import Route from '@ember/routing/route';
import { PrecompiledTemplate } from '@ember/template-compilation';
import type { PrecompiledTemplate } from '@ember/template-compilation';
import { getOwner } from '@ember/application';

/*
Expand Down
Loading
Loading