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)

lexeek
@lexeek
that was a problem
Alvin Halim
@alvinbillian

Hi there! Been loving SquirrellyJS so far, just got a question about whitespacing:

<td    {{if(options.bgcolor.value)}}
    bgcolor="{{bgcolor.value}}"
{{/if}}>

This will render as, given bgcolor.value is 'blue':

<td
    bgcolor="blue"
>

Which is pretty accurate, but is there a way to ignore the whitespaces/newlines in the {{if}} block? So it can render as:

<td bgcolor="blue">
Ben Gubler
@nebrelbug
Hi @alvinbillian! In Squirrelly v8 there is, but it's still in beta and missing a few features. In Squirrelly 7, the best thing would probably be to inline everything. So:
<td {{if(options.bgcolor.value)}}bgcolor="{{bgcolor.value}}"{{/if}}>
Alvin Halim
@alvinbillian
@nebrelbug ah got it, thanks! Looking forward for v8!
Ben Gubler
@nebrelbug

@/all just finished the 2nd beta of v8, which adds partials, Express support, and the groundwork for async support! https://github.com/squirrellyjs/squirrelly/releases/tag/v8.0.0-beta.1

Now all that's needed before a stable release is better handling of async stuff, better documentation, and layouts!

Ben Gubler
@nebrelbug
@clemlak would you mind sharing what work you have done on your syntax-highlighting?
Ben Gubler
@nebrelbug

@/all I'm pleased to announce that we've just been able to get template inheritance working!

Next Steps

  • Async helper and filter support in environments not supporting async/await
  • Update documentation

Additionally, super excited to announce that Squirrelly v8, based on benchmarks, appears to be very, very fast!

Ben Gubler
@nebrelbug

@msaus I was just looking at the Art-Template docs, and I realized that their benchmark only times how long it takes for a compiled function to execute, not how long the compilation itself takes!

Here are the benchmark results for compilation time (I had to locally clone and edit the docs):
Screenshot from 2020-02-17 11-42-42

masao soseki
@allgrowsm
@nebrelbug Great! It is incredible :)
Ben Gubler
@nebrelbug

@/all almost ready to publish a stable release...

https://squirrelly.js.org/blog/squirrelly-version-8

Ben Gubler
@nebrelbug
@/all here's a draft of the v8 docs: https://squirrelly.js.org/docs/next/get-started/overview
Sumit Kumar
@timuster
Hi all, does Squirrelly have an "else if" logic? In other words, while I do see "if / else", I'm wondering if I can do "If / else if / else". Thanks for all the great work btw!
Ben Gubler
@nebrelbug
Hi @timuster! Squirrelly v8 (still in beta) has else if support. Example:
{{~if(it.num === 3)}}
Display this
{{#elif(it.num === 4)}}
Display this instead
{{#else}}
Number isn't 3 or 4
{{/if}}
Sumit Kumar
@timuster
Awesome! Thanks so much, Ben!
Sumit Kumar
@timuster
I want to be able to use Squirrelly to render my template from my Node/Express app - however, this template would also need to use squirrelly to render content fetched from an Ajax call. Is there an elegant way of doing this?
Sumit Kumar
@timuster
The problem I'm running into of course is that Squirrelly overwrites the {{variables}} meant for client-side rendering as 'undefined'. I'd appreciate any help!
Sumit Kumar
@timuster
Figured it out - I just moved the client-side template to an independent JS file. :)
Ben Gubler
@nebrelbug
@timuster glad to hear you got it working! Let me know if you have any other questions :)
masao soseki
@allgrowsm
@nebrelbug Great :) You have elegant doc as well :)
Ben Gubler
@nebrelbug
@allgrowsm thanks!
@/all I just pushed my changes (rewriting async) to master, and I'm planning to publish a beta in the morning. After that, I don't think there's much that needs to be done: I'll probably ask for a little more user testing and then publish a stable release!
Ben Gubler
@nebrelbug

@/all Squirrelly 8.0.0-beta.9 is released! The API is probably pretty standard at this point, and I'd feel comfortable publishing. I haven't fully updated the documentation, but it can be found at https://squirrelly.js.org/docs/next/get-started/overview.

Note: the version 8 documentation is at /docs/next. The version number in the header won't change (it's an issue with Docusaurus) but as long as your URL has /docs/next/, you're viewing the v8 docs.

frankmono
@FrankMono
Hi! How can i get access to 'text' in inner array?
const options = {
    items: [
        {
            text: 'parentTEXT1',

            inner: [
                {
                    title: 'text1'
                },
                {
                    title: 'text2'
                },
                {
                    title: 'text3'
                }
            ],
        },
    ]
}

