The way mirage mocks out our included records isn't accurate currently.
An example: In a request for addon
, it includes some information about the relationship to company
.
The "relationship object" we get looks like
company: { id: 123 }
codemod-cli
is straightforward - but it's especially made for codemod projects that have multiple transforms. For a single transform, we could/should have a simpler interface for consumers.
Here are three ways to share your codemod with others. The npx
methods require you npm publish
the repo.
Easiest method for the developer, especially if you only have one transform and/or if you're not using codemod-cli.
This uses the github-hosted raw.githubusercontent
link to run it, kinda like running it from a gist. Here's an example using ember-mocha-codemods
.
npm install -g jscodeshift
short url: caseywatts.com/graphviz
Graphviz is like markdown, for diagrams.
It's a tool that can transform text input into a "directed graph" output, which is nodes pointing to other nodes. You can use it for architecture diagrams, DB diagrams, documentation for users, etc.
You'll want to use a tool with a two-pane layout - the left side is the source text, the right side is the image output.
digraph bubbles { | |
node [ | |
color=lightcyan2, | |
style=filled, | |
fillcolor=lightcyan | |
] | |
edge [ | |
color=white | |
] | |
Keys
G | C | F | Bb | Eb | Ab |
---|---|---|---|---|---|
1 | 0 | 1 | 2 | 3 | 4 |
F# | _ | Bb | Bb, Eb | Bb, Eb, Ab | Bb, Eb, Ab, Db |
Song | Key | Starting Note |
---|---|---|
Gloucestershire Wassail | G | D (5) -> G (1) |
UPDATE: You don't need shims anymore! We can just use this now, and eventually it'll even be in Ember core.
app.import()
works with node_modules
now! As of Ember 2.15. Previously it only worked with bower_components
and vendor
.
Docs for app.import
are here:
https://ember-cli.com/managing-dependencies#standard-non-amd-asset
// app/helpers/json-pretty-print.js | |
// usage {{json-pretty-print someJson}} | |
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument | |
import Helper from '@ember/component/helper'; | |
export default Helper.extend({ | |
compute(params, hash) { | |
const [json] = params; | |
return JSON.stringify(json, null, ' '); |
Short link: caseywatts.com/selpattern
const sel = {
addonCard: 'a.card'
};
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" | |
xmlns:moz="http://www.mozilla.org/2006/browser/search/"> | |
<ShortName>ORG</ShortName> | |
<Description>Salesforce Org Chart</Description> | |
<InputEncoding>UTF-8</InputEncoding> | |
<Image width="16" height="16" type="image/x-icon">data:text/html;base64,PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPlNhbGVzZm9yY2UgT3JnQ2hhcnQ8L3RpdGxlPgogICAgPHNjcmlwdCBzcmM9Ii9hc3NldHMvZDMudjMubWluLmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSIvYXNzZXRzL2pxdWVyeS0zLjAuMC5taW4uanMiPjwvc2NyaXB0PgogICAgPHNjcmlwdCBzcmM9Ii9hc3NldHMvbWFnaWNfZHluYW1pYy5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0PgogICAgICAoZnVuY3Rpb24oaSxzLG8sZyxyLGEsbSl7aVsnR29vZ2xlQW5hbHl0aWNzT2JqZWN0J109cjtpW3JdPWlbcl18fGZ1bmN0aW9uKCl7CiAgICAgIChpW3JdLnE9aVtyXS5xfHxbXSkucHVzaChhcmd1bWVudHMpfSxpW3JdLmw9MSpuZXcgRGF0ZSgpO2E9cy5jcmVhdGVFbGVtZW50KG8pLAogICAgICBtPXMuZ2V0RWxlbWVudHNCeVRhZ05hbWUobylbMF07YS5hc3luYz0xO2Euc3JjPWc7bS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShhLG0pCiAgICAgIH0pKHdpbmRvdyxk |
You can use async/await
in your Ember testing suite, today! This blog post explains the situation pretty thoroughly. Also check out this blog post.
It's great in tests, but not quite useful for app code yet.
There are three ways we can get it to work. If you try async/await
without any of these changes, you will get the error regeneratorRuntime is not defined
.
Method | Size ※ | app code | test code |
---|---|---|---|
includePolyfill: true | 30kb | yes | yes |
ember-maybe-import-regenerator | 2kb | yes | yes |