Re: [elm-discuss] Re: Upgrading to 0.18 and elm-webpack-starter

2016-12-22 Thread Noah Hall
FWIW there's a patch I've been working on to make change detection
more consistent. I'll release it as 4.1.2 soon

On Fri, Dec 23, 2016 at 6:34 AM, Nathan Eldridge  wrote:
> I'm not certain of your configuration, but in our current project we pretty
> much use the standard:
>
> // This loader can be in commonConfig or the production/development section
> seperately.
>
> module: {
>  loaders: [
> {
> test: /\.elm$/,
> exclude: [/elm-stuff/, /node_modules/],
> loader: 'elm-hot!elm-webpack'
>
> }
> // our other loaders here
> ]};
>
>
> I assume that's your loader. In your package.json, you should have something
> like
>
> "devDependencies":{
> "elm": "^0.18.0",
> "elm-hot-loader": "^0.5.4",
> "elm-webpack-loader": "^4.1.1",
> "webpack": "^1.14.0",
> "webpack-dev-server": "^1.16.2",
> "webpack-merge": "^2.0.0"
> //just an example of the basic required packages
> }
>
> The above is what I can look at on a personal project where I have upgraded
> those modules manually without issue. The rest of the packages are the same
> as the starter with the exception of a few tweaks to change from bootstrap
> to semantic-ui, and I guess less-loader.
>
> If you're just using the standard elm-webpack-starter, then you should only
> need to set it as a query on the loader. I personally just installed the
> 0.18 package globally from the executable from elm-lang.org. If you don't
> want to do that, then just edit your loader so that it looks like this:
>
> //for development build
>
> {
> test: /\.elm$/,
> exclude: [/elm-stuff/, /node_modules/],
> loader: 'elm-hot!elm-webpack?pathToMake=node_modules/.bin/elm-make'
>
> }
>
> //for production build
>
> {
> test: /\.elm$/,
> exclude: [/elm-stuff/, /node_modules/],
> loader: 'elm-webpack?pathToMake=node_modules/.bin/elm-make'
>
> }
>
> Just double check and see that your packages were installed/upgraded through
> npm. I can't tell you how often I frustrate myself when I decide to upgrade
> a package for a new feature/bug fix and I continue to expect it to work
> without having actually done anything besides save the package change in
> package.json.
>
> The only other thing that I can think of that could be an issue is if you
> have globally installed 0.17 and that package is not upgraded to 0.18.
>
> Because I don't remember npm commands, the quick reference would just be
>
> npm upgrade -g elm
>
> That assumes you are using npm 3+ rather than installing the executable from
> the elm-lang website.
>
>
> As for what Martin and Simon have said, I've noticed that elm-hot-loader
> only seems to catch your top level changes. Basically, it requires that your
> file structure be flat to pick up changes consistently. Was that your
> experience? I would love for elm-hot-loader to catch a few nested folders we
> have, but playing around with the configuration didn't seem to help.
>
>
>
> On Thursday, December 22, 2016 at 12:41:44 PM UTC-6, Rex van der Spuy wrote:
>>
>>
>>>  It's possible that your elm-webpack-loader is pointing to the wrong
>>> executable.
>>
>>
>> Thanks Nathan! Everything else seem fine so it seems that this is likely
>> the problem.
>> Do you know where this needs to be set?
>> I noticed this from the README in elm-webpack-loader but I wasn't sure
>> where or how it should be set (in webpack.config.js?)
>>
>> ```
>> All options are sent down as an `options` object to node-elm-compiler. For
>> example, you can explicitly pick the local `elm-make` binary by setting the
>> option `pathToMake`:
>>
>> ```js
>>   ...
>>   loader: 'elm-webpack?pathToMake=node_modules/.bin/elm-make',
>>   ...
>> ```
>>
>
> --
> 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.


[elm-discuss] Re: Upgrading to 0.18 and elm-webpack-starter

2016-12-22 Thread Nathan Eldridge
I'm not certain of your configuration, but in our current project we pretty 
much use the standard: 

// This loader can be in commonConfig or the production/development section 
seperately.

module: {
 loaders: [
{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-hot!elm-webpack'

}
// our other loaders here
]};


I assume that's your loader. In your package.json, you should have 
something like 

"devDependencies":{
"elm": "^0.18.0",
"elm-hot-loader": "^0.5.4",
"elm-webpack-loader": "^4.1.1",
"webpack": "^1.14.0",
"webpack-dev-server": "^1.16.2",
"webpack-merge": "^2.0.0"
//just an example of the basic required packages
}

The above is what I can look at on a personal project where I have upgraded 
those modules manually without issue. The rest of the packages are the same 
as the starter with the exception of a few tweaks to change from bootstrap 
to semantic-ui, and I guess less-loader.

If you're just using the standard elm-webpack-starter, then you should only 
need to set it as a query on the loader. I personally just installed the 
0.18 package globally from the executable from elm-lang.org. If you don't 
want to do that, then just edit your loader so that it looks like this:

//for development build

{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-hot!elm-webpack?pathToMake=node_modules/.bin/elm-make'

}

//for production build

{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-webpack?pathToMake=node_modules/.bin/elm-make'

}

Just double check and see that your packages were installed/upgraded 
through npm. I can't tell you how often I frustrate myself when I decide to 
upgrade a package for a new feature/bug fix and I continue to expect it to 
work without having actually done anything besides save the package change 
in package.json.

The only other thing that I can think of that could be an issue is if you 
have globally installed 0.17 and that package is not upgraded to 0.18.

Because I don't remember npm commands, the quick reference would just be

npm upgrade -g elm

That assumes you are using npm 3+ rather than installing the executable 
from the elm-lang website.


As for what Martin and Simon have said, I've noticed that elm-hot-loader 
only seems to catch your top level changes. Basically, it requires that 
your file structure be flat to pick up changes consistently. Was that your 
experience? I would love for elm-hot-loader to catch a few nested folders 
we have, but playing around with the configuration didn't seem to help.



On Thursday, December 22, 2016 at 12:41:44 PM UTC-6, Rex van der Spuy wrote:

>
>  It's possible that your elm-webpack-loader is pointing to the wrong 
>> executable.
>>
>  
> Thanks Nathan! Everything else seem fine so it seems that this is likely 
> the problem. 
> Do you know where this needs to be set? 
> I noticed this from the README in elm-webpack-loader but I wasn't sure 
> where or how it should be set (in webpack.config.js?)
>
> ```
> All options are sent down as an `options` object to node-elm-compiler. For 
> example, you can explicitly pick the local `elm-make` binary by setting the 
> option `pathToMake`:
>
> ```js
>   ...
>   loader: 'elm-webpack?pathToMake=node_modules/.bin/elm-make',
>   ...
> ```
>  
>

