Skip to content

Commit 8839838

Browse files
authored
Merge pull request #704 from Gaurav0/update_ember_to_3.16
Update ember to 3.16
2 parents befcf4f + 29b3ed6 commit 8839838

20 files changed

Lines changed: 975 additions & 456 deletions

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
root = true
66

7-
87
[*]
98
end_of_line = lf
109
charset = utf-8

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
CodeMirror: false
2525
},
2626
rules: {
27-
'ember/new-module-imports': 'off'
27+
'ember/no-new-mixins': 'off'
2828
},
2929
overrides: [
3030
// node files

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ env:
2020
# See https://git.io/vdao3 for details.
2121
- JOBS=1
2222

23+
branches:
24+
only:
25+
- master
26+
- release
27+
2328
before_install:
2429
- curl -o- -L https://yarnpkg.com/install.sh | bash
2530
- export PATH=$HOME/.yarn/bin:$PATH

app/app.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import Application from '@ember/application';
2-
import Resolver from './resolver';
2+
import Resolver from 'ember-resolver';
33
import loadInitializers from 'ember-load-initializers';
44
import config from './config/environment';
55

6-
const App = Application.extend({
7-
modulePrefix: config.modulePrefix,
8-
podModulePrefix: config.podModulePrefix,
9-
Resolver
10-
});
6+
export default class App extends Application {
7+
modulePrefix = config.modulePrefix;
8+
podModulePrefix = config.podModulePrefix;
9+
Resolver = Resolver;
10+
}
1111

1212
loadInitializers(App, config.modulePrefix);
13-
14-
export default App;

app/components/user-menu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export default Component.extend({
2828

2929
case 'staging':
3030
return `${baseLink}/commit/${currentRevision}`;
31+
32+
default:
33+
return '';
3134
}
3235
}),
3336

app/mixins/files.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,21 @@ export default Mixin.create({
112112
//strip file extension if present
113113
path = path.replace(/\.[^/.]+$/, "");
114114

115+
let isGlimmer = false; // TODO: decide how to let user choose
116+
115117
if (this.isPathInvalid('component', path)) {
116118
return;
117119
}
118120
['js', 'hbs'].forEach((fileExt, i)=>{
119-
let fileProperties = this.emberCli.buildProperties(`component-${fileExt}`);
121+
let replacements = {};
122+
if (fileExt === 'js') {
123+
replacements.importComponent = isGlimmer ?
124+
`import Component from '@glimmer/component';` :
125+
`import Component from '@ember/component';`;
126+
replacements.importTemplate = '';
127+
replacements.defaultExport = "class extends Component {\n}";
128+
}
129+
let fileProperties = this.emberCli.buildProperties(`component-${fileExt}`, replacements);
120130
let notPodPrefix = "components/";
121131
let filePath;
122132
if (path.substr(0, notPodPrefix.length) === notPodPrefix) {

app/mixins/test-files.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ export default Mixin.create({
5656
let openComponent = descriptor => `<${descriptor}>`;
5757
let closeComponent = descriptor => `</${descriptor}>`;
5858
let selfCloseComponent = descriptor => `<${descriptor} />`;
59+
let hbsImportStatement = `import hbs from 'htmlbars-inline-precomipile';`;
5960

6061
const fileProperties = this.emberCli.buildProperties(blueprint, {
6162
testType: 'integration',
6263
componentName: camelizedName,
6364
friendlyTestDescription: 'TODO: put something here',
6465
openComponent,
6566
closeComponent,
66-
selfCloseComponent
67+
selfCloseComponent,
68+
hbsImportStatement
6769
});
6870

6971
if (this.isPathInvalid(blueprint, filePath)) {

app/router.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import EmberRouter from '@ember/routing/router';
22
import config from './config/environment';
33

4-
const Router = EmberRouter.extend({
5-
location: config.locationType,
6-
rootURL: config.rootURL
7-
});
4+
export default class Router extends EmberRouter {
5+
location = config.locationType;
6+
rootURL = config.rootURL;
7+
}
88

99
Router.map(function() {
1010
this.route('gist', {path: '/'}, function() {
@@ -19,5 +19,3 @@ Router.map(function() {
1919
this.route('twiddles');
2020
this.route('catchall', { path: '*:' });
2121
});
22-
23-
export default Router;

app/templates/components/.gitkeep

Whitespace-only changes.

blueprints/app.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Application from '@ember/application';
2+
import Resolver from './resolver';
3+
import loadInitializers from 'ember-load-initializers';
4+
import config from './config/environment';
5+
6+
const App = Application.extend({
7+
modulePrefix: config.modulePrefix,
8+
podModulePrefix: config.podModulePrefix,
9+
Resolver
10+
});
11+
12+
loadInitializers(App, config.modulePrefix);
13+
14+
export default App;

0 commit comments

Comments
 (0)