by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 03 18:28

    nebrelbug on gh-pages

    docs(docs): update gh-pages (compare)

  • Aug 03 18:25

    nebrelbug on npm_and_yarn

    (compare)

  • Aug 03 18:25

    nebrelbug on master

    Bump elliptic from 6.5.2 to 6.5… Merge pull request #197 from sq… (compare)

  • Aug 03 18:25
    nebrelbug closed #197
  • Jul 30 15:30
    dependabot[bot] labeled #197
  • Jul 30 15:30
    dependabot[bot] opened #197
  • Jul 30 15:30

    dependabot[bot] on npm_and_yarn

    Bump elliptic from 6.5.2 to 6.5… (compare)

  • Jul 26 06:31
    VictorAyalaMX commented #192
  • Jul 26 06:24
    VictorAyalaMX commented #192
  • Jul 18 02:41
    vinothbabu commented on 0d647a1
  • Jul 06 14:26

    nebrelbug on gh-pages

    docs(docs): update gh-pages (compare)

  • Jul 06 14:24

    nebrelbug on master

    Add Cypress to list of projects… (compare)

  • Jul 04 01:36
    nebrelbug commented #196
  • Jul 04 01:10

    nebrelbug on gh-pages

    docs(docs): update gh-pages (compare)

  • Jul 04 01:08

    nebrelbug on v8.0.3

    (compare)

  • Jul 04 01:08

    nebrelbug on master

    Update README - add note about … v8.0.3 (compare)

  • Jun 22 16:51
    vinothbabu commented #195
  • Jun 21 00:03
    nebrelbug commented #195
  • Jun 21 00:02

    nebrelbug on gh-pages

    docs(docs): update gh-pages (compare)

  • Jun 21 00:01

    nebrelbug on gh-pages

    docs(docs): update gh-pages (compare)