-- 
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.


Re: [elm-discuss] Re: Upgrading to 0.18 and elm-webpack-starter

2016-12-22 Thread Martin DeMello
I've never had webpack file watching work robustly for me. I finally just
bound a vim hotkey to "touch Main.elm" which was an adequate workaround.

martin

On Thu, Dec 22, 2016 at 9:50 AM, Simon  wrote:

> I just updated my skeleton app using webpack to 0.18. There was a bug in
> elm-webpack-loader but that has now been fixed.
>
> See https://github.com/simonh1000/elm-hot-loader for details
>
> (I am seeing the watching breaking after 5 or so rebuilds, which is a bit
> frustrating. I had that before and returned to gulp because of it. If
> anyone knows how to make webpack file watching more robust, let me know)
>
>
>
>
> On Thursday, 22 December 2016 18:39:20 UTC+1, Nathan Eldridge wrote:
>>
>> I know this is a pretty obvious solution, but have you doubled checked
>> your package.json file? My current project started with elm-webpack-starter
>> with several tweaks. When I ran elm-upgrade it did skip over that.
>>
>> You could also be trying to use an installed version of elm-make instead
>> of the package.json version. In an earlier iteration of my current project,
>> I managed to screw around with the path variables too much on Windows and
>> did that as well.
>>
>> If the obvious didn't fix it, are you using the standard 0.17
>> webpack.config.js file? It's possible that your elm-webpack-loader is
>> pointing to the wrong executable.
>>
>>
>> On Thursday, December 22, 2016 at 8:58:50 AM UTC-6, Rex van der Spuy
>> wrote:
>>>
>>> Hi Everyone,
>>>
>>> I'm trying to figure out the best way to get my newly upgraded 0.18 code
>>> to work with an existing elm-webpack-starter installation.
>>> My new code works fine in reactor, but elm-webpack-starter is still
>>> trying to compile it as 0.17.
>>>
>>> Can anyone suggest how to turn-on 0.18 compilation in the 0.7.1 version
>>> of elm-webpack-starter?
>>> Or, should I just clone a the latest version, 0.8, (which is
>>> pre-configured for 0.18) and copy my upgraded Elm source code into it?
>>>
>> --
> 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.