Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
defx
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
defx
6y ago
Hi mjgoeke, an update RE the "hack of using #each", synergy is now using <template each="item in items"> since v2 ( https://synergyjs.org/repeated-blocks ). Much less hacky, and has also saved a few
2.
▲
by
defx
6y ago
Fair comment. Approach to repeated blocks is something I wasn't sure about, but synergy is now using <template> since v2.* ( https://synergyjs.org/repeated-blocks ) so no more pseudolang ;)
3.
▲
by
defx
6y ago
Hi jeerovan, thanks for the questions. RE "minification": yes, - there's a minified version (terser) as part of the build and it should also be compatible with closure compiler. RE "performance", no I haven't
4.
▲
by
defx
6y ago
I haven't looked too closely at Lit source code recently so I couldn't really comment on that but, from a high level, they differ in the sense that lit uses render function (like react) that mixes HTML/JS whereas synergy sepa
5.
▲
by
defx
6y ago
Thanks farynaio, much appreciated.
6.
▲
by
defx
6y ago
Thanks for the kind words. I completely understand the cynicism, especially when it comes to the front end / javascript scene. I'm not entirely sure if the title I chose has helped or hindered more, but it has fuelled some discuss
7.
▲
by
defx
6y ago
Thanks karmasimida, you're right; synergy is in its infancy and it has zero ecosystem or community, so when I say "alternative" the context is purely limited to synergy being an alternative approach to building UIs, that'
8.
▲
by
defx
6y ago
Thanks Scotty, you communicated these ideas very clearly and this all makes perfect sense to me. One of my main goals with Synergy is simplicity, which in the context of this discussion would mean a lower level of configurability / cus
9.
▲
by
defx
6y ago
Hi lolive. In one sense, yes! Synergy and LitElement both seek to achieve the same primary goal, which is to make it easier to work with Custom Elements. Aside from that, the two projects are quite different in their approach.
10.
▲
by
defx
6y ago
Thanks for your question. Yes, that's correct - Synergy uses Proxy to detect change on the object and then simply walks the tree and updates the nodes whose bindings have changed. Yes there is some commonality with µce API due to imple
11.
▲
by
defx
6y ago
"There isn't a single solution to everything". Amen to that. Some libraries suit peoples ways of thinking more than others in the same way that some people like Java and others like LISP.
12.
▲
by
defx
6y ago
You are more than welcome and thanks for the words of encouragement imvetri!
13.
▲
by
defx
6y ago
RE "Also you might consider passing it not only into event handlers but all functions called from template": By design, there's no support for calling functions from templates other than via event handlers, or via getters ( h
14.
▲
by
defx
6y ago
Thanks Scotty, your feedback is greatly appreciated! Yes - with nested loops you simply get the datum for whichever block item raised the event, nested or not.
15.
▲
by
defx
6y ago
well, there's only one "synergy" that you can install from NPM, etc, but yeah - it's crazy that NPM site is working in that way because the other project has a project name that doesn't match its package name. I
16.
▲
by
defx
6y ago
I've seen that too, but there are also tons of projects that stay true to their original intentions and it wouldn't make sense (to me at least) to morph synergy into a "one size fits all" framework. It has a clear set of
17.
▲
by
defx
6y ago
Thanks for your interest Mizzao. Svelte is a cool project, and the discussion RE buildtime vs runtime raise some great questions RE trade-offs. What I would say is that neither project would be the right choice for every use case. Svelte is
18.
▲
by
defx
6y ago
Thanks for your comment. The synergy you're look at there appears to be "@onenexus/synergy" rather than "synergy". It's a shame that the comparison doesn't use the actual package name to avoid such am
19.
▲
by
defx
6y ago
That's right, you really have to do this for the love of it when nobody is paying your bills in return. Would love to hear how you get on with it if you do get a chance to try it out.
20.
▲
by
defx
6y ago
Thanks fergie, glad that you like the approach.
21.
▲
by
defx
6y ago
awesome, thanks! Would love to hear how you get on with it.
22.
▲
by
defx
6y ago
Apologies for the late reply, finally I had to get some sleep! No, you only get the datum for the loop from which the event is raised.
23.
▲
by
defx
6y ago
RE "browser support". Synergy has support for "modern" browsers (e.g., https://caniuse.com/mdn-javascript_builtins_proxy_proxy ). It would certainly be feasible to provide a legacy version to provide supp
24.
▲
by
defx
6y ago
Thanks for your questions. RE "no-JS", I have prioritised support for prerendering so that synergy can be used for progressive enhancement. Its early days so the docs are very minimal at the moment, but I will certainly be adding
25.
▲
by
defx
6y ago
thanks romwell, glad to hear that you like it!
26.
▲
by
defx
6y ago
awesome, thanks Xevi! would love to hear how you get if you do get around to that.
27.
▲
by
defx
6y ago
Thanks for the feedback. Yes, there's lots of work to do to make the docs "complete", not least some decent tutorials. It certainly isn't the "finished product" but I'm really glad that I decided to share
28.
▲
by
defx
6y ago
lol
29.
▲
by
defx
6y ago
Yes! That's definitely on the todo list and would be a welcome contribution.
30.
▲
by
defx
6y ago
RE: Would one extract .js scripts as modules to reuse custom components? Yes, you can certainly do that. the define function supports both template element nodes or strings, so you can work directly in a HTML document (the web will be getti
More ›