Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
defx
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
defx
6y ago
Thank you, much appreciated. Yes, there are proposals for native templating, but i suspect it will take some time to agree on such things. I opted for comments in the end mainly to support multiple top level nodes, but they also prove help
32.
▲
by
defx
6y ago
RE docs: Yes absolutely! The next section in the docs will be tutorials and all of this great feedback will be most useful in helping figure out what to focus on so thanks again.
33.
▲
by
defx
6y ago
see the comment above "RE: #" concerning the index. synergy doesn't provide means for you to pass custom arguments into the event handlers, but the event target and the datum provide context of the loop and the handlers "
34.
▲
by
defx
6y ago
RE css-in-js style encapsulation: One of my goals was to support pre-rendering, which is why Synergy doesn't currently use Shadow DOM. In the (hopefully near) future, Shadow DOM will become declarative and at that point Synergy will ad
35.
▲
by
defx
6y ago
RE separation of concerns: Glad you like it, and yeah - the react approach is very popular so this won't suit everybody, but that's fine...people have different styles and I don't believe there's a one "right"
36.
▲
by
defx
6y ago
RE prerendering: yes, completely agree - puppeteer would certainly be heavy for dynamic SSR and I wouldn't suggest that. Perfectly suitable for build-time prerendering though, which is what I've been focused on so far in this area
37.
▲
by
defx
6y ago
Re the '#', yes - this is currently a limitation and will be addressed, most likely with destructuring syntax for the repeated block declaration (e.g., #each [i, item] in items)
38.
▲
by
defx
6y ago
RE the event signature: (If you raise an event from an item within a repeated block then synergy provides the data for that item as the second argument to your event handler function.) If you have a nested loop then you'll get the data
39.
▲
by
defx
6y ago
Firstly, thank you so much, this kind of feedback is extremely useful and greatly appreciated. I'll try to reply separately to each of your points for clarity...
40.
▲
by
defx
6y ago
Yes, you can prerender in a browser (e.g., using Puppeteer) or provide a synthetic DOM (e.g., JSDOM) in Node. It's the next thing on my list to flesh out some more detail in the docs around this.
41.
▲
by
defx
6y ago
Thanks, marketing certainly isn't my greatest strength and things can always be read in more than one way so I will keep that in mind.
42.
▲
by
defx
6y ago
Thanks, glad that you like it, and I love the fact that Yama "fits in a Commodore 16"...
43.
▲
by
defx
6y ago
Preact is a really great project! I contributed to this myself in a very small way last year to add support for customised built-in elements. I would definitely recommend Preact if you're a fan of React. Synergy is different in a few w
44.
▲
by
defx
6y ago
Thanks so much for your comment, much appreciated.
45.
▲
by
defx
6y ago
Thanks for your question. I'm not overly familiar with Alpine but yes, the syntax is very different. Alpine appears to freely mix JS and HTML whereas Synergy minimises this in favour of a clearer separation of concerns.
46.
▲
by
defx
6y ago
Here's a rough video demo showing a simple "hello world" component: https://www.loom.com/share/ffe3fb6d23264cc7ad458f6b856ddc49
47.
▲
by
defx
6y ago
Thanks for the comment, I hope you get a chance to try it out!
48.
▲
Show HN: I built a 4kb alternative to React, Vue, etc for building web UIs.
(synergyjs.org)
343 points
by
defx
6y ago
|
162 comments
49.
▲
by
defx
6y ago
Synergy is my attempt to create the thinnest possible layer of abstraction over the browsers built-in APIs in order to build UIs with Custom Elements. I wanted to be able to express UIs in simpler terms, and I feel like I've achieved w