question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Metadata file and the Type::findType(): Type | undefined and Type::getTypes(): Array<Type> methods

See original GitHub issue

Suggestion

Add optional behavior or change the default behavior which will generate metadata.js file which will contain all the information about types at one place.

  1. This should resolve the problem with circle dependencies,
  2. no duplicit type declarations in generated .js files,
  3. metadata can be used to find types eg. by name.

Example

const controllerType: Type = getType<Controller>();
const controllers = Type.getTypes().filter(type => type.isAssignableTo(controllerType));

Maybe something like @reflect() would be required to use on type declarations to optimize code. Or some configurations explicitly enabling metadata generation of all the types.

@reflect
export default class HomeController {}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
iDevelopThingscommented, Feb 3, 2022

I’m so confused… it’s now working fine for me O.o

0reactions
iDevelopThingscommented, Feb 3, 2022

Okay I think my main problem is just related to ts-node and the logic for this include/exclude system I’m working on.

I think it’s just a case of it not visiting the files defined, since i tapped some hacky logic onto the mainVisitor…

For this idea to work, it might have to be a program transformer O.o (this would probably be better any way for the fact we’re generating files… when i did a similar thing with webpack(just manual file creation) it sent it into an endless re-compile loop, which i haven’t considered)

Read more comments on GitHub >

github_iconTop Results From Across the Web

PySpark ArrayType Column With Examples
PySpark pyspark.sql.types.ArrayType (ArrayType extends DataType class) is used to define an array data type column on DataFrame that holds the same type.
Read more >
Type 'T[] | undefined' is not an array type · Issue #5767 - GitHub
Because characters can be undefined too, and undefined doesn't have a method called map the compiler is throwing an error.
Read more >
Array<Type> VS Type[] in Typescript - Stack Overflow
Type [] is the shorthand syntax for an array of Type . Array<Type> is the generic syntax. They are completely equivalent.
Read more >
ArrayType (Spark 2.4.4 JavaDoc) - Apache Spark
public class ArrayType extends DataType implements scala. ... static String, prettyJson() ... Methods inherited from class org.apache.spark.sql.types.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found