These are chat archives for intellifactory/websharper.ui.next

24th
Aug 2015
Adam Granicz
@granicz
Aug 24 2015 07:38
hi folks
some updates
1) we are working on a new version of piglets that use ui.next - changes are rolled out today on a branch
2) new APIs are coming to deal with event handlers
recall, with the recent HTML revamp, event handlers are attached in attribute positions using on.click, etc.
the new APIs will enable adding event handlers in node positions as well, such as
let elt = div [...]
elt.OnClick (...)
similar to the old HTML client language
Jerold Haas
@jeroldhaas
Aug 24 2015 07:44
elt.OnClick(fun _ -> ...)?
Adam Granicz
@granicz
Aug 24 2015 07:44
something on that sort, yes
two args
Jerold Haas
@jeroldhaas
Aug 24 2015 07:47
cool. I'm doing an experiment to see if I can wire websharper into electron. I'd just grabbed UI.Next. Are all the namespaces obsoleted with the release of UI.Next?
I see Client, Server and Templating
Is UI.Next still somewhat compatible with the older WS libraries?
Adam Granicz
@granicz
Aug 24 2015 07:50
UI.Next is still an add-on, we have not obsoleted the old WebSharper.Html and WebSharper.Html.Client namespaces
compared to before, though, UI.Next can work with legacy markup as well
Jerold Haas
@jeroldhaas
Aug 24 2015 07:51
thanks for the information. I'm interested in seeing how this experiment turns out. it might be a neat way to build desktop apps :)
I might have to build a library to abstract some things to Electron, which could be a fsproject in itself if matured
Adam Granicz
@granicz
Aug 24 2015 07:52
yes, that's come up before - the reactive component in ui.next is a natural fit to model all sorts of UI things
you might want to take a look at piglets
Loïc Denuzière
@Tarmil
Aug 24 2015 07:54
"we have not obsoleted the old WebSharper.Html" -> not yet, but we intend to do so at some point
Adam Granicz
@granicz
Aug 24 2015 07:54
well, certainly before 4.0
or to be more exact, by then for sure
Loïc Denuzière
@Tarmil
Aug 24 2015 07:55
yes, before or at 4.0
Jerold Haas
@jeroldhaas
Aug 24 2015 08:01
my concern right now is how to send the generated files to Electron as it appears to use file:// by default
not sure if I can get a duplex connection from file:// yet, I've never tried
I'll look into piglets, thanks. :)
Adam Granicz
@granicz
Aug 24 2015 08:08
you mean the page links are file:// ? or the dependency URLs?
neither should be, unless you are serving out of the file system
dependencies can update how they want to be served
can you describe your use case a bit?
Loïc Denuzière
@Tarmil
Aug 24 2015 08:14
Electron is the node-based gui system that is used by Atom and VS Code
so I guess Electron windows are displayed from file:// pages
Adam Granicz
@granicz
Aug 24 2015 08:24
sure, so what? :)
Jerold Haas
@jeroldhaas
Aug 24 2015 08:36
the full UI is loaded from file://
I'll have to suss out how to manage I/O
Adam Granicz
@granicz
Aug 24 2015 08:40
surely, they must have an API for it, no?
Jerold Haas
@jeroldhaas
Aug 24 2015 09:24
mainWindow.loadUrl('file://' + __dirname + '/app/index.html'); as example
so, yes, an API but I'm not sure how extensive; Atom has a lofty scaffolding above the Electron core
Adam Granicz
@granicz
Aug 24 2015 09:25
how are source files loaded in an editor tab?
Jerold Haas
@jeroldhaas
Aug 24 2015 16:04
source files are div.htmlText etc.