Replies: 2 comments 2 replies
-
I expressly think we should not do this and instead encourage people to move importable code into modules. |
Beta Was this translation helpful? Give feedback.
-
Hi! I searched for this recently when I wanted to abstract away a reactive container for some inputs (individual inputs changing relevance according to some changing top-level values => I want to enter and exit them with a keyframe animation; actually quite inspired by this :) I used a module import instead: import/call an It's okay - the animations work - and its especially portable (and my big problem is finding the right pattern to maintain it as it grows => back into JS pattern fatigue!). In my exact case the change I was forced to do was probably a good one (once I get it organised). But it seemed unfortunate that - unless I'm missing something - then at the point of wanting to abstract reactive code across pages then the only option is to rearchitect and rewrite it? And maybe what I'm missing is that reactivity isn't something which we need to travel to all the edges (it doesn't) and inside the Markdown pages at the top-level is where it gets the best bang for the buck so to speak, and that is the place where it's really good to cover. Last thing to note about my usecase: since I also wanted to re-use the code in different places in one page, I guess I was really bound to run into problems with reactivity on top-level variables. Anyways, I did what Mike wants to encourage and I think I landed on something that's reasonable and very good in the long run; I'm just pointing out some of my thoughts as I went through this recently. And if I missed an obvious approach please say! |
Beta Was this translation helpful? Give feedback.
-
I miss the cosiness of
import {someFunction} from "@a/notebook"
; I wonder if it would be useful to transpileimport {someFunction} from "anotherpage.md"
to import from/_import/anotherpage.md.[hash].js
?Beta Was this translation helpful? Give feedback.
All reactions