Ben Gubler
@nebrelbug
Any opinions on this?
Mike Dalrymple
@mousedownmike
I find the tilde difficult to distinguish from a hyphen... in Go {{- removes whitespace in a template. So... as a sampling of 1, I agree with your intuition to change it to @.
Ben Gubler
@nebrelbug
:thumbsup:
Ben Gubler
@nebrelbug
@/all as a warning, the next Beta release will contain a breaking change: helpers will be prefixed by @ instead of by ~ by default.
Prefixes will be customizable in the coming release, but after a lot of consideration I decided @ would be better as a default prefix.
Mike Dalrymple
@mousedownmike
@nebrelbug I wrapped up my initial implementation using v8 last week. It's a pretty basic AWS Lambda function that uses Squirrelly to format messages generated by AWS Cognito. Super fast and so far... super reliable. Thanks!
Ben Gubler
@nebrelbug
@mousedownmike you're welcome! I'm glad you're enjoying using Squirrelly!
Don't Ask
@DontAskM8
Hi wanna ask how do i actually get the previous key of a loop
{{foreach(options.items)}}
    <tr>
        {{foreach(options.items[@key])}}
        <td>{{@../key}}</td>
        {{/foreach}}
    </tr>
{{/foreach}}
The above is just part of the code. Others are working fine and im getting TypeError: Cannot read property 'id' of undefined
John Jenkins
@johnjenkins
Hi there! Just wondering if there's a in built way of temporarily storing a local variable within the template or anything?
I want to sum the number of items in an array of objects. Thought about making a helper using reduce or whatever, but it would be so specific in this case that defining a helper seems over the top.
Is there a way I can temporarily store a count using ~each or something?
Thanks!
Ben Gubler
@nebrelbug
@johnjenkins sure! You should be able to do something like this:
{{js(var x = 0)/}}
{{foreach(options.obj) }}
hey
{{js(x += @this.length)/}}
{{/foreach}}
Note that x is a global variable, so it can only be accessed inside function parameters
John Jenkins
@johnjenkins
Great! Totally forgot to mention I'm using v8(!) but pointed me in the right direction.
I achieved what I needed to with {{ (it.appliedFilters.reduce(function(a, b) { return ... }, 0)) }}
Ben Gubler
@nebrelbug
@johnjenkins fantastic!

@DontAskM8 after doing some investigation, it looks like that's a bug in Squirrelly v7. Squirrelly looks back up the scope chain one too many times with scoped helper references. Squirrelly v7 doesn't have automated testing, and not many people use scoped helper references, so that must be how the bug wasn't noticed.

Unfortunately, I don't believe there's an easy way to fix the problem -- hundreds of templates use Squirrelly v7, and this would be a breaking change for people with scoped templates.

I would recommend just using Squirrelly v8 stable, which I will release later this week. It is more powerful, remains lightweight, and has automated testing and test coverage set up.
Don't Ask
@DontAskM8

I would recommend just using Squirrelly v8 stable, which I will release later this week. It is more powerful, remains lightweight, and has automated testing and test coverage set up.

Alright will update soon. Anyways found a workaround by using ids for loop. The documentation actually lacks this information and only found it in the comment section

Ben Gubler
@nebrelbug
@DontAskM8 I should have thought of that! Glad to hear you found a solution.
Ben Gubler
@nebrelbug
@/all I just released squirrelly@8.0.0-beta.11! Notably, it changes the helper prefix from ~ to @ and allows you to customize prefixes.
I'm planning to release stable sometime tomorrow! At this point, I feel that Squirrelly v8 is a good deal more functional and reliable than version 7, even if I do need to work more on the documentation.
Speaking of documentation, check out https://squirrelly.js.org -- the homepage got a refresh!
Ben Gubler
@nebrelbug
@/all after months of work, I just released Squirrelly 8.0.0 stable! :tada: :rocket: :tada:
tabarra
@tabarra
Beeeeen
why u no migration guide :sob:
Seriously, literally every tag changed
tabarra
@tabarra
All good tho :thumbsup:
crazy vscode regex replaces mostly worked
Ben Gubler
@nebrelbug

@tabarra oops, wish I'd thought of that!

Did you get everything working?

tabarra
@tabarra
Sure did :)
tabarra
@tabarra
But it would be good to add an simple migration guide
like a permutation table
example:
{{include("template")/}} -> {{@include("template", it)/}}
{{varname}} -> {{it.varname}}
{{each(options.somearray)}} -> {{@each(it.somearray) => val, key}}
this would reeeeally help the migration process
specially since there is no easy "here is what changed" list, and the releases changelog is kinda too big for us to read and keep track
Ben Gubler
@nebrelbug
@tabarra great idea! I'll try to get something like this up and running within the next couple of weeks :thumbsup:
masao soseki
@allgrowsm
@nebrelbug Hello there. Now I decided to use squirrely for my project.
Here I have question about usage.
Is following okay for the usage?
var myTemplate = '<p>My favorite template engine is {{it.favorite}}.</p>'
var data = {
favorite: 'Squirrelly'
}
var result = Sqrl.render(myTemplate, data)
var div = document.getElementById('test');
div.innerHTML += result;
Ben Gubler
@nebrelbug
@allgrowsm awesome! Your usage is exactly correct :tada:
masao soseki
@allgrowsm
@nebrelbug Thanks for your quick reply! Now I am using your great template engine for my project. It is very fast :)
masao soseki
@allgrowsm
@nebrelbug hello again. Dose it support like for loop?
for (i = 1 ; i <=5 ; i++)
{

}
Ben Gubler
@nebrelbug

@allgrowsm sure! Check out this simple template:

{{@each(Array(5)) => val, index}}
This is item {{index}}
{{/each}}

Though you could really easily just write a simple repeat helper

masao soseki
@allgrowsm
@nebrelbug Thanks for your help!
tmsnarr
@tmsnarr
I'm trying to use squirrelly with express. I set my view engine to squirrelly and I have a layout.squirrelly file and an index.squirrelly file that uses the layout. When I try to render index I get an error: "Could not fetch template layout". Can anyone help? Thanks!