-
Notifications
You must be signed in to change notification settings - Fork 99
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
[RFC / Quest] Decomposing types into @ember modules #250
Comments
For 3., is it not desirable to just make |
You're absolutely right. I must have been drinking when I wrote the above :P |
I think my only hesitation was wanting to better understand that bit; in its revised form, I'm 👍 on this plan. |
Going by the mappings in rfc176-data, this should result in 23 new
|
@dwickern I think that some of those do not |
Here's the minimum list I have so far
|
How should we handle the contributors for these individual I'd love to see us end up with domain-specific maintainers (i.e., a few people watch over Should we consider this a new package with a new contributors list, or copy everyone from |
What are you using to determine which of those modules are public? I thought their presence in rfc-176 implies that they're all public. For example, |
@dwickern At least for now, I'm focused on existing modules that we have types for (i.e., our example: |
This quest now has its own project dashboard here |
Excellent work here, @mike-north! Thanks for driving this forward! |
Motivation
The 2.16 changes around how framework modules are consumed was intended to get people importing parts of the framework in this new way, with the aim of making it possible to incrementally refactor
ember-source
into independent npm modules without breaking consumers' apps.Goals
@ember/*
modulesindex.d.ts
import ComputedProperty from '@ember/object/computed';
should be found innode_modules/@types/@ember/object/computed.d.ts
@ember
modules the source of truth, with the'ember'
module re-exporting in the pre-2.16 styleember-cli-typescript
Nice To Have
declare module '@ember/foo'
stuff with simply having a*.d.ts
file in the right place.package.json
Proposed Strategy
1. Re-export everything from
'ember'
through the appropriate@ember/*
modulesThis is already done.
2. Create a new
@types/
package for each of the top-level@ember
modules thatember-source
ships.Most of you are probably aware of the
types-publisher
limitations around packages where npm module and ES6 module paths misalign. This is one reason we have everything in a single massiveindex.d.ts
file.Additionally, there are limitations around scoped packages in
types-publisher
prevent us from exposing multiple@ember/*
types from a single module (other than a bunch ofdeclare module '@ember/******'
stuff. For this reason, we cannot have a single (conceptual equivalent of)@types/@ember
that contains everything. We must create individual subfolders for@types/ember__object
,@types/ember__component
, etc... Each of these will be independently versioned and independently published bytypes-publisher
.2.1 Create a new
*.d.ts
file for every ES6 module we currently provide types forThese modules will initially contain only the re-export stuff (one
*.d.ts
file per ES6 module we currently provide types for), bringing in@types/ember
as a dependency viaa triple-slash directivea module import. The only tests that should be in these new type packages are those that protect against regression within the re-exporting.3. Add the new
@types/ember__*
packages as dependencies to@types/ember
4. In no less than one PR per
@ember
package, incrementally move the source of truth for the types from@types/ember
to the respective@types/ember__*
Once each of these PRs is complete,
@types/ember
will then depend on the respective@types/ember__*
via a triple-slash directive.PROJECT DASHBOARD
The text was updated successfully, but these errors were encountered: