Skip to content

Instantly share code, notes, and snippets.

@pgengler
pgengler / components.my-component\.js
Last active April 17, 2023 04:49
ember-data unload issue 3.28
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
export default class extends Component {
@service router;
@action async delete() {
const a = this.args.a;
const b = a.b;
@pgengler
pgengler / components.my-component\.js
Last active June 28, 2021 19:04
component invocation
import Component from '@glimmer/component';
export default class extends Component {
}
@pgengler
pgengler / controllers.application\.js
Created May 29, 2021 02:36
ember-data Model import
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@pgengler
pgengler / controllers.application\.js
Created April 16, 2021 14:51
Array tracking/computed
import Controller from '@ember/controller';
import { tracked as glimmerTracked } from '@glimmer/tracking';
import { tracked as builtinsTracked } from 'tracked-built-ins';
import { action, computed } from '@ember/object';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
untrackedArray = [];
@glimmerTracked plainTrackedArray = [];
@pgengler
pgengler / controllers.a\.js
Created April 8, 2021 22:54
Query Param badness
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
export default class extends Controller {
@service router;
@action
redirectWithTransitionToRoute() {
this.transitionToRoute('b');
@pgengler
pgengler / example.js
Last active April 1, 2021 13:23
Incorrect error message from Chrome on invalid destructuring
let a = { foo: 'bar' };
let [b] = a;
// => Uncaught TypeError: a is not iterable
let c = { foo: { bar: 'baz' } };
let [d] = c.foo;
// => Uncaught TypeError: undefined is not a function
ember try:ember '~3.16.0 || ~3.20.0 || ~3.24.0 || >=3.25.0' --skip-cleanup=true
(node:610) ExperimentalWarning: The fs.promises API is experimental
(node:623) ExperimentalWarning: The fs.promises API is experimental
added 622 packages, removed 403 packages, changed 131 packages, and audited 2468 packages in 37s
82 packages are looking for funding
run `npm fund` for details
7 low severity vulnerabilities
import Component from '@glimmer/component';
export default class extends Component {
}
// Borrowed from https://github.com/heroku/ember-sortable/pull/181
// until a version of ember-sortable with that PR (or something similar) lands
import { findAll, triggerEvent } from '@ember/test-helpers';
import { resolve } from 'rsvp';
export async function drag(mode, item, offsetFn, callbacks = {}) {
let start;
let move;
let end;
yarn install v1.6.0
[1/4] Resolving packages...
warning ember-cli > [email protected]: Please replace with usage of fs.existsSync
warning ember-cli > broccoli-stew > broccoli-funnel > [email protected]: Please replace with usage of fs.existsSync
warning ember-cli > ember-cli-preprocess-registry > [email protected]: Please replace with usage of fs.existsSync
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "eslint@>=3.1.0".
[4/4] Building fresh packages...
Done in 13.67s.