Skip to content

Commit

Permalink
Add reproduction of runtime decorators error
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Feb 25, 2019
1 parent a255705 commit 7f3f038
Show file tree
Hide file tree
Showing 8 changed files with 643 additions and 13 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
Expand Down
16 changes: 16 additions & 0 deletions app/config/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default config;

/**
* Type declarations for
* import config from './config/environment'
*
* For now these need to be managed by the developer
* since different ember addons can materialize new entries.
*/
declare const config: {
environment: any;
modulePrefix: string;
podModulePrefix: string;
locationType: string;
rootURL: string;
};
16 changes: 16 additions & 0 deletions app/controllers/application.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember-decorators/service';
import Router from '@ember/routing/router';

export default class ApplicationController extends Controller {
@service
router!: Router;

foo(bar: string[]): void;
foo(bar: string): void;
foo() {
// dummy
}


}
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@
"test": "ember test"
},
"devDependencies": {
"@ember-decorators/babel-transforms": "^3.1.0",
"@ember/jquery": "^0.5.2",
"@ember/optional-features": "^0.6.3",
"@types/ember": "^3.0.27",
"@types/ember-data": "^3.1.3",
"@types/ember-qunit": "^3.4.5",
"@types/ember-test-helpers": "^1.0.4",
"@types/ember-testing-helpers": "^0.0.3",
"@types/ember__test-helpers": "^0.7.7",
"@types/qunit": "^2.5.4",
"@types/rsvp": "^4.0.2",
"babel-eslint": "^8.0.0",
"broccoli-asset-rev": "^2.7.0",
"ember-ajax": "^3.1.0",
"ember-cli": "~3.7.0",
Expand All @@ -32,8 +42,11 @@
"ember-cli-inject-live-reload": "^1.8.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-typescript": "^2.0.0-rc.2",
"ember-cli-typescript-blueprints": "^2.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-data": "~3.7.0",
"ember-decorators": "^5.1.3",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.1.0",
"ember-maybe-import-regenerator": "^0.1.6",
Expand All @@ -43,7 +56,8 @@
"ember-welcome-page": "^3.2.0",
"eslint-plugin-ember": "^5.2.0",
"loader.js": "^4.7.0",
"qunit-dom": "^0.8.0"
"qunit-dom": "^0.8.0",
"typescript": "^3.3.3333"
},
"engines": {
"node": "6.* || 8.* || >= 10.*"
Expand Down
40 changes: 40 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"compilerOptions": {
"target": "es2017",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"alwaysStrict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noEmitOnError": false,
"noEmit": true,
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": ".",
"module": "es6",
"experimentalDecorators": true,
"paths": {
"ember-typescript-overloads-decorators-bug/tests/*": [
"tests/*"
],
"ember-typescript-overloads-decorators-bug/*": [
"app/*"
],
"*": [
"types/*"
]
}
},
"include": [
"app/**/*",
"tests/**/*",
"types/**/*"
]
}
6 changes: 6 additions & 0 deletions types/ember-data/types/registries/model.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Catch-all for ember-data.
*/
export default interface ModelRegistry {
[key: string]: any;
}
10 changes: 10 additions & 0 deletions types/ember-typescript-overloads-decorators-bug/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import Ember from 'ember';

declare global {
interface Array<T> extends Ember.ArrayPrototypeExtensions<T> {}
// interface Function extends Ember.FunctionPrototypeExtensions {}
}

export {};

Loading

0 comments on commit 7f3f038

Please sign in to comment.