Giter Site home page Giter Site logo

Comments (17)

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

šŸŽ‰ examples.microsite.page is live! I'm going to leave this issue open until #94 is merged into main, but the examples are working and setup with Vercel's CI.

from microsite.

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

@eyelidlessness Thanks! I actually got these examples mostly working tonight... Need to fix a few things on the deployment side but that should be fairly quick to do tomorrow.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024 2

@natemoo-re Awesome!!

I will say and I hope Iā€™m not being too intrusive, this is why I put so much effort into testing before trying to dig into fixes. Iā€™ve been super worried about breaking stuff but a good or even growing test suite could help alert me before Iā€™ve done something unsuspecting. I know you know this but Iā€™m mentioning it here because I want to double down on my intention to contribute and to be sure Iā€™m not breaking some other poor soulā€™s site

from microsite.

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

@eyelidlessness not being intrusive at all! The help is so appreciated! I'm hoping to wrap up the testing piece by the weekend so we can move a little faster without the fear of breaking everything.

from microsite.

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

I pushed a number of changes in #94 to fix the examplesā€”the examples themselves seem to be broken at the moment, but I'm investigating that. But the build process is all fixed and will live on https://examples.microsite.page soon!

from microsite.

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

I have been meaning to look into doing full document mount with noop components! I think that would be the next technique to explore, which would hopefully add back full support for context Providers.

The Fragment thing actually turned out to be a quick fix, with some help from the Preact team!

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

@natemoo-re Iā€™ve looked into this but if youā€™re gonna get to it before me, I have a few observations:

  • None of the sites build without lerna hoist; side note Iā€™ll look at PNPM or otherwise recommend a Yarn solution after all because yarn with workspaces configuration definitely doesnā€™t muck this up.

  • That said the hoist behavior is generally not good to rely on and shared dependencies may be better off optional/peer.

  • The Tailwind example is missing a PostCSS dependency and fails no matter what.

I wanted to look into this deeper today but I was still trying to land my first site build. Iā€™ll look as soon as I can but wanted to share what Iā€™ve seen.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

Oof I forgot to mention the most important local debugging thing: lerna too often fails with a success exit, and swallows error logs. I tack on a --stream flag on every lerna command to ensure I see everything. Otherwise building the examples locally (for example) fails with no error

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

@natemoo-re oh that would be so great! For what itā€™s worth Iā€™m a breath away from putting a little teaser up on my site and Iā€™m gonna shout out this project for helping me get it built. Iā€™m really hoping I can get it there tomorrow.

from microsite.

akellbl4 avatar akellbl4 commented on April 28, 2024

@natemoo-re thank you! I love the idea of the project because I've been carrying the same idea for a few years :)
I haven't started to dig into the problem deeper because haven't found any contribution recommendations. I would like to help but don't know how it works for this project :)
It could be great to have any kind of manual for new folk who want help.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

@natemoo-re nice to see them back up!

I hate to be the bearer of bad news, but the partial hydration example seems to have the same affliction I experienced yesterday: flaky hydration. ā˜¹ļø

Iā€™m not sure what was the culprit for me but I experienced it moving from my spike project into my main site. The solve for me was to literally copy over my lockfile and reinstall. But this does mean thereā€™s some dependency with unexpected breaking changes.

from microsite.

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

@eyelidlessness Yep, I saw that. The culprit seems to be some tweaks to hydration logic in [email protected] and up. I pinned Microsite's version of preact to exactly [email protected] in v1.1.0-next.5, so make your lockfiles are fresh.

Also reached out on the Preact Slack for some help to see if it's a regression or Microsite needs to update some logic.

To be fair, Microsite's hydration logic uses an interesting technique to support mounting components with Fragment roots, which I imagine is fairly uncommon.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

Yeah I definitely imagine Microsite being subject to more unexpected breaking changes than youā€™d normally expect. Iā€™m glad you identified the problem!

Interestingly what I saw on my site is slightly different:

  • hydrating on idle consistently caused the component to mount as expected and then immediately unmount (which I see at least on mobile for either hydration case on your example)

  • hydrating on visible caused hydration to sometimes not occur at all/immediately unmount, sometimes occur adjacent to the server rendered node, and sometimes function normally

I strongly suspect thereā€™s some timing factor involved here. But I was in build mode so I didnā€™t get hung up on it once I brute forced a fix

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

To be fair, Microsite's hydration logic uses an interesting technique to support mounting components with Fragment roots, which I imagine is fairly uncommon.

Before I found Microsite and was considering other solutions or even just rolling my own, I was thinking about going with a full document mount but substituting static components with a noop with shouldComponentUpdate always returning false. I have no idea if it would work but if it did it might be more reliable than fragment mounts (which I super appreciate because they donā€™t break styles the way other hydration marker approaches do).

Another harebrained scheme I considered was rendering all hydrated components as custom elements (and even just using that as the distinction between static/interactive), which also might be a possible mount point.

Not trying to monkeywrench whatā€™s already working if the current approach is easy to fix with the Preact update but thought this would be a good place to drop those thoughts in case theyā€™re helpful.

from microsite.

eyelidlessness avatar eyelidlessness commented on April 28, 2024

which would hopefully add back full support for context Providers

Iā€™m assuming this is because thereā€™s multiple mount points? Iā€™ve also thought this might be solvable with one full page noop and Portals, but every time I go read the docs I get hung up on the DOM nonsense and bail.

from microsite.

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

Right, multiple mount points means there are multiple instances of Preact running. Each hydration point is its own app. While Providers technically work, they don't stay in sync across Preact instances for obvious reasons.

from microsite.

thapecroth avatar thapecroth commented on April 28, 2024

Hi, I tried to use it with the current version and it's working. Will, there be an example for current version?

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.