Skip to content
This repository has been archived by the owner on Nov 1, 2019. It is now read-only.

Fails if there are 'classic' classes present #58

Open
mfeckie opened this issue Sep 1, 2019 · 3 comments
Open

Fails if there are 'classic' classes present #58

mfeckie opened this issue Sep 1, 2019 · 3 comments

Comments

@mfeckie
Copy link

mfeckie commented Sep 1, 2019

If used in a mixed project (like one transitioning to typescript), fails hard when tasks are present in classic classes.

For example

  test('Classic class', async function(assert) {
    const subject = EmberObject.create({
      testTask: task(function*() {
        yield timeout(1);
      }),
      async perform() {
        await timeout(1);
        return 'done';
      }
    })

    const value = await subject.perform();
    assert.equal(value, 'done');
  });

results in

Build Error (broccoli-persistent-filter:Babel > [Babel: ember-concurrency-typescript]) in dummy/tests/unit/task-test.ts

/addons/ember-concurrency-typescript/dummy/tests/unit/task-test.ts: `task` has to be a direct child of a `ClassProperty`.
  30 |   test('Classic class', async function(assert) {
  31 |     const subject = EmberObject.create({
> 32 |       testTask: task(function*() {
@buschtoens
Copy link
Owner

Hey @mfeckie!

I'm sorry, that I didn't update the README yet and probably cost you some time. ember-concurrency-typescript was an experiment that I'll likely not pursue any longer. Instead we're trying to get machty/ember-concurrency-decorators#56 out the door, which is essentially almost the same, but a bit better in some regards.

@buschtoens
Copy link
Owner

I published a pre-release, so you can try it out already: machty/ember-concurrency-decorators#56 (comment)

@mfeckie
Copy link
Author

mfeckie commented Sep 2, 2019

Don't apologise 😄 Didn't really waste my time! I was just experimenting with options and now I can try the alpha :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants