Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

RFC: dgeni.next #136

@btford

Description

@btford

Here are my thoughts on the next version of dgeni.

Immutable data structs

I think these should have the additional restriction that you can only set keys on an object; you can't delete or modify them.

I think using Object keys instead of string keys would improve refactoring.

If we're using ES6 module syntax, and tokens to access keys in steps in the processor, we could even go as far as using static analysis to determine the partial ordering of steps in the pipeline.

Transducers

See: http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transformation-of-Data

This should be an implementation detail, and invisible to end users. tl;dr– we can avoid some intermediate work.

I think this implementation is most promising: https://github.com/cognitect-labs/transducers-js

Building the pipeline: Constraint solver vs. explicit ordering

There are two ways to build up a pipeline:

  • specify prereqs and find partial order (what dgeni currently does)
  • build the pipeline yourself (what gulp does, for instance)

We should consider the second approach. But we should be weary of repeating gulps mistakes– we should not re-run common steps if they appear more than once.

Instead, we should use explicit pipelines to do partial ordering when "merging" pipes.

TypeScript

We should write it in TypeScript. Types are a-ok.

Developer experience

  • Debugging should be easy
  • We should have a way to dump out the order of all the tasks

Templates

There should only be one set of templates used at the end of the generation process. Currently, there's some inheritance system that makes it hard to determine which template is actually used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions