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

Octanify, begin mixin deprecation #474

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2e6274f
Octanify (component arg breaking change)
charlesfries Aug 1, 2021
4b674ac
Generate store service, begin mixin deprecation
charlesfries Aug 1, 2021
e529f9b
Convert to native classes
charlesfries Aug 2, 2021
e5d2fd1
Cleanup
charlesfries Aug 2, 2021
bdf83d3
Update ember-cli-babel to 7.26.6
charlesfries Aug 3, 2021
943b581
Bump ember-cli-addon-docs, uninstall @ember/jquery, ember-ajax , move…
charlesfries Sep 7, 2021
cdb4db7
Bump `ember-concurrency` from 1.0.0 to 2.1.2
charlesfries Sep 7, 2021
ac3fd0b
Install lint packages, update lint configuration
charlesfries Sep 7, 2021
0da048c
Update packages
charlesfries Sep 7, 2021
b716c40
Rm get calls
charlesfries Sep 7, 2021
b7235ee
Enable jquery
charlesfries Sep 7, 2021
148d556
Add itemizable test model, remove itemizable mixin, add tags hasMany …
charlesfries Sep 7, 2021
18492f4
Cleanup
charlesfries Sep 7, 2021
5adc215
Rm custom prettier printWidth
charlesfries Sep 7, 2021
efc6af1
Convert to native classes
charlesfries Sep 7, 2021
6ac3987
Glimmerize dummy
charlesfries Sep 8, 2021
2dc9816
Convert components to angle brackets, glimmerize demo1 component
charlesfries Sep 8, 2021
335a7e1
Bump ember-cli-mirage
charlesfries Sep 8, 2021
b7c08b1
Fix example
charlesfries Sep 8, 2021
e4f420a
Revert unnecessary changes, additional modernization, fix CSS comp mo…
charlesfries Sep 12, 2021
facdced
Revert
charlesfries Sep 12, 2021
7942ba8
Rm unused packages, disable jquery integration, mirage classes, fix t…
charlesfries Sep 12, 2021
ce15bde
Cleanup
charlesfries Sep 12, 2021
06b7646
Cleanup
charlesfries Sep 12, 2021
d860a9b
Glimmerize test component, bump ember-router-scroll
charlesfries Sep 12, 2021
78a36ea
Fix href bug
charlesfries Sep 12, 2021
021cf7d
Fix template lint warnings
charlesfries Sep 12, 2021
1e08559
Bump docs addons
charlesfries Sep 12, 2021
50d8784
Merge branch 'master' into pr/474
jkeen Oct 5, 2022
494544b
Linter fixes
jkeen Oct 5, 2022
34c2bb1
Merge pull request #1 from jkeen/pr/474
charlesfries Oct 12, 2022
34030b5
Cleanup
charlesfries Oct 12, 2022
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
Prev Previous commit
Next Next commit
Rm unused packages, disable jquery integration, mirage classes, fix t…
…racking
  • Loading branch information
