-
-
Notifications
You must be signed in to change notification settings - Fork 512
Document which dependencies must be installed, and which must not #2234
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| Not all modules need to be declared in the package.json, but for the most part | ||||||
|
|
||||||
| > [!important] | ||||||
| > If you import it, you must declare it (in `dependencies` or `peerDependencies` in your package.json) | ||||||
|
|
||||||
|
|
||||||
| ## Available via build tools | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section should explicitly clarify that these dependencies do not need to be declared in the deps. "Available via build tools" does not mean much to a new user. |
||||||
|
|
||||||
| The following packages are provided by the `ember()` vite plugin from `@embroider/vite`, via the V2 Addon Format's spec feature: `renamed-modules` (and are public API). | ||||||
|
|
||||||
| ### `@ember/*` | ||||||
|
|
||||||
| - `@ember/application` | ||||||
| - `@ember/array` | ||||||
| - `@ember/component` | ||||||
| - `@ember/controller` | ||||||
| - `@ember/debug` | ||||||
| - `@ember/destroyable` | ||||||
| - `@ember/engine` | ||||||
| - `@ember/enumerable` | ||||||
| - `@ember/helper` | ||||||
| - `@ember/modifier` | ||||||
| - `@ember/object` | ||||||
| - `@ember/owner` | ||||||
| - `@ember/reactive` | ||||||
| - `@ember/routing` | ||||||
| - `@ember/runloop` | ||||||
| - `@ember/service` | ||||||
| - `@ember/template-compilation` | ||||||
| - `@ember/template-compiler` | ||||||
| - `@ember/template-factory` | ||||||
| - `@ember/template` | ||||||
| - `@ember/test` | ||||||
| - `@ember/utils` | ||||||
| - `@ember/version` | ||||||
|
|
||||||
| ### `@glimmer/*` | ||||||
|
|
||||||
| - `@glimmer/tracking` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I swear we were chasing down a few other @\glimmer/* ones before.. maybe runtime?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there are a bunch more glimmer packages provided from build-plugins + ember-source, but I haven't listed them here because they aren't public
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ember-source/package.json#ember-addon.renamed-modules is the source of truth tho
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the latest release has this: claude just tried to tell me I needed to install
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No normal person should be concerned with thase packages tho. Experts, such as yourself, can have expert knowledge, like how to solve the issue you described. However, the types for all glimmer packages are provided by ember-source, provided your default ember-source is new enough. My fear is that including everything will mislead AI and it'll try to 'be clever', and lead users astray |
||||||
|
|
||||||
|
|
||||||
| ### Other / Supporting | ||||||
|
|
||||||
| - `@embroider/macros` (requires babel) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the "requires babel" is a bit out of left field - does that mean babel needs to be a dep? devDep? Isn't babel always required anyway?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some libraries don't seed babel, is all |
||||||
| - `ember-testing` | ||||||
| - `rsvp` | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| ## Must be present in package.json | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. must be present where? as deps or devdeps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, I think this section should clarify it is re-emphasizing the base rule of "if import -> must declare" The previous section were the exceptions, and here we're extra-clarifying certain packages that look similar to the exceptions do need to be declared. So something like: "These packages, despite looking very similar to some of the packages that are provided by the build tooling, do need to be declared, just like any other module import that is not in the list above."
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Doesn't matter for apps, |
||||||
|
|
||||||
| These packages are not provided automatic by any build tooling, and exist as standalone packages on npm. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| All of these packages only consume public APIs from `ember-source` | ||||||
|
|
||||||
| - `@ember/string` | ||||||
| - `@ember/test-helpers` | ||||||
| - `@ember/test-waiters` | ||||||
| - `@glimmer/component` | ||||||
| - `@glint/template` | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
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.
Needs clarification, cause otherwise this contradicts the previous sentence. The "for the most part" isn't really cutting it.
something along the lines of:
"As a ground rule, every module that's imported needs to be declared either in
dependenciesorpeerDependencies. However, there are some exceptions, where the imported modules are provided by the ember build tooling instead of the normal package resolution.This document describes those exceptions."