Question: I am trying to extend jOOQ with PostgreSQL's full-text search in type-safe way using Kotlin's extension functions.

My problem is DSL.function doesn't "know" my custom classes/types TsQuery and TsVector and throws an exception. The Function class itself doesn't have a public constructor.

> 
> org.jooq.exception.SQLDialectNotSupportedException: Type class jooq.fulltext.TsVector is not supported in dialect DEFAULT
> 
> 
> 

```
class TsQuery

class TsVector

fun Field<String>.toTsVector(searchConfig: String): Field<TsVector> {
    return DSL.function(
        "to_tsvector",
        TsVector::class.java,
        DSL.inline(searchConfig),
        DSL.coalesce(this, "")
    )!!
}

fun String.toTsQuery(searchConfig: String): Field<TsQuery> {
    return DSL.function(
        "to_tsquery",
        TsQuery::class.java,
        DSL.inline(searchConfig),
        DSL.value(this)
    )!!
}

fun Field<TsVector>.tsMatches(query: Field<TsQuery>): Condition {
    return DSL.condition(
        "{0} @@ {1}",
        this,
        query
    )!!
}

fun Field<TsVector>.tsRank(query: Field<TsQuery>): Field<Double> {
    return DSL.function(
        "ts_rank",
        Double::class.java,
        this,
        query
    )!!
}

```

If I replace TsQuery and TsVector with String then it works, but I loose typing.
I want to use them only for query building, I do not need to be able to parse/convert those types to/from Kotlin.

Answer: 
There is something called lazy loading. You seperate your app in modules and when routing each route loads the module it needs so that not all modules are loaded.[Documentation here](https://angular.io/guide/lazy-loading-ngmodules)
After long research trying to figure out how to make a smaller app, we just decided to move to react because Angular doesn't provide real tools to create small apps on load. We encourage you to do the same !