Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Make @glimmer/tracking an ember-cli addon for Ember apps. #306

Merged
merged 1 commit into from
Sep 18, 2020

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 18, 2020

Today, when @glimmer/tracking is a dependency in an application (or addon) that also has a dependency on either ember-auto-import or is using Embroider the code that exists here for @glimmer/tracking is actually shipped in the main vendor.js bundle. This is bad because that code is actually completely unused (since the babel transpilation will transform imports from @glimmer/tracking into Ember globals method calls).

The other issue is that Ember currently provides more capabilities from the @glimmer/tracking package than what is available to Glimmer.js users (for now): @glimmer/tracking/primitives/cache. Ember 3.22 adds built in support for these caching primitives and enables that import path to work properly.

Prior to these changes, attempting to import from @glimmer/tracking/primtives/cache would result in a build time resolution error:

Can't resolve '@glimmer/tracking/primitives/cache' in '/some/folder/name'

This works around the error by declaring that this package is an Ember addon, and it just happens to provide no files.

Fixes ember-polyfills/ember-cache-primitive-polyfill#3

Today, when `@glimmer/tracking` is a dependency in an application (or
addon) that also has a dependency on either `ember-auto-import` or
is using Embroider the code that exists here for `@glimmer/tracking` is
actually shipped in the main vendor.js bundle. This is _bad_ because
that code is actually completely unused (since the babel transpilation
will transform imports from `@glimmer/tracking` into `Ember` globals
method calls).

The other issue is that Ember currently provides more capabilities from
the `@glimmer/tracking` package than what is available to Glimmer.js
users (for now): `@glimmer/tracking/primitives/cache`. Ember 3.22 adds
built in support for these caching primitives and enables that import
path to work properly.

Prior to these changes, attempting to import from
`@glimmer/tracking/primtives/cache` would result in a build time
resolution error:

```
Can't resolve '@glimmer/tracking/primitives/cache' in '/some/folder/name'
```

This works around the error by declaring that this package is an Ember
addon, and it just happens to provide _no files_.
@rwjblue rwjblue added the bug label Sep 18, 2020
@rwjblue rwjblue requested a review from pzuraq September 18, 2020 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import not resolving in new Ember app
2 participants