Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Mobile support #27

Closed
RafaelGB opened this issue May 6, 2022 · 13 comments
Closed

[FR] Mobile support #27

RafaelGB opened this issue May 6, 2022 · 13 comments
Assignees
Labels
epic enhancement new feature or request that suppose a breaking change

Comments

@RafaelGB
Copy link
Owner

RafaelGB commented May 6, 2022

@bakerstreet reports that the application does not work on mobile property here

I am opening this issue

@RafaelGB RafaelGB added enhancement New feature or request help wanted Extra attention is needed labels May 6, 2022
@iamrecursion
Copy link

While it's not working is it possible to mark isDesktopOnly as true? That prevents it from trying and failing to load on every mobile start for the moment.

@RafaelGB
Copy link
Owner Author

oh that's right! I will change it. Thank you

@iamrecursion
Copy link

You may be able to debug this more effectively using Obsidian REPL. Though it won't show the initial failure to load, it will pick up the error when you try and manually enable the plug-in.

@RafaelGB
Copy link
Owner Author

Nice plugin idea btw!
I will give it a try

@RafaelGB
Copy link
Owner Author

"isDesktopOnly": true added with 0.3.1

@iamrecursion
Copy link

Great! I look forward to proper mobile support!

@RafaelGB
Copy link
Owner Author

Nice! I am working with documentation with mkdocs

@RafaelGB RafaelGB added epic enhancement new feature or request that suppose a breaking change and removed enhancement New feature or request labels May 24, 2022
@RafaelGB
Copy link
Owner Author

Hi @iamrecursion do you need help with this issue?
Any progress? You can share with us so could be easy to help

@iamrecursion
Copy link

Oh, I think there's been some confusion! I didn't say that I could work on it—unfortunately I've not got the time at the moment—just that I look forward to it being done!

If this is still outstanding in a month or so I should be able to pick it up.

I'm really sorry for the confusion!

@RafaelGB
Copy link
Owner Author

@iamrecursion oh do not sorry :) I will try to give mobile support with your debugging plugin

@RafaelGB
Copy link
Owner Author

Trying to debug on mobile while is load with this templater script but does not load on mobile yet:

// Call this method inside your plugin's
// `onload` function like so:
// monkeyPatchConsole(this);
function monkeyPatchConsole(path){
    console.log("=> monkeyPatchConsole");
    // if (!Platform.isMobile) {
    //     return;
    // }

    const logFile = `${path}/${new Date().toLocaleDateString('sv')}.log`;
    const logs = [];
    const logMessages = (prefix) => (messages) => {
        logs.push(`\n[${prefix}]`);
        for (const message of messages) {
            logs.push(String(message));
        }
        window.app.vault.adapter.write(logFile, logs.join(" "));
    };

    console.debug = logMessages("debug");
    console.error = logMessages("error");
    console.info = logMessages("info");
    console.log = logMessages("log");
    console.warn = logMessages("warn");
    console.log(`<= monkeyPatchConsole ${logFile}`);
}

module.exports = monkeyPatchConsole;

@RafaelGB
Copy link
Owner Author

I generate a mini plugin just to debug on mobile.

mobile-debug.zip

Once I found the problem ([error] Plugin failure: dbfolder ReferenceError: Can't find variable: process) I used the plugin of rollup @rollup/plugin-replace to substitute in exec time the variable process for a controlled one

const getRollupPlugins = (tsconfig, ...plugins) =>
    [
        typescript2(tsconfig),
        nodeResolve({ browser: true }),
        json(),
        commonjs(),
        replace({
            'process.env.NODE_ENV': JSON.stringify(isProd ? 'production' : 'development')
        })
    ].concat(plugins);

aaaand... Its working! I am sure there are tons of bugs just for mobile but at least the table is loading correctly

@iamrecursion
Copy link

That's very exciting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic enhancement new feature or request that suppose a breaking change
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants