GithubHelp home page GithubHelp logo

Comments (6)

EisenbergEffect avatar EisenbergEffect commented on June 6, 2024 1

@DrSammyD Would you be able to help us resolve this?

from dependency-injection.

DrSammyD avatar DrSammyD commented on June 6, 2024

I'll take a look tonight.

from dependency-injection.

bigopon avatar bigopon commented on June 6, 2024

Probably this line

}, ...TImpl[]];
caused it. It seems to be an issue with TS, since VsCode does not reports error but tsc fails.

For now, I think we should change it to something like this:

export interface StrategyState<
  TBase,
  TImpl extends Impl<TBase> = Impl<TBase>,
  TArgs extends Args<TBase> = Args<TBase>
  > {
  /**
   * For typings purposes, this is done as { get: StrategyFunctor } | TImpl
   * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]
   */
  [Strategy.array]: ({
    get: (
      container: Container,
      key: PrimitiveOrDependencyCtor<TBase, TImpl, TArgs>
    ) => TImpl
  } | TImpl)[];
  [Strategy.alias]: any;
}

from dependency-injection.

DrSammyD avatar DrSammyD commented on June 6, 2024

Did typescript break this? How was it ever building?

from dependency-injection.

bigopon avatar bigopon commented on June 6, 2024

@DrSammyD hmm, i'm not sure. Maybe it nevered actually built with tsc?

from dependency-injection.

DrSammyD avatar DrSammyD commented on June 6, 2024

@bigopon I mean, it must have or the this wouldn't have passed PR checks and this...

[Strategy.array]: [{
get: (container: Container, key: PrimitiveOrDependencyCtor<TBase, TImpl, TArgs>) => TImpl;
}, ...TImpl[]];
[Strategy.alias]: any;

... wouldn't have ever been generated when compiling with typescript and running the tests.

"test": "cross-env rimraf dist && tsc && karma start --single-run",

"typescript": "^3.4.1"

So the issue only shows up when old typings conflict with the new ones? Should the other projects update to the new typings?

Would this fix actually be generically fix or are we going to have to continually change these typings to match what other projects are expecting?

from dependency-injection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.