-
Notifications
You must be signed in to change notification settings - Fork 28
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
Use built in types from ember-source instead of the types-packages #118
base: main
Are you sure you want to change the base?
Conversation
@@ -36,31 +39,16 @@ | |||
"@babel/plugin-syntax-decorators": "^7.17.0", | |||
"@babel/runtime": "^7.17.0", | |||
"@embroider/addon-dev": "^3.0.0",<% if (typescript) { %> | |||
"@glimmer/component": "^1.1.2", |
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.
This is required by glint
@@ -25,6 +25,9 @@ | |||
"test": "echo 'A v2 addon does not have tests, run tests in test-app'", | |||
"prepack": "rollup --config" | |||
}, | |||
"peerDependencies": { |
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.
highly likely a v2 addon will want a peer on ember-source
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.
Seems good to me, especially since the v1 blueprint also has this, but I remember this comment by @ef4 🤔
the main reason people are forced to add it is if they want to say dependencySatisfies('ember-source', ...).
but this is the case quite often, often implicitly by others doing this, e.g. see ember-polyfills/ember-cached-decorator-polyfill#212
So I'm 👍, but just wanted to make sure...
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.
hmmm that's a good point. I'll hopefully remember to bring this up in tomorrows meeting.
The typescript test is using
This is with a project generated via:
changing nothing else about
|
It's likely this problem will go away when the @chriskrycho -- I remember reading you ran in to some issues promoting the preview types to stable -- do you have those listed anywhere, so I can make note of them? |
@@ -25,6 +25,9 @@ | |||
"test": "echo 'A v2 addon does not have tests, run tests in test-app'", | |||
"prepack": "rollup --config" | |||
}, | |||
"peerDependencies": { |
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.
Seems good to me, especially since the v1 blueprint also has this, but I remember this comment by @ef4 🤔
the main reason people are forced to add it is if they want to say dependencySatisfies('ember-source', ...).
but this is the case quite often, often implicitly by others doing this, e.g. see ember-polyfills/ember-cached-decorator-polyfill#212
So I'm 👍, but just wanted to make sure...
files/__addonLocation__/unpublished-development-types/index.d.ts
Outdated
Show resolved
Hide resolved
563cac7
to
9c9a940
Compare
Moving to draft, as I have some things to explore, and later extract from this PR. |
83cae01
to
c841f7f
Compare
In order to have effective use of the built in types, ember-source needs to be around 4.12, however, that's *just for development*, and actual runtime usage can be much wider Add npmrc per pnpm RFC updates
c5dbf5e
to
7a86220
Compare
@@ -33,33 +36,19 @@ | |||
<% if (typescript) { %>"@babel/preset-typescript": "^7.18.6"<% } else { %>"@babel/eslint-parser": "^7.19.1"<% } %>, | |||
"@babel/plugin-proposal-class-properties": "^7.16.7", | |||
"@babel/plugin-proposal-decorators": "^7.20.13", | |||
"@babel/plugin-proposal-object-rest-spread": "^7.20.7", |
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.
this will go away with this PR: #136
This PR is blocked until:
ember new my-app --typescript
uses the built in types (see discussion Add note for workaround for --typescript issues #123)yarn@v1
not resolving types directly? this are getting weirder as I investigate this. the TS test that's failing uses both yarn and pnpm.This reduces a lot of the dependency management that folks need to do.
Best of all, this change shouldn't affect consumers of existing v2 addons as there are developement-only types.
(with the caveat that some of the types from DT may not be compatible with the built-in ember-source types)