ianmackenzie / elm-3d-scene

A high-level 3D rendering engine for Elm, with support for lighting, shadows, and realistic materials.
https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/
Mozilla Public License 2.0
207 stars 27 forks source link

Examples don't compile #39

Closed ChristophP closed 4 years ago

ChristophP commented 4 years ago

Problem Files in the example folder don't compile.

Steps to reproduce

git clone git@github.com:ianmackenzie/elm-3d-scene.git
cd examples
npx elm make Triangles.elm

Possible Cause Namespace clashes of tesk9/palette(used in the package) and avh4/elm-color(used in the example). Both export a module named Color.

Fix I am willing to contribute a fix if that is helpful. I would need some feedback what the the best solution would be? I would propose to remove the the avh4/elm-color dependency. But it makes me wonder how this example ever worked? I thought dependencies with clashing module names don't ever work together because the Elm compiler cannot tell them apart.

Full Output

Detected problems in 2 modules.
-- MODULE NOT FOUND - /home/deedo/projects/experiments/elm-3d-scene/src/Scene3d.elm

You are trying to import a `Color.Transparent` module:

19| import Color.Transparent
           ^^^^^^^^^^^^^^^^^
I checked the "dependencies" and "source-directories" listed in your elm.json,
but I cannot find it! Maybe it is a typo for one of these names?

    Current
    Capacitance
    SolidAngle
    SubstanceAmount

Hint: If it is not a typo, check the "dependencies" and "source-directories" of
your elm.json to make sure all the packages you need are listed there!

                                                                  Scene3d  ↑    
====o======================================================================o====
    ↓  Scene3d.ColorConversions

-- NAMING ERROR - /home/deedo/projects/experiments/elm-3d-scene/src/Scene3d/ColorConversions.elm

I cannot find a `Color.fromRGB` variable:

40|     Color.fromRGB
        ^^^^^^^^^^^^^
The `Color` module does not expose a `fromRGB` variable. These names seem close
though:

    Color.fromRgba
    Color.fromHsla
    Color.rgb
    Color.toRgba

Hint: Read <https://elm-lang.org/0.19.1/imports> to see how `import`
declarations work in Elm.

-- NAMING ERROR - /home/deedo/projects/experiments/elm-3d-scene/src/Scene3d/ColorConversions.elm

I cannot find a `Color.toRGB` variable:

29|             Color.toRGB color
                ^^^^^^^^^^^
The `Color` module does not expose a `toRGB` variable. These names seem close
though:

    Color.toRgba
    Color.rgb
    Color.rgba
    Color.brown

Hint: Read <https://elm-lang.org/0.19.1/imports> to see how `import`
declarations work in Elm.
ianmackenzie commented 4 years ago

Yeah, my apologies, I'm in the middle of doing some revamping right now (which includes a switch from avh4/elm-color to tesk9/palette) and I haven't got around to updating the examples so probably a bunch of things don't work. Give me a few days and hopefully things will be in a more consistent state =)

ChristophP commented 4 years ago

Sure, I am also offering my help to update the examples once the work you're doing on package code is ready. Now, that I know that avh4/elm-color is the one that needs to go, it shouldn't be too hard to get it working.

ianmackenzie commented 4 years ago

OK, the examples should all work again now! (I appreciate the offer of help, but updating examples to use a new API is a great way to figure out problems with that API, so updating the examples has been a very useful exercise for me - and did lead to a few useful API additions.)

I still have some API changes planned, so the examples will have to be updated again soon. I'll try to keep the examples updated as I go but I apologize in advance if I forget and some of them lag behind =)

ChristophP commented 4 years ago

Great thanks, I will check them out soon. :-)

ChristophP commented 4 years ago

I'll keep in mind that they may be out of sync with the current status of the library.