Comments (9)
Added in bullet-train-client and react-native-bullet-train 0.2.3, enjoy!
If you find any type issues, comment here but think everything is covered.
from flagsmith-js-client.
Also, instead of having a webpack fix, what I might suggest is doing something like:
shared_types.ts
:
export interface Test {
example: string;
}
export interface Other {
oneMore: number;
}
Then, in each of the instances you need those types:
declare module 'bullet-train-client' {
export * from './shared_types;
}
That way, you can have a single source-of-truth without having to deal with webpack copy messiness. Feel free to ping me about TS-related issues for this project in the future :) I'd love to be of assistance!
from flagsmith-js-client.
I'm getting a build failure when using TS as-of version 0.2.3
in Angular.
7016: Could not find a declaration file for module 'bullet-train-client'. '/Users/crutchcorn/git/Coopervision/CVExtreme/node_modules/bullet-train-client/index.js' implicitly has an 'any' type.
Try `npm install @types/bullet-train-client` if it exists or add a new declaration (.d.ts) file containing `declare module 'bullet-train-client';`
2 import bulletTrain from 'bullet-train-client';
~~~~~~~~~~~~~~~~~~~~~
However, renaming the bullet-train-client.d.ts
file to index.d.ts
in node_modules
fixes this for me
from flagsmith-js-client.
Another fix for this would be to add the following to package.json
:
"types": "./bullet-train-client.d.ts"
However, I think that the isomorphic
import would also break. I would suggest moving both d.ts
files into the same index.d.ts
file (since they're namespaced, it should work properly) and then adding it to the types
field in package.json
I can make a PR if that'd help
from flagsmith-js-client.
Ah strange, but I totally see what you mean about combining. I think ideally I'd look to also have some automated webpack approach for this since react-native, isomorphic AND the general lib have the same types.
Hmm, I didn't think naming as index.d.ts was a requirement, I'm sure other modules don't do this.
If you're offering to do that quickly though @crutchcorn that would definitely be appreciated!
from flagsmith-js-client.
Yup! It's somewhat blocking stuff at work, so let me see if I can't just fix this issue quickly :) Forking now!
from flagsmith-js-client.
Thanks, apologies about that! It's strange because running the client locally command clicking jumps to the .d.ts instead of the lib code which signifies it's working.
Regardless, I'll keep an eye out for this, do some quick sanity checks and publish a version as soon as I see it!
from flagsmith-js-client.
Right! Very weird, the differences between the TS language provider (for IDEs) and the compiler 🤷♂️
Either way #31 has been opened to help resolve this
from flagsmith-js-client.
Version @0.2.4 released, thank you again!
Will close for now, but reopen if you come across anything TS related.
from flagsmith-js-client.
Related Issues (20)
- Flagsmith's `loadingState.error` is not respect actual error state HOT 11
- [Bug] - NextJS >= 13.0.0 SSR `useFlagsmith` state not matching the state that is passed to the provider. HOT 16
- flagsmith/react only works in React 18 HOT 3
- [Bug] - TypeError: Cannot read properties of null (reading 'getValue') HOT 5
- Flagsmith's 'useFlags' doesn't return actual cached flags when request failed HOT 2
- Rollup Name for react HOT 5
- Inconsistent license information HOT 2
- Caching with multiple instance doesn't work HOT 6
- Typing issue in react.tsx: 'flagsmith' is possibly 'null' HOT 3
- useFlags() race condition HOT 8
- Different environments not working HOT 5
- Localstorage cache is not being wiped out in some edge cases HOT 3
- Support `getValue` fallback without `json` flag HOT 2
- useFlags not updating values in react18/Nextjs App Router
- 3.23.0 seems to have broken something HOT 4
- Intermittent Flakiness in Feature Flags on Safari/MacOS HOT 2
- Flags are null when the cacheFlags option is true HOT 3
- Typescript compiler errror `Cannot find name 'F'.` when compiling flagsmith in Angular project HOT 3
- Bundle ES(flagsmith-es) and combine with standard CJS module (flagsmith)
- Identifier/trait confusion when using `cacheOptions: { skipAPI: true } ` HOT 3
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 flagsmith-js-client.