Re: [elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-23 Thread Christophe de Vienne
Le 23/05/2017 à 17:44, 'Rupert Smith' via Elm Discuss a écrit : > On Monday, May 8, 2017 at 3:38:55 PM UTC+1, Eirik Sletteberg wrote: > > Maybe write an example in the form of an integration test - then you > know your example will be up to date with the actual code, and it > may even

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-23 Thread 'Rupert Smith' via Elm Discuss
On Monday, May 8, 2017 at 3:38:55 PM UTC+1, Eirik Sletteberg wrote: > > Maybe write an example in the form of an integration test - then you know > your example will be up to date with the actual code, and it may even > discover bugs! I think there is an issue here that did not come up for

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-11 Thread Eric G
On Thursday, May 11, 2017 at 10:49:17 AM UTC-4, Jakub Hampl wrote: > > In elm-visualisation I use option #3 but build things into a /docs > directory that github serves. This is done via > https://github.com/gampleman/elm-example-publisher, which has a UI > somewhat resembling bl.ocks.org >

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-11 Thread Jakub Hampl
In elm-visualisation I use option #3 but build things into a /docs directory that github serves. This is done via https://github.com/gampleman/elm-example-publisher, which has a UI somewhat resembling bl.ocks.org On Monday, 8 May 2017 04:58:26 UTC+1, Matthieu Pizenberg wrote: > > Exploring a

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-09 Thread Francesco Orsenigo
A personal pain point of mine is when the examples just import TheModule exposing (..) rather than just using fully qualified references TheModule.aFunction . First of all, because that's not how the library will be used. Second, and more important, unless you know already what the library

Re: [elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-09 Thread Francesco Orsenigo
> I have my examples/elm-package.json include ../src, and have my CI script > build all the examples so that I remember to update the examples of the API > changes. > > Also, imo it's good to have a separate examples/elm-package.json because > you often want other dependencies to make a

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Matthieu Pizenberg
> > - Use elm-doc-test for examples whereever possible > - If you have views, use elm-html-test. > Thanks Noah, I didn't know about those for lack of using tests. Thank you everyone for your feedback. So if I sum up, the main ideas are: 1. Keep in sync doc examples by using doc tests. 2. For

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Marek Fajkus
My thoughts: - Most packages don't depend on `elm-lang/html` - Most examples do depent on `elm-lang/html` - It's good to enforce examples compatibility <-> library compatibility in CI (compiling examples in some step) Solution? - have `elm-package.json` without `elm-lang/html`

Re: [elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Noah Hall
Best practice: - Use elm-doc-test for examples whereever possible, don't just write documentation examples. They easily fall out of sync. If your doc-tests start to look too crazy, it's possible your API could be simplified. - Have a test suite. Depending on your problem, your test suite may need

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Eirik Sletteberg
Maybe write an example in the form of an integration test - then you know your example will be up to date with the actual code, and it may even discover bugs! -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Eric G
Good question, I'd like to hear what other people do as well. Just to add two other options to the mix: 5. Link to an example that uses the package in Ellie (https://ellie-app.com/) 6. Deploy an example to the Github project page (https://username.github.io/package/ ) 5. Is quick and painless