<Alterion.Dev>
Explore posts from serversRuntime Env vars in vite
Hey all, I'm trying to figure out a way to run environment variables at runtime rather than at compile time. I've been looking at https://iendeavor.github.io/import-meta-env/ , but I can't seem to get it to work. Specifically, in
transformMode: "runtime"
, trying to use this code in a script called by index.html (in fact, a script tag in index.html) just makes global.import_meta_env to be the placeholder, it doesn't get replaced.
I need this because our build system builds once and then distributes to other servers for various regions. We also have staging/beta/dev servers built the same way.
Anything I'm missing? (This isn't necessarily related to solidjs, but, it's a thing that could be used with solidjs 😉 )11 replies
"The reactive variable 'head' should be wrapped in a function for reactivity."
I'm a little confused specifically as to what this warning from
eslint-plugin-solid
means:
Here's what the code looks like (simplified):
I don't understand here why it's telling me it should be wrapped in a function, when I'm reading a derived state. This works fine it's really a linting warning that I'm not sure is even correct so I'm wondering if I've got this all wrong.4 replies
Facebook/Twitter share implementation?
Hi guys! I've never had to do this before, and I'm wondering if maybe someone had an example of implementing Facebook and/or Twitter Share systems in a solidjs app? I have a "base" I can sort of duplicate but it's an overengineered reactjs code thing and I would much rather do something that's as clean and simple as possible. Is it really necessary to dynamically inject the javascript and such into the <head> for all this to work? I'd love some guidance!
15 replies
Dropdown with click outside pattern
What would be the best pattern to create a dropdown menu div or menu div with an onClick handler outside to auto close it? not a hover menu, mind you, but a click menu. I know how to show it, but I recall handling the onClick outside of the element actually implied something like portals or annoying dom manipulation in react, and I'm wondering if solid (or some community-made primitive) has a better idiomatic pattern for this?
Currently my component looks like
obviously, it only opens or close on clicking the button.
15 replies
Virtual Scrolling with animation and dynamic loading
I don't have the bandwidth to expend too much on this idea, so it's more of a thought experiment for later, unless someone in the ecosystem team has come up with an elegant, premade solution for this. I have a list of cards rendered in a wrapper, where I need to scroll horizontally on clicking a button. My current idea that's unoptimised but functional (probably) is to just have an overflow:hidden CSS, and control the current scrolling position of the wrapper manually, setting it to "n * the width of a card*.
The main issue with that is that will a grand total of 4700 cards over 70 wrappers with individual scroll control, this might be... A bit slow.
Is virtual scrolling a solved problem in Solid? Is there a currently updated plugin that does it well enough? If not, I'll reserve some personal time to possibly work on it outside of work development time, but I was wondering... ☺️
5 replies