4 ms·
This page talks a lot about knowledge that is transferable, e.g.: > We want your experience with Remix to transfer to web development generally. But then, you
by jscholes 5y ago
This page talks a lot about knowledge that is transferable, e.g.:
> We want your experience with Remix to transfer to web development generally.
But then, you opened the quickstart tutorial[1], and the first bit of mark-up is:
<Link to="/posts">Posts</Link>
Uh... okay. Not only is this not how you create links in HTML, but it also repurposes an element that actually does exist in HTML[2] for a completely different purpose. Of course, as to not conflict with that element, I now have to remember to type the L in uppercase, which is another aspect that doesn't carry over to HTML either.
It seems the amount they're willing to reinvent is limited to JavaScript.
[1] https://remix.run/docs/en/v1/tutorials/blog https://remix.run/docs/en/v1/tutorials/blog
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li...
- pier25 5y agoThat's only if you want to take advantage of the hydration and client side routing. You can of course use regular <a> links and navigate to a new page every time.
- jscholes 5y ago> That's only if you want to take advantage of the hydration and client side routing. I feel it would be doable for a framework to determine which links should be client-side routed versus not. Or, failing that (or in conjunction with it), provide a way for developers to indicate that information, without reinventing a cornerstone of the web and HTML mark-up from scratch.
- vagrantJin 5y agoI agree with your point. I dont know what it is about some devs aversion for HTML. But a anchor with a data attribute should more than suffice rather than creating over-engineered abstractions. But then again, not many devs even read the HTML docs.
- pier25 5y agoThat's probably what they would have done if starting from scratch, but Remix is built on top of React Router which is a 7-8 year old project with its own idioms. Also, Remix is for React developers. It's expected you will use JSX, components, etc. Personally I have a toy client-side router for Svelte. Links that need to trigger client-side navigation simply use a Svelte action: <a href="/" use:link>Home</a> https://github.com/PierBover/roots-svelte-router https://github.com/PierBover/roots-svelte-router
- armandososa 5y ago> I feel it would be doable for a framework to determine which links should be client-side routed versus not I think that is worse. Replacing a core html element behind the scenes to do a `history.pushState` is like to monkey patching. This way you can still use <a> elements and everything will work just fine, or you can very deliberately use a <Link> element if you want the extra functionality it provides. Same as with the <form> element which will work just fine in Remix as if it was a 2005 PHP project. Or you can use Remix‘s <Form> component which does all the "AJAX" magic behind the scenes that you'll spend two weeks adding to your 2005 PHP project.