Open emilio-toledo opened 3 months ago
@emilio-toledo what is scenario you are looking for using the plugin on Mobile?
@mnaoumov I am currently using dataviewjs to render the following snippet:
const { init } = require("/views/pitch.ts")
const data = init(dv)
This snippet invokes a file which renders custom HTML to display Japanese Kana in a specific way and style. Not only that but all throughout my vault I am using this module to import .ts scripts to add a bunch of extra functionality when paired with templater, such as modifying the frontmatter data on template load and fetching data using fetch
.
My whole vault and ideas that I have to enhance my Obsidian workflow without having to develop a plugin from scratch depend on custom JS/TS. I have tried most of the plugins related to creating modules and this one is by far the best.
I know that there are similar plugins that work on mobile, but the only one that lets me (without hassle) use Typescript as my language is this one.
@emilio-toledo That's very unlikely we could make the plugin work on Mobile because on Mobile we don't have Node.js
infrastructure. All the plugins that aim to run scripts on Mobile don't use require()
, they use eval()
. But I will double check
@mnaoumov maybe this is out of the scope for this plugin, but what CustomJS is doing is adding a global function that returns your modules (they export classes). Maybe it would be possible that depending on the platform, we either use require or circumvent mobile limitations by using eval in a similar way.
@emilio-toledo I know for a fact, CustomJS
is using eval()
inside. I was a contributor to CustomJS
for a while and decided to write my own version of it to do things that eval()
can't
Hello, thank you so much for this plugin!
I have one question, is it possible to get mobile support?
I have found "fix-require-modules" extremely helpful, and I believe adding mobile support would greatly its popularity.