Comments (10)
For anyone who might follow - until this is supported legit I've got a simple type defs repo up that seems to make the compiler happy for now
https://github.com/toranb/ember-fetch-tsdefs/blob/master/index.d.ts
npm install ember-fetch-tsdefs -D
from ember-fetch.
Is there a downside to submitting those types to this repo?
from ember-fetch.
@stefanpenner good question .. mostly that Toran is the furthest thing from "expert types ninja" at the moment. If someone else can jump in and confirm "yup -looks legit bro" then I say we could ship it and iterate
Here is how I'm using that btw
return fetch('/api/restaurants')
.then((fetched: Response) => fetched.json())
.then((response: Restaurants) => dispatch({
type: ActionTypes.TRANSFORM_LIST,
response: response
}));
from ember-fetch.
@toranb if you have cycles to submit it as a PR, I can gladly take a look :). I'll also bug señor @krisselden (our resident guru of everything) to review.
from ember-fetch.
@stefanpenner it's possible - 2 questions related to submitting a PR for this
- how does one test this? it could require we add typescript to this repo as a devDependency
- what min version of typescript will we support? I'm using TS v2.3 right now for example
from ember-fetch.
example of typescript-definition-tester in action
https://github.com/gaearon/redux-thunk/pull/77/files
note: this could be considered "over kill" - worth mentioning either way
from ember-fetch.
I'll ask @krisselden to chime in.
from ember-fetch.
@toranb i suspect just running the ts validate step is sufficient for testing.
from ember-fetch.
@stefanpenner good call boss - I'll wait to hear from @krisselden on what he thinks of these type defs :)
from ember-fetch.
@stefanpenner closing this out for now - we can continue discussion in the PR
from ember-fetch.
Related Issues (20)
- Version 6.7.2 onwards seems not to transpile to es5 (Caused IE11 Blank screen, with no console errors) HOT 2
- Could not find module `fetch` imported from `prog/instance-initializers/setup-fetch` HOT 2
- Operation outputFileSync is not allowed to use HOT 15
- Where are all the response headers? HOT 2
- Inconsistent Headers objects with preferNative HOT 1
- fetch is not defined - maybe your browser targets are not covering everything you need HOT 31
- v8.0.3 contains `yarn-error.log` file
- Ember 3.27+ issues deprecation for accessing `window.Ember` HOT 1
- Could not find module `rsvp` imported from `fetch` HOT 6
- Version 8.1.0 not released to NPM? HOT 1
- Migration from jquery.ajax $.ajaxSettings.traditional = true. How remove [] from params
- Dropping Node 10, older versions of Ember
- Archive this repo? HOT 16
- Deprecation warning for assign() from ember/polyfills
- Failed to execute 'fetch' on 'Window': Failed to read the 'signal' property from 'RequestInit': Failed to convert value to 'AbortSignal'.
- ember-polyfills.deprecate-assign deprication in Ember 4.4
- ember-fetch `input` type parameter is incorrect
- Upgrade package "node-fetch" to fix
- `Error: cannot find module rsvp imported from fetch`: Ember 4.12 + embroider-optimized scenario HOT 1
- Maintenance, V2, modern `fetch`, etc
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-fetch.