Comments (11)
Nice tracking skills! Changed to Int32.Parse, and released fable-elmish-browser update.
from elmish.
@johlrich No idea, sorry. Looks like a bug. It'd be very helpful if you could send the failing tests. TDD FTW! ..T standing both for types and tests ;)
from elmish.
Hey just noticed this, how is this coming along? I actually have a branch with the serialization part working,
I can open a PR to show the wip if you wanted, I would have on Monday, but I had been doing the changes in another project's node_module folder instead of the actual fork by mistake and need to move the code over. It's been a busy few days and forgot to open a ticket, sorry about that!
from elmish.
No worries, send it in, look forward to seeing it!
from elmish.
Just added #58 with some comments for additional info / discussion.
from elmish.
While we're at it, we should probably change the withConsoleTrace
as well... new DUs are unreadable w/o reflection.
from elmish.
@johlrich so... I just released it as @0.9.0-beta-6 and tested it on navigation sample: it doesn't work when it comes to stepping through the history - at a glance it needs convert reflected DU case names back to DU tags.
from elmish.
OK, taking a look using the sample. Finally learned how to get webpack / npm link playing nice so it'll be easier for me to check changes in the future w/ samples before a PR as well
from elmish.
@et1975 So it looks like there is an issue with inflateUnion in fable-core with the | Blog of int
case. If you want to see it working at least a bit, try having a history that click home / searches a zip code and you can jump around those correctly.
/cc @alfonsogarciacaro I'll write a failing test upstream in fable now, but just an FYI if you know why deserializing a union case of int would blow up.
from elmish.
@et1975 I can't reproduce this in fable directly and have gotten a bit stuck on with the triage. A little more detail / update:
When the type was being deserialized there was a string number in the object payload being inflated. I thought this was something in the redux devtools, but when I put a breakpoint in elmish-debugger before it sends the model during update, the underlying JS has a string
for the data instead of a number
type. This points to something on the application's side doing this. When I created some tests in QuickTest.fsx, I could see the data being a number properly. This is where I got confused.
To see if you're seeing what I am, try using the devtools w/ the navigation demo and hit set a breakpoint in the update fn. In the JS side you should see model.page.data as a string
from elmish.
@et1975 Whew! Finally got to the bottom of this. So the problem is with how we're composing int >> Ok
in https://github.com/fable-compiler/fable-elmish/blob/master/src/elmish-browser/parser.fs#L80
I'm not sure if the bug is with the int
or >>
, but that combination causes the Result
union's JS object's data
field to be given data of type string
instead of number
. I created fable-compiler/Fable#798 to track.
As a workaround, we could change int
to System.Int32.Parse
or just wait for a fix for the issue.
from elmish.
Related Issues (20)
- Subscribe to DOM events via `Program.withSubscription` HOT 2
- How to pass an external event into a program? HOT 30
- Zaid's fromAsync Cmd HOT 3
- Ability to stop subscriptions HOT 9
- Cmd helpers for checking success by option HOT 4
- Double subscribe when dispatching during sub startup
- None of the duplicate subscriptions should be started HOT 12
- Subscription doc updates for v4
- Is there an expected time to get to a stable version of v4 HOT 2
- Elmish for WebSharper apps HOT 4
- Question about FSharp.Core version HOT 4
- Cmd.OfFunc.whatever HOT 9
- Docs: String.replicate piece raises an exception HOT 1
- Remove redundant Subscription trace logs HOT 6
- Replacement with ofEffect for ofSub not working as in v3? HOT 3
- Proposal: port Elm's virtual dom to work with Feliz HOT 4
- [Question] Elmish way of disposing component dependencies HOT 1
- Suggestion: Cmd.OfTask.attempt with untyped Task HOT 1
- How to dispose of `Cmd.ofEffect` events handler? HOT 2
- FuncUI TextBox.onTextChange issues HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmish.