Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 21:51

    evs-chris on dev

    safer, though maybe slightly le… minifiable undefineds (compare)

  • Jan 30 2019 20:04
    RustyDev starred ractivejs/ractive
  • Jan 30 2019 10:40

    evs-chris on dev

    fix parent context of component… (compare)

  • Jan 29 2019 08:44
    dashiwa starred ractivejs/ractive
  • Jan 28 2019 21:47

    evs-chris on dev

    fix shuffling when more than on… shuffling binding mystery bug t… don't shuffle an autoshuffling … (compare)

  • Jan 28 2019 19:29
    aligoren starred ractivejs/ractive
  • Jan 28 2019 15:30
    meetajhu starred ractivejs/ractive
  • Jan 27 2019 23:18
    4lm starred ractivejs/ractive
  • Jan 26 2019 10:22
    meetajhu starred ractivejs/ractive
  • Jan 25 2019 22:25

    evs-chris on dev

    fix a few corner cases on autom… (compare)

  • Jan 25 2019 06:22

    evs-chris on dev

    add support for automatically l… (compare)

  • Jan 23 2019 16:37
    frncsdrk starred ractivejs/ractive
  • Jan 20 2019 12:44
    0851 starred ractivejs/ractive
  • Jan 15 2019 15:40
    dagnelies closed #3292
  • Jan 15 2019 15:40
    dagnelies commented #3292
  • Jan 15 2019 15:34
    evs-chris commented #3292
  • Jan 15 2019 15:34
    evs-chris commented #3292
  • Jan 15 2019 15:29
    dagnelies commented #3292
  • Jan 15 2019 15:29
    dagnelies commented #3292
  • Jan 15 2019 15:26
    evs-chris commented #3292
Chris Reeves
@evs-chris
@daytonlowell yes, if mySweetButton has an attributes set, which can be empty
Dayton Lowell
@daytonlowell
Right, thanks.
Dayton Lowell
@daytonlowell
Does extra-attributes work for on-* directives as well?
Dayton Lowell
@daytonlowell
or really, does it work with all directives?
Chris Reeves
@evs-chris
it works with everything except events, because events have a slightly different meaning for components vs elements
it also doesn't work for binding attributes like twoway and lazy
for events, I usually surface everything I think we'll be relevant inside the component or macro and leave it up to the use site which ones are consumed
Dayton Lowell
@daytonlowell
Gotcha. Also, if I have a component that consumes another component, can I use extra-attributes to pass attributes through to the child component too?
Chris Reeves
@evs-chris
I've never tried it, but I think you could.
Dayton Lowell
@daytonlowell
Follow up: it totally works. that's pretty nice when you want to essentially subclass an existing component easily while exposing most of the original underlying component to the consumer.
Norbert Haberl
@nhaberl
Hi guys, we are using ractified views and I wanna wrap this into a decorator (list.js)
We see that the whole code / events are not working when we have wrapped into the decorator ...
Dayton Lowell
@daytonlowell
Chris Reeves
@evs-chris
huh, looks like it is
I just merged a doc fix, so maybe the deploy is busted
I'll poke around a bit
Chris Reeves
@evs-chris
really not sure what's up here, as https://ractivejs.github.io is still available
Dayton Lowell
@daytonlowell
I get a 404 on that one as well
Chris Reeves
@evs-chris
I think js.org is not pointing quite right
the gh pages site is trying to redirect there atm too
gh pages seems to be having some weirdness in general
Chris Reeves
@evs-chris
looks like it'
s back
I guess that's the downside of depending on other services... you don't have to maintain them, but when something breaks, there's almost nothing you can do
Dayton Lowell
@daytonlowell
Yeah, it's all good.
Deeptanshu-Sarkar
@Deeptanshu-Sarkar
Hey sooo, if I wanted to suggest a change to the website tutorial page (https://ractive.js.org/tutorials/hello-world/), where would I do it?
Deeptanshu-Sarkar
@Deeptanshu-Sarkar
I mean in the javascript code. In step 3, the three "run it" buttons change the output in the playground. When the third button is clicked, it changes the name and greeting to mandarin, when the second button is clicked, it should just change the name, however, it changes the greeting as well. Same for the first button. I think it would be better if they just changed what they should change.
paulie4
@paulie4
It looks like the JavaScript that actually gets run is in the data-eval attribute. For example, just above the ractive.set('name', 'tout le monde'); in hello-world.md there's "E4QwxgLglgbgpgOgM5wgCgOQHNh1VAOywwBoACDAIQHsCAragV2AwEoBuAKFElkRXQYCIALZxSFCEwhkANnDIjaAE3EcgA", which lzString.decompressFromEncodedURIComponent() returns as "ractive.set('greeting', 'Bonjour');\nractive.set('name', 'tout le monde');". Unfortunately, just changing that data-eval attribute to have this: E4QwxgLglgbgpgOgM5wgCgOQDsQFs4YA0ABBhAPYCuExANnMbuVgCYECUA3EA (for it to only change the name and not the greeting) is not sufficient, since it looks like the data-runtutorial attribute is used to reset the whole playground, so then the output becomes Hello, tout le monde!, which is also not what we want. I don't know the right way to fix this.
Chris Reeves
@evs-chris
yeah, unfortunately each step of the tutorial runs the entire playground because there's not always a way to interact with the instance in the playground and the goal is to have each stage be consistent with the flow of the tutorial
Deeptanshu-Sarkar
@Deeptanshu-Sarkar
Ahh ok. Thanks for the explanation
Dayton Lowell
@daytonlowell
Yay, 1.4.0!
Chris Reeves
@evs-chris
yep, it was time
Dayton Lowell
@daytonlowell
It's got a couple things I requested. So I appreciate it.
Dayton Lowell
@daytonlowell
@evs-chris When you use rollup-plugin-ractive-bin, do you ignore your .views/**? If I ignore it, the final output build doesn't have the change. But if I don't ignore it, I see the Rollup build run twice(using watch).
plugin config is essentially
        ractive({
            outputExtension: '.ts',
            autoExport: true,
            outputDir: './client/.views/',
        }),
        typescript({
            tsconfig: './client/tsconfig.json',
        }),
Chris Reeves
@evs-chris
no, I don't ignore it, but it seems to do a double rollup about 30% of the time
for most projects, I have a separate view watcher based on nodemon that runs the ractive bin in incremental mode and dumps output into a dir that rollup is watching
Chris Reeves
@evs-chris
I started a gh discussion on it with my watch helper here: https://github.com/ractivejs/ractive/discussions/3405
it's a bit more involved than I'd like it to be, but it works well enough
Dayton Lowell
@daytonlowell

Is it possible to iterate a JS Map in a template? I tried using the section syntax like I do for objects

{{#myMap:key}}
<option value="{{key}}">{{this}}</option>
{{/}}

but it didn't render those option elements

the keys and values are both strings, so I don't need to use a JS Map here, but I was mostly curious.
Chris Reeves
@evs-chris
there's not, but there's probably no reason that it couldn't... it's mostly just that Maps are new enough that they'll require feature detection to avoid blowing up on some older, mostly still supported platforms
Dayton Lowell
@daytonlowell
I haven't looked at the template parsing code, but since typeof for Map returns 'object', a for...in loop would work. Which is why I thought it might "just work".
Dayton Lowell
@daytonlowell
I guess if you want to be able to call Map instance methods in the template, you'll have to do some checking like you mentioned.
Dayton Lowell
@daytonlowell
Does Ractive have a supported way to get just the extra-attributes as an object?
Here's an example:
<sweetComponent
    foo="hello"
    bar="world"
    baz="i am extra"
    qux="also extra"
></sweetComponent>
const sweetComponent = Ractive.extend({
    isolated: true,
        attributes: {
        required: [ 'foo', 'bar' ],
        optional: [],
    },
    oninit() {
        // can i get *just* extra-attributes some how?:
        //{ baz: 'i am extra', qux: 'also extra' }
    },
})
If not I think I can just do mapAll as true on the attributes and then filter off all of the explicitly required or optional ones.
Chris Reeves
@evs-chris
it's just a partial, so you can grab it off the instance
Dayton Lowell
@daytonlowell
Ah, right, of course. Thanks Chris.
Chris Reeves
@evs-chris
you're welcome, and sorry my response times here are awful - gitter still only notifies me by email an hour after someone sends a message
Dayton Lowell
@daytonlowell
So apparently Ractive has a bind- shorthand where you can do bind-foo instead of bind-foo=foo which is pretty awesome.
How very Svelte of it.
Chris Reeves
@evs-chris
yep, I think that was lifted from pre-1.0 svelte
Norbert Haberl
@nhaberl
Are there any release notes for 1.4 anywhere ?