Closed jagthedrummer closed 4 months ago
@miguelcobain, just curious if you have a feel for whether or not this is a safe change. It seems to be working for me like I'd expect. I'm almost ready to deploy a new version of my project that's using it, and I'm wondering if I'll be able to use the regular add-on of if I'll need to set things up to use my own fork.
I see that there are a couple of test failures here. One looks like it may be a legit failure related to this PR, and the other seems to be a dependency issue of some sort. I'm running into that same dependency issue locally when I try to run the test suite, both on my branch and on mater
, so I'm not sure how to even investigate the other failure at the moment.
$ ember test
====================================================================
The `ember` node module is a placeholder, you may be looking for:
* `ember-cli` (the command line tool)
* `ember-source` (the framework code)
Visit https://emberjs.com/ for more details
====================================================================
Forwarding request to ember-cli via `npx ember-cli test`
Environment: test
cleaning up...
Build Error (FastBootConfig)
The comparison function must be either a function or undefined
Stack Trace and Error Report: /var/folders/fx/vmqbtyws34j1l88m16_9jy_00000gn/T/error.dump.749d2e4a685fa1a4e525caab63bbd8fc.log
I think this is the relevant portion of that log:
- broccoliBuilderErrorStack: TypeError: The comparison function must be either a function or undefined
at Array.sort (<anonymous>)
at stringify (/Users/jgreen/projects/ember-composability-tools/node_modules/json-stable-stringify/index.js:73:31)
at stableStringify (/Users/jgreen/projects/ember-composability-tools/node_modules/json-stable-stringify/index.js:90:3)
at FastBootConfig.toJSONString (/Users/jgreen/projects/ember-composability-tools/node_modules/ember-cli-fastboot/lib/broccoli/fastboot-config.js:170:12)
at FastBootConfig.build (/Users/jgreen/projects/ember-composability-tools/node_modules/ember-cli-fastboot/lib/broccoli/fastboot-config.js:56:53)
at TransformNodeWrapper.build (/Users/jgreen/projects/ember-composability-tools/node_modules/broccoli/dist/wrappers/transform-node.js:71:39)
at /Users/jgreen/projects/ember-composability-tools/node_modules/broccoli/dist/builder.js:185:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Builder.build (/Users/jgreen/projects/ember-composability-tools/node_modules/broccoli/dist/builder.js:204:13)
at async Builder.build (/Users/jgreen/projects/ember-composability-tools/node_modules/ember-cli/lib/models/builder.js:204:11)
Closed in favor of #59
This makes it so that asyncronous setup in a parent component will be
await
ed before trying to setup child components.If any given
didInsertNode
/didInsertParent
functions are NOT marked withasync
then I think this change should have no effect on them.Fixes #57
Example usage:
test/parent.hbs
test/parent.js
test/child.hbs
test/child.js
test.hbs
Console output with this PR:
Console output without this PR: