Giter Site home page Giter Site logo

Dealing with imported types about decgen HOT 10 CLOSED

janwirth avatar janwirth commented on August 22, 2024
Dealing with imported types

from decgen.

Comments (10)

dkodaj avatar dkodaj commented on August 22, 2024

Sry for the late reply, forgot to watch the repo.

Finding types imported from the app's own modules should not be too hard, we just need to parse the imports. I'll check if some parts of impfix can be reused here.

Types imported from external packages are trickier. E.g. if you import Math.Vector3.Vec3, then decgen should find your copy of elm-explorations/linear-algebra and figure out what to do with it.

from decgen.

janwirth avatar janwirth commented on August 22, 2024

Hey any updates? How can I assist?

from decgen.

dkodaj avatar dkodaj commented on August 22, 2024

from decgen.

janwirth avatar janwirth commented on August 22, 2024

I am using impfix on large 0.19 codebases without issue. Maybe we can use a temporary solution where impfix jsut streams file contents and we can keep impfix like it is?

from decgen.

dkodaj avatar dkodaj commented on August 22, 2024

from decgen.

janwirth avatar janwirth commented on August 22, 2024

My plan is to use decgen in https://github.com/FranzSkuffka/iso-elm for the transport layer.

But please do not stress yourself. Let us think about what would create the most value. Maybe we can re-use some code of or contribute to elm-in-elm/compiler. Maybe we can have a call or so to think about what the best strategy is?

from decgen.

janwirth avatar janwirth commented on August 22, 2024

Here are the test-suites for the parser: https://github.com/elm-in-elm/compiler/blob/master/tests/ParserTest.elm

from decgen.

dkodaj avatar dkodaj commented on August 22, 2024

from decgen.

dkodaj avatar dkodaj commented on August 22, 2024

I created a branch named “imports” for this feature. The generator now expects a list of strings. The head is the main module and the tail are the dependencies. The cli takes two arguments, the name of the main module and the (relative) directory where the module is (defaults to cwd).

There's a simple test you can run with

$ node src/decgen.js ExampleMain.elm

Probably buggy though!

from decgen.

janwirth avatar janwirth commented on August 22, 2024

Very cool!

from decgen.

Related Issues (5)

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.