These are chat archives for ractivejs/ractive

19th
Jan 2018
Chris Reeves
@evs-chris
Jan 19 2018 00:00
The npm-local module is read only, though it will sync with an upstream repo is network is available
Joseph
@fskreuz
Jan 19 2018 02:34
This one looks promising. Might cure npm publish fears. :D https://github.com/verdaccio/verdaccio
If it works the way I think it works, it would also be good for testing CI scripts locally.
Chris Reeves
@evs-chris
Jan 19 2018 02:36
that would be nice... they're a pita to figure out, but we're low enough traffic that no one hits me when I force push 😁
Joseph
@fskreuz
Jan 19 2018 02:40
lol :D
Dayton
@daytonlowell
Jan 19 2018 03:30

Is it possible, with Ractive, to have a component get initialized with a copy of data given by a parent but not have it two-way bound to the parent?

I can make the component be initialized with data from the parent. And I can disable two-way binding in the component, but I actually want the component to have two-way binding, just not bound back to the parent.
so in a parent like

<component someInitalData="{{fromTheParent}}"></component>

and in the component like

<input value="{{someInitalData.foo}}"/>
<input value="{{someInitalData.bar}}"/>
<input value="{{someInitalData.baz}}"/>

and I'd be able to change any of those inputs and calling

ractive.get('someInitalData')

within the component and parent would return different values. do I just have to do

 ractive.set('someCopyOfInitialData', ractive.get('someInitalData'))

in oninit? that feels weird.

Chris Reeves
@evs-chris
Jan 19 2018 03:33
You can use static delimiters (default [[ ]]) in the mapping, but note that you're passing an object, which means modifying a property will affect the source too.
It just won't immediately be reflected in the parent because there's no link on the ractive side.
Dayton
@daytonlowell
Jan 19 2018 03:36
Thanks @evs-chris
Chris Reeves
@evs-chris
Jan 19 2018 03:36
A safer thing to do may be to add a clone method in the parent or in defaults that does an object assign or a deep clone (lodash?) if necessary e.g. <cmp thing="{{clone(from parent)}}" />
computations like that will never create a mapping because they're read only
Cerem Cem ASLAN
@ceremcem
Jan 19 2018 16:30
@fskreuz I'm also glad to see many issues, it feels that people are warming up with Ractive :tada:
Paul Maly
@PaulMaly_twitter
Jan 19 2018 17:25
Hi all. I handle submti-event like this: on-submit="@.someMethod()" but html form submits in regular way. ??
Chris Reeves
@evs-chris
Jan 19 2018 17:26
return false from someMethod or throw a , false in your listener
that will cancel the dom event
Paul Maly
@PaulMaly_twitter
Jan 19 2018 17:27
ok, seems I forgot about it
thanks!
Chris Reeves
@evs-chris
Jan 19 2018 17:30
yeah, not much love outside of the big three
Joseph
@fskreuz
Jan 19 2018 18:10
I'd like to think those higher up in the list just have better PR and are more hyped. :D
Chris Reeves
@evs-chris
Jan 19 2018 18:18
react and angular certainly have bigger budgets
Joseph
@fskreuz
Jan 19 2018 18:20
And an army of developers and evangelists...
Reminds me of WebKit and how most if its development is done by Apple developers. It's practically Safari with a non-safari name and without Apple's secret sauce. :D
Paul Maly
@PaulMaly_twitter
Jan 19 2018 18:24
@fskreuz agree, Ractive is the best!)))
Joseph
@fskreuz
Jan 19 2018 18:25
:+1:
Paul Maly
@PaulMaly_twitter
Jan 19 2018 18:27
@evs-chris @fskreuz About my RFCs...so, my PRs won't be accepted?
Joseph
@fskreuz
Jan 19 2018 18:29
I usually prefer PRs come with unit tests just to be on the safe side.
Unit tests also double as code documentation and aids in writing documentation. If a commit doesn't come with a test, we cannot infer what the commit was fixing, or what the change was for.
Paul Maly
@PaulMaly_twitter
Jan 19 2018 18:31
I'm talking about RFCs, not that PR you think about
Joseph
@fskreuz
Jan 19 2018 18:31

so, my PRs won't be accepted?

You did ask about the PRs :grin:

re: RFCs, I'd say let it soak for a week or two to let other eyes see the discussion.
Chris Reeves
@evs-chris
Jan 19 2018 18:36
I think both of your RFCs are things that need to happen
Joseph
@fskreuz
Jan 19 2018 18:37
I'd like to believe we have lurkers in our repo (people who simply view without interacting). And with the right push, like say a lengthy discussion covering all corners, they'll jump in and comment. :D
Paul Maly
@PaulMaly_twitter
Jan 19 2018 18:37
@fskreuz yea, sorry, a little bit cofusing
I mean that I could provide PRs for these RFCs, but it's doesn't make sense if they won't be accepted
Chris Reeves
@evs-chris
Jan 19 2018 18:39
I need to find a bit of time to think through them a bit more too
Paul Maly
@PaulMaly_twitter
Jan 19 2018 18:43
@evs-chris @fskreuz sure, make sense. Leave a comments when you'll be ready to continue discussion.
Joseph
@fskreuz
Jan 19 2018 18:53

If in doubt, submit the PR. A PR that needs tweaking is infinitely more valuable than a request that wasn't made. Other Ractive developers will help you refine your pull request.

https://github.com/ractivejs/ractive/blob/dev/CONTRIBUTING.md#pull-requests

Joseph
@fskreuz
Jan 19 2018 19:20
Also applies to issues/feature requests/questions/etc. by the way.
Paul Maly
@PaulMaly_twitter
Jan 19 2018 20:38
Yep, but as far as I know, many PRs in open-source aren't accepting by maintainers. I would like to do a PR when I would be sure that a question only in readiness of a code, but not conceptual things.