console.log(Sqrl.Render(`
    <div>
        {{each(options.items)}}
            <div>
                {{each(@this.inner)}}
                    <p>{{@this.title}} + {{@this.text}}</p>
                {{/each}}    
            </div>
        {{/each}}
    </div>
`, options))
Robert Ontiu
@robertontiu
Hello guys. I just discovered this and I have a quick question. Does this work in the browser without adding any nodejs dependencies to the bundle? Thanks
frankmono
@FrankMono
@robertontiu Yes, it works, i am use this library to render markup from ajax data
Ben Gubler
@nebrelbug
Hi @FrankMono! You should be able to change {{@this.text}} to {{@../this.text}} (to go up one level of scope). Let me know if this works!
@robertontiu yep! Confirming that both Squirrelly v7 and Squirrelly v8 have 0 dependencies, and don't require any extra configuration to run in the browser :)
Ben Gubler
@nebrelbug

@/all calling volunteers!

Squirrelly v8 is almost ready for a stable release :tada: :rocket:. I've updated the documentation website, and we're asking for volunteers to look through the docs and test Squirrelly v8 out.

Please spare even a few moments to help get Squirrelly v8 up and running! Your help is needed!
Note: helpers will be featured on the README
This message was deleted
Ben Gubler
@nebrelbug
A few quick notes:
  • I refactored https://squirrelly.js.org, so docs are no longer on the /docs/next path. Instead, they're at /docs/ and the v7 (old docs) are at /docs/v7/
  • When installing Squirrelly, you'll have to run npm install squirrelly@8.0.0-beta.9 or npm install squirrelly@beta
I'm excited to hear your feedback!
Sumit Kumar
@timuster

Running into an issue with the built-in JS helper and would appreciate a second pair of eyes to see if I'm doing something idiotic here -

I'm trying to create a RegEx inside a loop. However, it doesn't look like @this gets parsed properly

{{each(options.searchLabels)}}
{{js(options.temp1 =  /\+?@this/g)/}}

// The following line outputs /\+?hvals.this/g instead of the actual value
{{temp1}}   

// As a result of the above issue, my replace function doesn't work properly
{{js(options.newSearchPath = options.fullSearchPath.replace(options.temp1, ''))/}}

// I've also tried 
{{js(options.newSearchPath = options.fullSearchPath.replace(/\+?@this/g, ''))/}}

{{/each}}
Ben Gubler
@nebrelbug
Hi @timuster! Unfortunately, helper references will fail in RegExp literals. Try: {{js(options.temp1 = new RegExp("\\+?" + @this, 'g') )/}} and let me know if it fixes your problem?
Sumit Kumar
@timuster
@nebrelbug I found the 'Caveats' section in the docs right after I posted the message, but I HIGHLY appreciate your help here. Thank you so much for your efforts with Squirrelly and helping the community. It's now my go-to templating engine for all web projects! :) Have a great weekend!
Ben Gubler
@nebrelbug
@timuster thank you! You too!
frankmono
@FrankMono
@nebrelbug sorry but your solution not work. I am trying {{@../this.text}} and {{@../../this.text}}. my version is 7.9.2
Ben Gubler
@nebrelbug
Hi @FrankMono, that's a strange issue! I'll look into it this afternoon. In the meantime, would you be averse to using Squirrelly v8?
Here's what your template would look like with v8:
<div>
{{~each(it.items) => val}}
  <div>
  {{~each(val.inner) => innerVal}}
    <p>{{innerVal.title}} + {{val.text}}</p>
  {{/each}}
</div>
Kazumasan
@Kazumasan
hey how would you work with sqrl in a browser and is it possible to work with it in a .sqrl file extension like style ?
Ben Gubler
@nebrelbug
@Kazumasan to use Squirrelly in the browser, you'll first need to include the CDN:
<script src="https://unpkg.com/squirrelly@7"></script>
That makes Squirrelly available as the global variable Sqrl.
As far as working with .sqrl file extensions, it should be completely possible. Just use a JavaScript fetch() to fetch the file, then render it. Let me know if this works!
Kazumasan
@Kazumasan

it does work its however a relatively clunky way (i think) however i lack a better solution thanks!

would be nicer to include it like it would be a file in the file system but i know thats not possible.

Ben Gubler
@nebrelbug
@Kazumasan you could also rewrite the include nativeHelper to make the front-end less confusing...
Kazumasan
@Kazumasan
a native helper would be a smoother way maybe its something to add into squirrelly altogether i really like the project but i yet fail to find a streamlined workflow with it that provides good code structuring. Any suggestions ? And what do you think are the best use cases for squirrelly ?
Ben Gubler
@nebrelbug

@Kazumasan I think the best use cases for Squirrelly are where you have to generate static assets, static websites, make site layouts, etc. Ghost.org, for example, uses Handlebars in writing themes, which I think is a great example of a good use case.

As far as workflows, I don't know! You could look at popular projects which use template engines and see what their workflow looks like

Simon Fremaux
@dievardump
Hi :) is there any way to change this horrible ~ by an @ or anything else easier to type with only one hand on an azerty keyboard?
Ben Gubler
@nebrelbug

@dievardump that makes a lot of sense! I'll look into adding a feature for that this afternoon :)

I'm honestly tentatively considering switching it to an @ by default since I think it might look cleaner...

Kazumasan
@Kazumasan
opinion on scoped styles ?