Giter Site home page Giter Site logo

Comments (5)

ryansolid avatar ryansolid commented on April 28, 2024 2

JSX-Lite API was inspired by Solid mostly due to the fact that by identifying what was needed for reactive libraries you could serve both sides. You can sort of see a common API between it all that is what they are looking into. That being said I also think that's an ambitious task. In terms of being a generic base to unhinge from a particular library it does seem interesting and something others could embrace. But features would always differ, and even timing of similar looking primitives and update behavior. I've had many a conversations with it's creator about how to attack these problems. We had similar conversations in designing the latest Marko since one of it's goal is ultimately to produce multiple outputs like JSX-lite, just with a more expanded syntax.

As for the partial hydration story with Solid, honestly I just haven't gotten to it yet. I feel it's more important that I close the gap with Marko on the SSR parts first since it's also way ahead of the competition there as well. Solid's raw SSR rendering speed is already class leading and supports async streaming while rendering, but the route I went wasn't compatible with non-streaming and SSG so I have a different slower method that I want to replace before focusing here. I mean not that slow. It's similar to like Preact and React but it's no Marko.

I think there are likely concerns that go beyond the templating. By the same logic that says JSX isn't tied to a specific library it often means that any assumption that "it's just JSX" also isn't true and assumptions make the project tied to a specific library. I can picture something like a HOC or configuration be an easy solution for something like Solid with partial hydration (although obviously I was looking more at Marko for what the long term solution would look like), but I imagine it wouldn't be identical to Preact. And I think reactive libraries are a bit harder to hide. They come off a bit more opinionated about how you handle the non-JSX parts.

However, I also haven't looked at this project very deeply as of yet. I'm familiar with how Marko's compiler is used to achieve partial hydration but not how this project works. I will say this though. If you are just hunting size I think Preact is small and the difference we are talking about is probably not that big of a deal. There is performance potential but I don't know how important it is. I find a project like this interesting, and I think Preact is a good choice for it. I'd be willing to spend some time to understand what is going on to see if there is potential here for other libraries but if the goal isn't to try to support multiple targets it is probably good to just stick with one and go with that. There is definite complexity there. And Preact is plenty good for this use case.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024 1

@ryansolid thanks for weighing in! Having looked into your take on the other tech discussed, I think this is pretty close to what I expected.

I think I’ll wait for @natemoo-re on whether other targets are a consideration before I say more on that. But I guess I should clarify my use case/user story so at least we’re all discussing the same thing.

As an @eyelidlessness, I want to build mostly but not totally static websites (or even very dynamic websites with substantial static content), with minimal data and runtime sent to the client (I am not satisfied with NextJS style solutions where I send giant blog posts in HTML and in a big JSON blob to “hydrate” content that will never change). I want to build components (because I believe they’re a great way to achieve modular/reusable rendering) and I want to use JSX to express the render (because it’s an expressive and flexible data structure with lots of opportunities to determine render strategies per component). I want an efficient client runtime with good performance characteristics (although to paraphrase Ryan’s take, I’m not overly concerned about squeezing every last bit, Preact very well might be good enough for this). I want to accomplish this without a ton of conflicting tools and configurations, in a predictable way. I’m settled on manually marking things interactive but I have dreamy eyes about a compiler that does that for me with static analysis (see above RE: Marko). Basically I want a client side dev experience with a “you don’t need jQuery” user experience.

I hope the flow of consciousness is welcome.

from microsite.

natemoo-re avatar natemoo-re commented on April 28, 2024 1

Thanks for the thoughts, both of you! This is a really interesting discussion and I am totally here for it.

@eyelidlessness I think we have really similar ideas about what a tool for building interactive sites should look like! I'm not necessarily opposed to opening Microsite up to other compilation targets, but it does have the potential to add a lot of complexity. Like Ryan mentioned, every different library comes with its own set of approaches that would need to be smoothed over in some way. I'm honestly not sure where I'd start with that. The added codebase complexity to performance payoff might not be worth it.

I chose Preact primarily for its size but also familiarity for the many React devs out there. I think it fits Microsite's use case really well. I'm still focused on stabilizing Microsite and adding features, so I think this idea will have to go on the back burner for now. I'll be keeping an eye on JSX Lite and considering this target agnostic idea, though.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

And on that note, apologies to @natemoo-re for spamming your inbox this afternoon

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

My goodness could GitHub please figure out touch events? Sorry if I spammed anyone trying to see who thumb reacted what.

from microsite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.