-
Notifications
You must be signed in to change notification settings - Fork 137
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
Support "cache" from @glimmer/tracking #1088
Conversation
@@ -20,7 +20,7 @@ class RedirectToEmber extends Plugin { | |||
outputFileSync(join(this.outputPath, 'index.js'), `export { tracked } from '@ember/-internals/metal';`); | |||
outputFileSync( | |||
join(this.outputPath, 'primitives', 'cache.js'), | |||
`export { createCache, getValue, isConst } from "@ember/-internals/metal";` | |||
`export { cached, createCache, getValue, isConst } from "@ember/-internals/metal";` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ef4 does this need to be in a macroCondition somehow? (exports have to be top-level don't they?) since pre ember-source-4.1, this cached export doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can write this in a way that isn't a SyntaxError even when cached
is not exported by ember metal:
import * as metal from "@ember/-internals/metal";
const { cached, createCache, getValue, isConst } = metal;
export { cached, createCache, getValue, isConst };
It means our module always exports the name cached
, but on older ember its value will be undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will that work pre 3.27? I know some modules weren't allowing import *
I mean, I guess I'll find out!
Does this PR helps #1020 as well? |
@nightire I don't think so :( |
Thanks, looking good. |
#1086 (comment)