Thanks for the perspective, but just to understand, something like this Demoduler; also won’t work?
Also: I understand this feels weird and daunting for nothing. But, imagine I don’t need all the cutting edge features but a super simple starting point that I can import for all models I am planning to work with. isn’t that still okay? Say, I will update the urls to absolute ones once every year? (Only if I need any new feature that dropped, if else the current version will work effortlessly).
The issue with importmap
isn’t about number of lines. Its about a dangling config that I wish to avoid. Three is going to be a tool in a set of tools I am planning to wrap like this with my new bundleless workflow. So, having one less config helps me avoid things to remember.
I am also planning out a generative system for building UI with similar on the fly imported modules, which won’t work if I have to meddle with the markup.
I have a strong developmental need to have everything I use in self contained es6
modules; I am sacrificing performance for this and I know how it looks crazy. But the bet I am taking here is ability to do more trumps premature optimisation any day. I know it will be slow to load. I still do it because what I gain with this trade off is an amazing set of primitives that help me move a lot faster because of the uniform API in its application.
I know its hard to put what I have in my mind to words unless I show you something, so here are some examples (its not final, but the nugget of why I am doing this in here):
- SandWorms
- Confetti
(I did a bunch of examples, but Discourse won’t let me post more since new users have a limit for the number of links!)
These are all self contained components that can be imported with a single line of code with default configs that work out of the box. In the perspective of a person starting out, this is huge. For me, with a need to launch a ton of ideas in extreme speed this huge. The idea is to build a ton of primitives with the top 100 or so JS libraries that can be used as single line imports, with great flexibility to config if need be. Take a look at the ModelViewer’s code: https://rough.toolbomber.com/pv/ModelViewer.js.
If these are provided into the context of an LLM, bespoke components with on the fly generation & usage becomes super easy.