Yes, then you pay the price twice.  That would be hard to solve
because an elm module != js module, which would solve the problem, but
would require an overhaul in how elm generates code and would
basically just be doing what bucklescript does then as a language
(though without TEA).


On Thu, Sep 22, 2016 at 9:41 AM, Ambrose Kofi Laing <akla...@gmail.com> wrote:
> I'm guessing the question from two posts ago was: if someone creates a
> component from a .elm file, and gives you their .js (but not their .elm),
> and you also create your own .elm file and use both together, do you pay the
> price of having the standard library twice in your code?
>
>
> On Thu, Sep 22, 2016 at 11:34 AM, OvermindDL1 <overmind...@gmail.com> wrote:
>>
>> On Thursday, September 22, 2016 at 9:17:47 AM UTC-6, Rupert Smith wrote:
>>>
>>> On Thursday, September 22, 2016 at 3:12:27 PM UTC+1, OvermindDL1 wrote:
>>>>
>>>> You can compile multiple main files together and they will share a
>>>> code-base, standard library, and all such.
>>>
>>>
>>> I had not considered that - useful if you want to take a one page, one
>>> main approach rather than nested TEA with a router in a single main.
>>>
>>> Still, you'd have to compile the components all together at the same time
>>> would you not? If I used some components from one auther and some from
>>> another, the code sharing would be lost.
>>
>>
>> Only if they did not pull from the same root library.  With elm make you
>> can specify multiple main files and all main files and everything they use
>> will be included and all merged into one big javascript.  If you have two
>> main files, say MyMain.elm and AnotherMain.elm, then in javascript you can
>> instance them via Elm.MyMain.embed(..) and Elm.AnotherMain.embed(..).  It is
>> just like compiling a single app, but you just include multiple main files
>> (which may indeed be just a simple do-near-nothing main that just calls the
>> main of a library).
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Elm Discuss" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/elm-discuss/2RTddO_4rLw/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to