Zaid-Ajaj / the-elmish-book

A practical guide to building modern and reliable web applications in F# from first principles
https://zaid-ajaj.github.io/the-elmish-book
Other
338 stars 51 forks source link

Do higher versions of nugets used in the project contain breaking changes (WRT the project, of course)? #143

Closed OmanF closed 4 years ago

OmanF commented 4 years ago

First of all, I obviously understand the notion of package locks and why they're there. That said, I always like having my projects using the latest working version of as many dependencies as possible.

I'm following the book along, and have coded the examples in Elmish Hackernews (Pt. 1). Not getting any compilation errors, comparing with the reference code (linked at the end of the chapter looks the same).

When the page loads I do get the spinner, but then, after all the stories have been downloaded and parsed, I get nothing on the screen. Empty. Inspecting the browser, it's not that I have something white-on-white... the HTML is the header tag and the script tag for main.js. Nothing got loaded, though the networking tab of the developer tools show that the stories are all 200.

Then I run the reference code and, lo and behold, all stories are there with neat boxes and all.

The difference is that, as a learning experience, I'm using Paket to manage the pulled dependencies, and that I don't lock the pulled Nugets to a specific version, but rather the latest. I also bumped all Node.js dependencies (on the package.json file) to the highest version they have on NPM.

Considering all this, I'm guessing at least one dependency, be it JS or F#, has some breaking change that makes the display broken.

Does that sound correct or should I look at what I'm implementing wrong?

Thanks.

Zaid-Ajaj commented 4 years ago

Hi @OmanF,

Does that sound correct or should I look at what I'm implementing wrong?

So you are saying the reference code provided by the book is working correctly but when you run the code yourself by hand, it doesn't work anymore. If you can provide the code you wrote yourself (that isn't working) I can take a look at it ;)

OmanF commented 4 years ago

I went over my code before pushing it one more time, and I think I got what the problem was, that has nothing to do with Nuget and/or Node packages versioning.

As part of trying things out I'm also using Zanaptak.TypedCssClasses and it might be the case, :), that I deleted the non type-safe classes from the render function and forgot to replace them with their type-safe equivalents (and in one case, didn't forget, but, despite auto-complete, managed to pick tile instead of title).

Which is why I don't just copy-paste, but code the examples by hand. I make all kind of stupid mistakes then I can debug them.

My bad, sorry for wasting everyone's time.

Closing (it works as intended now).

Zaid-Ajaj commented 4 years ago

No worries at all, I like the way you are learning this :smile: if you have more questions or things aren't working as expected, just let me and we can take a look at it