Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Ujjwal Gupta
    @ujjwalguptaofficial
    @Madman600 not sure why you are using keyPath in primary key.
    also if you could explain your case better, than that would be great. please create an issue on jsstore github.
    Madman600
    @Madman600
    @ujjwalguptaofficial ujjwalguptaofficial/JsStore#201
    gsumeetk
    @gsumeetk
    hi @ujjwalguptaofficial : Is there any way to use other service worker with js store. I want to use @angular/pwa with jsstore.
    2 replies
    ManEatingFish
    @ManEatingFish
    Are there any plans on adding an encrypt-decrypt function to jsstore for indexedDB?
    Ujjwal Gupta
    @ujjwalguptaofficial

    @ManEatingFish there is already an open issue for this but i am very busy, so not able to work on this. Perhaps if you have time, you can create a plugin for this & i can offer review.

    Have a look at this issue - ujjwalguptaofficial/JsStore#183

    deepanshushukla
    @deepanshushukla
    hi @ujjwalguptaofficial i am facing issue implementing jsstore in elecron app
    web-worker working fine in dev mode but in prod mode file path is coming worng
    i am using electron-forge wepack plugin
    Failed to load resource: net::ERR_FILE_NOT_FOUND
    file:///C:/Users/Windows.User1/AppData/Local/desktop_screen_capture/app-1.0.0/resources/app/.webpack/renderer/main_window/scripts/jsstore.worker.min.b1b8c8d6341e6d77bc01a1d488574800.js
    please let me know if anyone faced such issue and resolved
    deepanshushukla
    @deepanshushukla
    @ujjwalguptaofficial need some help regarding performance of jsstore
    deepanshushukla
    @deepanshushukla
    what is the diffeernce between createDb vs initDb vs openDb?
    Ujjwal Gupta
    @ujjwalguptaofficial

    @deepanshushukla createDb is not supported in current version. InitDb is recommended way to initiate db schema.

    openDb is used to open database when you already know database is created. It is useful in case you have multiple db & you want to switch between them.

    deepanshushukla
    @deepanshushukla
    @ujjwalguptaofficial in windows taskmanager i can see two instance of jsstore.worker.min is this desired behaviour?
    showing in the memory tab of chrome devtool
    Ujjwal Gupta
    @ujjwalguptaofficial
    you must have opened two tabs of chrome. When runing browser app,look into browser resource via developer tools. There is no meaning of looking into task manager as browser is managing those things unless you are developing a browser.
    deepanshushukla
    @deepanshushukla
    Actually I am working on an electron app , anyways i found the issue with worker .
    export const initJsStore = async () => {
    try {
    const dataBase = getDatabase();
    await idbCon.initDb(dataBase);
    }
    catch (ex) {
    alert(ex.message);
    console.error(ex);
    }
    };
    this is your electron example code . Is it right every time app opens it is calling initDb()
    shoouldnt it call openDb is db exist
    if*
    shouldn't
    Ujjwal Gupta
    @ujjwalguptaofficial
    nope, initDb internally checks whether to create db , open Db or upgrade db.
    Ujjwal Gupta
    @ujjwalguptaofficial
    @/all @all jsstore v4 is launched. Here is an article for what's changed - https://medium.com/jsstore/introducing-jsstore-v4-7bd10ee4655d
    Aidan Gerber
    @AidanG1
    @ujjwalguptaofficial I'm using jsstore with vue. The example works fine when I run it on my own computer but when I copy and paste code from the example into a separate project, it doesn't work. It gets to the step where it console logs "db created" but skips "request pushed: init_db request pushed: select
    request change_log_status finished request executing: init_db request init_db finished" in between. When I check application, an indexed db has not been created. Thanks for any help.
    Ujjwal Gupta
    @ujjwalguptaofficial
    not sure @AidanG1 what's the issue. Do you see any error in console ?
    Aidan Gerber
    @AidanG1
    @ujjwalguptaofficial Thanks for the quick response. I do not see any error in the console. I see console logs of request pushed but not request executed and when I look in application no indexeddb is created.
    Aidan Gerber
    @AidanG1

    @ujjwalguptaofficial Hmm. I am maybe getting a relevant error. Here is it on chrome: Uncaught SyntaxError: Unexpected token '<'. and here is it on firefox: Loading Worker from “http://localhost:8080/undefined” was blocked because of a disallowed MIME type (“text/html”). I expected that the error was not related to jsstore because of stack overflow posts I read but I am realizing now that it may be related. Firefox even says that the file load was initiated from jsstore_con.js:19. Below is that file which is identical to the one in the example which works.

    console.log('1')
    import { Connection } from "jsstore";

    console.log('4')
    const getWorkerPath = () => {
    // return dev build when env is development
    if (process.env.NODE_ENV === 'development') {
    return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js");
    }
    else { // return prod build when env is production
    return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js");
    }
    };

    console.log('15')
    const workerPath = getWorkerPath().default;
    console.log('17')
    export const connection = new Connection(new Worker(workerPath));

    connection.logStatus = true;

    Aidan Gerber
    @AidanG1
    image.png
    image.png
    Here are the results of do console.log(connection) after the export const on the copy of the example vs the one I made by copy and pasting code. The top picture is the working one and the bottom picture is the copy that does not work.
    Ujjwal Gupta
    @ujjwalguptaofficial
    yeah worker is not being initialized properly.
    Could you log the worker path and see what's the value ?
    also make sure file-loader is installed properly and compare the version from your working copy vs not working copy.
    Aidan Gerber
    @AidanG1
    image.png
    @ujjwalguptaofficial thank you for the response. console.log(workerPath) yields "/scripts/jsstore.worker.5402dc7a015d024569c634652d8edae9.js". The version of file-loader is the same on both versions, 6.2.0 . I am getting a new error now though which is the above picture.
    Ujjwal Gupta
    @ujjwalguptaofficial
    not sure man, what's happning. Could you create a POC for this ? so that i can have a look.
    Aidan Gerber
    @AidanG1
    @ujjwalguptaofficial here is a github repository with code that does not work for me: https://github.com/AidanG1/jsstore-error-example
    Ujjwal Gupta
    @ujjwalguptaofficial
    ok taking a look
    Ujjwal Gupta
    @ujjwalguptaofficial
    @AidanG1 problem was you were not using file-loader.
    Aidan Gerber
    @AidanG1

    Ok. Thank you for your help. The reason I deleted the file-loader section originally was because I was getting this error: Failed to compile.

    ./src/service/jsstore_con.js
    Module Error (from ./node_modules/eslint-loader/index.js):

    VueProjects\todojsstore\src\service\jsstore_con.js
    6:12 error Unexpected '!' in 'file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js'. Do not use import syntax to configure webpack loaders import/no-webpack-loader-syntax
    8:12 error Unexpected '!' in 'file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js'. Do not use import syntax to configure webpack loaders import/no-webpack-loader-syntax

    ✖ 2 problems (2 errors, 0 warnings) but I don't seem to be getting that anymore. Thank you!

    Ujjwal Gupta
    @ujjwalguptaofficial
    yeah that was due to linting, in my PR - i have overided that.
    Hey i see you are working on vue 3. I will request you to please create an example under vue3 folder on jsstore-example repo. This will help fellow developers :).
    Aidan Gerber
    @AidanG1
    ok. I will create an example. Do you want it to be the fixed version of the error example? That version is almost identical to the current vue example in the folder except with router included.
    Ujjwal Gupta
    @ujjwalguptaofficial
    yeah a simple example with todo list, or a crud demo will work. Do not include store or router. The aim is to show something simple workable demo.
    thanks a lot Aidan.