Here's is a quick-and-dirty summary of all the important things (from the point of view of SONY and PSNOW) that happened at Ember Conf 2018.
- nucleartide's notes https://github.com/nucleartide/emberconf-2018
Here's is a quick-and-dirty summary of all the important things (from the point of view of SONY and PSNOW) that happened at Ember Conf 2018.
Gave a talk on the future of ember testing. This section wasn't too relevant for us because his talk used Qunit changes while we are using mocha through ember-cli-mocha which will handle all the changes for us.
But the one important take-away is:
Right now, all our tests are injected on the this
object like so:
describe('blah', () => {
beforeEach(function() {
this.register('service:footbarf', FakeFootService);
this.register('service:legvomit', FakeLegService)
In newer embers, we will use the this.owner
object to do both registrations and injections:
describe('blah', () => {
beforeEach(function() {
this.owner.register('service:footbarf', FakeFootService);
this.owner.register('service:legvomit', FakeLegService)
Ember has a debug library with methods like assert
and debug
that will allow us to make assertions within our code and log to the console, respectively. They are removed before the app is shipped to production.
import { assert, debug } from '@ember/debug';
You can write assertions as simple as the example below:
import { assert } from '@ember/debug';
assert('Must pass a valid object', obj);
Debug statements will be written as any console.log
statement using the debug syntax.
import { debug } from '@ember/debug';
debug('I\'m a debug notice!');
You can also use {{debugger}}
statements in handlebars to toggle elements at certain rendering points.
{{#each items as |item|}}
{{debugger}}
{{/each}}
When using the debugger helper you will have access to a get
function. This function retrieves values available in the context of the template. For example, if you're wondering why a value {{foo}}
isn't rendering as expected within a template, you could place a {{debugger}} statement and, when the debugger; breakpoint is hit, you can attempt to retrieve this value:
> get('item.name')
@dgeb is apparently working on a large git-inspired approach to organization data and io in javascript, he calls the project [orbit.js|http://orbitjs.com/] and this project meets its first user case in ember-data.
Here's how this could be applicable to us:
Marie Chatfield went over a deep dive on DOM events in Ember. Here's the big takeaway:
Don't attach DOM-element listeners:
and instead use Ember ones:
Tom Dale & Yehuda Katz Keynote
The keynote opener was a major overview of where Ember will ship with in 2018 and what the plans are for it in 2019
New File Layout
Starting in most likely 3.4+ of ember-cli, we'll likely see the new file format organization that will move everything into the ui folder like so:
This new format is available already on ember-cli master (aka canary) branch, we can play with it via the following:
npm install -g ember-cli/ember-cli ember help
to see how you can generate / init with the new format
Ember Testing
andThen
helper in tests is deprecated in favor ofasync
-await
Here are some "rules of thumb" for determining what tests we should be writing:
Handlebars and Typescript SUpport
@computed
and@tracked
decorators@someProp
for passed in attributesset
andget
with just thethis.blah = whatever
Named Blocks
Ember plans on having named blocks like so (see the [rfcs|https://github.com/emberjs/rfcs/blob/master/text/0226-named-blocks.md]):
Glimmer Rust Port
Finally, glimmer.js plans on porting over its VM, opcodes, parser, etc., related low-level code into rust and deliver to us via web-assembly. Here's what it will mean for us: