Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ember-lifeline to use this polyfill #8

Closed
rwjblue opened this issue Apr 21, 2020 · 7 comments
Closed

Update ember-lifeline to use this polyfill #8

rwjblue opened this issue Apr 21, 2020 · 7 comments

Comments

@rwjblue
Copy link
Member

rwjblue commented Apr 21, 2020

I'd like to at least spike migrating ember-lifeline to leveraging this polyfill, then we could do the same for ember-concurrency, etc.

/cc @scalvert

@scalvert
Copy link

Yep, agreed. I can take a stab at migrating lifeline's internals.

@scalvert
Copy link

I seem to be running into a small snag with this.

addon/run-task.ts:12:36 - error TS2307: Cannot find module '@ember/destroyable' or its corresponding type declarations.

12 import { registerDestructor } from '@ember/destroyable';

There may be a TS build ordering issue going on here, as the module alias is registered dynamically via the register script in vendor. I'm debugging, but so far I haven't gotten to the bottom of it.

@buschtoens do you know if this works with TS projects that use ember-cli-typescript?

@scalvert
Copy link

Resolved (temporarily) by adding this module to paths in the tsconfig.json:

"paths": {
      "dummy/tests/*": ["tests/*"],
      "dummy/*": ["tests/dummy/app/*", "app/*"],
      "ember-lifeline": ["addon"],
      "ember-lifeline/*": ["addon/*"],
      "ember-lifeline/test-support": ["addon-test-support"],
      "ember-lifeline/test-support/*": ["addon-test-support/*"],
      "@ember/destroyable": ["node_modules/ember-destroyable-polyfill"],
      "*": ["types/*"]
    }

@rwjblue
Copy link
Member Author

rwjblue commented Jul 21, 2020

Ya, we should (once we are able to land the changes in ember-lifeline) document the exact tsconfig.json that are needed for TypeScript consumers here in the README.

@scalvert
Copy link

Following up on the tsconfig.json changes I made in lifeline to get this to work:

I added the following to the paths object:

"paths": {
  // ...
  "@ember/destroyable": ["node_modules/ember-destroyable-polyfill"],
  // ...
}

@rwjblue
Copy link
Member Author

rwjblue commented Jul 28, 2020

Awesome, thanks @scalvert!

@rwjblue
Copy link
Member Author

rwjblue commented Jul 28, 2020

Sent a PR for adding docs for that over in #73

Also since ember-lifeline/ember-lifeline#852 is landed, I'm closing this...

@rwjblue rwjblue closed this as completed Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants