Comments (17)
I would raise this with the learning team. The code documentation tools they use require some non-trivial finesse to fix this kind of thing.
As far as the types go, because this is a "synthetic" package that's not really in the /packages
folder of the ember monorepo, it should be done via a module declaration within the @types/ember__string
source.
Also, for there to be any value in having a @ember/template
package, developers should actually be importing stuff from it. The individual functions isHtmlSafe
and htmlSafe
sugest that these functions should be imported from @ember/string
anyway.
in the future this may change, but we may want to wait until a beta is cut with the deprecation before leading people in this direction.
At least for the ember 3.x release series, we need to also maintain the existing means of importing htmlSafe
and isHTMLSafe
from ember-cli-typescript.
@chriskrycho what's the story on linting with typescript? Will this addon support tslint or does eslint work well right now?
from ember-cli-typescript.
@kratiahuja the short version is: this add-on leaves that to the user entirely, but we will (for the moment) recommend TSLint, because the TS support in ESLint isn't mature enough yet.
from ember-cli-typescript.
@chriskrycho awesome! thanks for the super quick response. Appreciate it!
from ember-cli-typescript.
It would be nice to document what steps an addon author should take to add typings for their addon.
from ember-cli-typescript.
@dwickern that's a great idea and I'm planning to include it in the writeup. (I'd also like to land #47 first so that authors who are actually writing TS can do that automagically.)
from ember-cli-typescript.
Closing in favor of typed-ember/ember-typings#14, since we're driving Ember type definition development through that respository.
from ember-cli-typescript.
Reopening since we've deprecated typed-ember/ember-typings. I've copied the body of the quest. Important comments from that thread:
Has any work been done on ember-simple-auth? I'm getting complaints when building:
app/controllers/application.ts(3,28): error TS2307: Cannot find module 'ember-simple-auth/services/session'.
and (comment):
I've started creating an ember-simple-auth.d.ts locally as I run into things, happy to share it.
Regarding ember-moment I think we do not need typedefinitions. Mostly it is hbs helpers. The Javascript API is same as moment itself, which ships with typedefinitions itself.
https://github.com/dockyard/ember-one-way-controls is deprecated
from ember-cli-typescript.
Is this doc intended to cover contributing to core typings (e.g., @ember/*
)? Is there anywhere else where that would be documented?
from ember-cli-typescript.
No: those types all already exist and are largely complete! (We are of course continuing to tighten them up as we find issues or think of better ways to express things.) They live in the DefinitelyTyped repo.
from ember-cli-typescript.
Sorry, I meant contributing to those existing typings. For example, correcting issues like API changes or types that match the Ember API docs, but where those docs are incomplete/incorrect. E.g., @ember/template is not in DefinitelyTyped at all.
Should I even be trying to contribute to those, or just reporting issues and letting the experts handle those?
from ember-cli-typescript.
We’d welcome help! We mostly want to make more experts, not hoard expertise. Please open bugs on this repo (there’s a template for type definition bugs you can choose when you click the Create Issue button!). We’re very happy to mentor people through contributing fixes for them.
from ember-cli-typescript.
@HodofHod thanks for your desire to jump in and help!
E.g., @ember/template is not in DefinitelyTyped at all.
At the highest level, we want to ensure that the type information tells the truth about Ember's public API. In the case of this package, it's not represented anywhere in the docs, so it should not be in the types.
If you believe that this is part of Ember's public API, the first step would be to correct the documentation. Only then can we use an authorized documentation change as an idication of "this is public", and then add it to types.
If you're not familiar with the best practices for writing and testing declaration files, I have a blog article here that may be helpful https://medium.com/@mikenorth/guide-to-typescript-ambient-declarations-717ef6da6514
from ember-cli-typescript.
Hey, I just (already) created #342
You're correct that it doesn't appear in the sidebar, but it actually is listed in the docs for @ember/string, so I'm not sure about editing the API docs.
That makes a lot of sense regarding making sure the types match the docs, I'm just not sure about this case
from ember-cli-typescript.
That makes sense. I'd just add that based on this I'd say that @ember/template
is already the "correct" location to import from, though of course @ember/string
should continue to work. (Edit: interestingly, it seems that at the time, importing from @ember/template
wasn't working at all, though it definitely works for me on 3.3)
The ember-modules-codemod is already making this change for people, which is how I stumbled on this.
from ember-cli-typescript.
Been a while, any movement here? Maybe there is another direction that I'm not aware of.?. Thanks!
from ember-cli-typescript.
No, and we should probably rethink this whole approach. I am closing (and unpinning) this issue and folks should feel free to approach types organically. Typed Ember folks are of course happy to provide guidance and recommendations, though!
from ember-cli-typescript.
Related Issues (20)
- ember install ember-cli-typescript does not set eslint parser to @typescript-eslint/parser HOT 2
- Provide CLI option for `tsconfig.json` path to allow different config per env HOT 1
- Type for location missing in Routing types HOT 2
- Type-checking failure in node_modules on a fresh Ember app HOT 6
- No declaration files output during precompile HOT 3
- Can subclass declarations include the inherited aspects of the base class? HOT 3
- Typechecker eats 70% of CPU when idle HOT 2
- `AsyncHasMany` resolves to `ArrayProxy`, can't access `reload`/`createRecord` methods on resolved promise HOT 2
- Make sure docs are up to date for Signature usage HOT 1
- Cant find `meta` on `PromiseManyArray` HOT 4
- Broken with Embroider 1.9.0 HOT 1
- "@ember/test-helpers/setup-rendering-context"' has no exported member named 'rerender'. Did you mean 'render'? HOT 1
- memory leak of ts errors HOT 1
- bug: when `moduleName` and `package.name` differ, types will not be generated by default HOT 1
- Incompatible ECMAScript version being used during the build HOT 1
- Newly generated component is not buildable: Property 'element' does not exist on type 'TestContext' HOT 2
- Issue when building ember app with exports from GTS file into TS file HOT 2
- Warnings when using ember-cli-babel 8.x HOT 1
- Switch to maintenance mode HOT 18
- v6 release: the last major? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-typescript.