charlesfries committed Sep 12, 2021
commit 7942ba8b4345d59622ea09ccfc83d77cff363354
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -33,8 +33,7 @@
},
"dependencies": {
"ember-cli-babel": "^7.26.6",
"ember-cli-htmlbars": "^4.0.1",
"global": "^4.3.2"
"ember-cli-htmlbars": "^4.0.1"
},
"devDependencies": {
"@ember/jquery": "^1.1.0",
@@ -47,7 +46,6 @@
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.0.3",
"broccoli-asset-rev": "^3.0.0",
"ember-ajax": "^5.0.0",
"ember-auto-import": "^1.5.3",
"ember-cli": "~3.28.0",
"ember-cli-addon-docs": "^3.0.0",
@@ -98,7 +96,6 @@
"qunit": "^2.17.0",
"qunit-dom": "^1.0.0",
"sass": "^1.17.2",
"strip-indent": "^3.0.0",
"tachyons": "4.11.1"
},
"engines": {
17 changes: 7 additions & 10 deletions tests/dummy/app/pods/docs/guides/data-fetching/demo-1/component.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import Component from '@glimmer/component';
import { computed } from '@ember/object';
import { task } from 'ember-concurrency';
import { inject as service } from '@ember/service';
import { readOnly } from '@ember/object/computed';
import { A } from '@ember/array';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import podNames from 'ember-component-css/pod-names';

export default class Demo1Component extends Component {
@service store;

@tracked visitedRoutes;

get serverPosts() {
return window.server.db.dump().posts;
}
@@ -62,12 +63,6 @@ export default class Demo1Component extends Component {
return yield this.routes[routeName].model.call(this);
}

reset() {
this.store.unloadAll('post');
this.store.resetCache();
this.visitedRoutes = A(['/']);
}

@action visitRoute(routeName) {
if (routeName !== this.activeRoute) {
this.visit.perform(routeName);
@@ -78,7 +73,9 @@ export default class Demo1Component extends Component {
this.isExpanded = !this.isExpanded;
}

@action resetState() {
this.reset();
@action reset() {
this.store.unloadAll('post');
this.store.resetCache();
this.visitedRoutes = A(['/']);
}
}
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<div class="demo1__flex">
<h2 class="demo1__section-heading">App</h2>
<div class="demo1__mla">
<button {{on "click" this.resetState}} type="button" class='demo1__btn'>Reset</button>
<button {{on "click" this.reset}} type="button" class='demo1__btn'>Reset</button>
</div>
</div>

@@ -24,7 +24,7 @@
</div>

{{#if this.visit.isRunning}}
<p class='demo1__subtle'>{{fa-icon 'spinner' spin=true}} Loading {{this.activeRoute}}...</p>
<p class='demo1__subtle'><FaIcon @icon='spinner' @spin={{true}} /> Loading {{this.activeRoute}}...</p>
{{else}}
{{#if (eq this.activeRoute '/posts/1')}}
<p>
@@ -52,9 +52,9 @@
<div class='demo1__expander'>
<a {{on "click" this.toggleExpand}}>
{{#if this.isExpanded}}
{{fa-icon 'angle-up'}}
<FaIcon @icon='angle-up' />
{{else}}
{{fa-icon 'angle-down'}}
<FaIcon @icon='angle-down' />
{{/if}}
</a>
</div>
17 changes: 7 additions & 10 deletions tests/dummy/app/pods/docs/guides/data-fetching/demo-2/component.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import Component from '@glimmer/component';
import { computed } from '@ember/object';
import { task } from 'ember-concurrency';
import { inject as service } from '@ember/service';
import { readOnly } from '@ember/object/computed';
import { A } from '@ember/array';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import podNames from 'ember-component-css/pod-names';

export default class Demo2Component extends Component {
@service store;

@tracked visitedRoutes;

get serverPosts() {
return window.server.db.dump().posts;
}
@@ -62,12 +63,6 @@ export default class Demo2Component extends Component {
return yield this.routes[routeName].model.call(this);
}

reset() {
this.store.unloadAll('post');
this.store.resetCache();
this.visitedRoutes = A(['/']);
}

@action visitRoute(routeName) {
if (routeName !== this.activeRoute) {
this.visit.perform(routeName);
@@ -78,7 +73,9 @@ export default class Demo2Component extends Component {
this.isExpanded = !this.isExpanded;
}

@action resetState() {
this.reset();
@action reset() {
this.store.unloadAll('post');
this.store.resetCache();
this.visitedRoutes = A(['/']);
}
}
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<div class="demo2__flex">
<h2 class="demo2__section-heading">App</h2>
<div class="demo2__mla">
<button {{on "click" this.resetState}} type="button" class='demo2__btn'>Reset</button>
<button {{on "click" this.reset}} type="button" class='demo2__btn'>Reset</button>
</div>
</div>

@@ -27,7 +27,7 @@

<div data-test-id='app-ui'>
{{#if this.visit.isRunning}}
<p class='demo2__subtle'>{{fa-icon 'spinner' spin=true}} Loading {{this.activeRoute}}...</p>
<p class='demo2__subtle'><FaIcon @icon='spinner' @spin={{true}} /> Loading {{this.activeRoute}}...</p>
{{else}}
{{#if (eq this.activeRoute '/posts/1')}}
<p>
@@ -56,9 +56,9 @@
<div class='demo2__expander'>
<a {{on "click" this.toggleExpand}}>
{{#if this.isExpanded}}
{{fa-icon 'angle-up'}}
<FaIcon @icon='angle-up' />
{{else}}
{{fa-icon 'angle-down'}}
<FaIcon @icon='angle-down' />
{{/if}}
</a>
</div>
2 changes: 1 addition & 1 deletion tests/dummy/app/pods/docs/guides/data-fetching/template.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ In the following example, compare how the app behaves when you visit the routes

If you followed the steps above, what you'll notice is that under the second scenario, the `/posts` route was actually rendered in two states. First, it showed `post:1` in the list, and then after about a second the app re-rendered and the other two posts appeared.

This is because the `/posts/1` route had already loaded the `post:1` record into Ember Data's store. By the time you visited the `/posts` index route, the promise from the store's `findAll` method resolved immediately with that `post:1` record, and then triggered a background reload of the entire `posts` collection. (Click the {{fa-icon 'angle-down'}} above to expand the demo for more details about what's happening as you navigate through the app.)
This is because the `/posts/1` route had already loaded the `post:1` record into Ember Data's store. By the time you visited the `/posts` index route, the promise from the store's `findAll` method resolved immediately with that `post:1` record, and then triggered a background reload of the entire `posts` collection. (Click the <FaIcon @icon='angle-down' /> above to expand the demo for more details about what's happening as you navigate through the app.)

Ember Data's `findAll` method accepts a `reload` option that we can use to force the promise to block, but then we'd lose the benefits of caching. (Note how after visiting `/posts` for the first time, it's fast on all subsequent visits.)

2 changes: 1 addition & 1 deletion tests/dummy/config/optional-features.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": true,
"jquery-integration": false,
"template-only-glimmer-components": true
}
15 changes: 15 additions & 0 deletions tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,21 @@ const browsers = [
'last 2 Safari versions'
];

// Ember's browser support policy is changing, and IE11 support will end in
// v4.0 onwards.
//
// See https://deprecations.emberjs.com/v3.x#toc_3-0-browser-support-policy
//
// If you need IE11 support on a version of Ember that still offers support
// for it, uncomment the code block below.
//
// const isCI = Boolean(process.env.CI);
// const isProduction = process.env.EMBER_ENV === 'production';
//
// if (isCI || isProduction) {
// browsers.push('ie 11');
// }

module.exports = {
browsers
};
6 changes: 3 additions & 3 deletions tests/dummy/mirage/serializers/application.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JSONAPISerializer } from 'ember-cli-mirage';

export default JSONAPISerializer.extend({
export default class ApplicationSerializer extends JSONAPISerializer {

alwaysIncludeLinkageData: false
alwaysIncludeLinkageData = false;

});
}
4 changes: 2 additions & 2 deletions tests/dummy/mirage/serializers/post.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ApplicationSerializer from './application';

export default ApplicationSerializer.extend({
export default class PostSerializer extends ApplicationSerializer {

links(model) {
return {
@@ -13,4 +13,4 @@ export default ApplicationSerializer.extend({
};
}

});
}
Loading