Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Fluf22
@Fluf22
I was just watching this video https://www.youtube.com/watch?v=uNZnftSksYg about cycle.js
Thanks for it, that was very interesting
I know this is an old video, but at the end, Andre Staltz says that JSX is avoidable
I happen to do a lot of React and JSX, and I would like to know why he doesn't recommend JSX ?
Matthew Hayden
@mrehayden1
@Fluf22 I think he did a blog post about this
Fluf22
@Fluf22
Oh, okay
Looking for it
Matthew Hayden
@mrehayden1
scroll down for his comments on JSX
Fluf22
@Fluf22
Thanks a lot !
Matthew Hayden
@mrehayden1
If you use cycle/dom then you get hyperscript helpers exported for free, but in other settings they're not always available
Fluf22
@Fluf22
I'm watching videos from 2015 and reading twitter threads from 2018, and coming from 5 years of React xp, I feel like I'm finally making up for lost time
It's so interesting
Nikhil Tilwalli
@ntilwalli
@Fluff22 I'm in the process of migrating from @cycle/dom to @cycle/react + @cycle/react-dom. Thus far I like it. It has similar hyperscript-helpers. You get the best of both worlds imho, React's community and plethora of pre-built components + Cycle's elegant fractal sources/sinks architecture. :thumbsup:
Paul Snively
@paul-snively
That’s what I’m using, with Microsoft’s Fluent UI React components.
And strict mode and eslint’s functional plugin, so my code is constrained to be pure FRP.
Nikhil Tilwalli
@ntilwalli
Yeah, that's all good stuff.
In the 2015-era you had to choose between Cycle and React. Since 2018 I believe, you don't. They're completely compatible.
Paul Snively
@paul-snively
Yep. Such a relief.
Nikhil Tilwalli
@ntilwalli
yeah its nice
Jan van Brügge
@jvanbruegge
also makes it easier to introduce in client projects, because you say it is react with cycle instead of redux/mobx/whatever and that's usually fine
but suggest using anything other than react and people scream that they won't be able to find developers
PEZO
@ZoliPeto_twitter
What I am trying now is RN + Redux + Redux-cycles. That seems one level more accessible.
@jvanbruegge @staltz is there a standard way to normalize data in cycle like https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape ? If there is not what is your solution for it?
Jan van Brügge
@jvanbruegge
i have shared data on the lowest common level and then propagate it with lenses
PEZO
@ZoliPeto_twitter
Thanks! Wdyt about state normalizing like https://www.npmjs.com/package/normalize-ts ?
Jan van Brügge
@jvanbruegge
simply not needed IMO
PEZO
@ZoliPeto_twitter
Thanks.
David Skuza
@davidskuza
Hello everybody :)
Does anybody know if current version of cycle/dom works with TS 4? Or rather if it does not
Jan van Brügge
@jvanbruegge
it should work
PEZO
@ZoliPeto_twitter
Can anyone show me real world uses of Time.diagrams in tests? I really do like the idea, but I fint it hard to read and write more complex tests of main functions eg. with assertions on State as well, am I misusing it? If its only for less complex cases then I see it’s point, but for longer integration test like use cases it seems to be cumbersome.
Matthew Hayden
@mrehayden1
I seem to remember a function that someone had developed that transformed streams of form inputs into useful streams, like validation errors etc
I find myself writing the same pattern over and over when doing forms, just wondered if anyone had developed some code to save time before I try to.
Géraud Henrion
@fuunnx
something like that ?
let formState$ = DOM.select('form').events('input')
  .fold(
    (state, event) => ({
      ...state, 
      [event.target.name]: event.target.value
    }), 
    {}
  )
with
let errors$ = formState$.map(validate)
Matthew Hayden
@mrehayden1
I guess that gets rid of a lot of boilerplate!
Géraud Henrion
@fuunnx
:)
Matthew Hayden
@mrehayden1
I wonder how much further it could we taken and still be useful? Maybe it could return stream that only returns a submission when there are no validation errors. Maybe it could be a component that submits to HTTP endpoint and merges in the server side errors.
Instead of collecting up the inputs like you did, I tend to serialize the form object on the submit event.
Géraud Henrion
@fuunnx
probably yes, depending on your needs
Matthew Hayden
@mrehayden1
I've noticed a slightly odd thing with cycle state and switching components. The state stream won't produce in an isolated component unless there is an explicit lens set.
Judson Lester
@nyarly
I just spun up a one-fits-all app, and npm start fails with ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.
Matthew Hayden
@mrehayden1

I just spun up a one-fits-all app, and npm start fails with ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.

I think you're possibly using webpack 5? I think I had the same issue. If not try the issues on the one-fits-all repo, I found the solution eventually.

Jan van Brügge
@jvanbruegge
yeah, the config was for webpack 4 and has not been updated
I plan to archive create-cycle-app because IMO a repository template would be a better and easier starting point (no magic)
Also unrelated: My blog post about by open source journey was published today: https://futurice.com/blog/my-open-source-journey
Matthew Hayden
@mrehayden1
Calling for more CVs for people interested in remote cycle.js work. Office hours are 9-5GMT.
DM me if interested.