GithubHelp home page GithubHelp logo

Comments (11)

V1shvesh avatar V1shvesh commented on July 23, 2024 1

@joshwcomeau No problem!

I'll surely help out as much as I can. Will keep you updated.

from guppy.

V1shvesh avatar V1shvesh commented on July 23, 2024

Can I help out with this?

from guppy.

joshwcomeau avatar joshwcomeau commented on July 23, 2024

Can I help out with this?

@V1shvesh that'd be awesome!

Let me know if you have any questions along the way; I don't expect any huge complications, but this is a hot code path and it's used all over the project, so it's non-trivial.

Going to remove the "help wanted" issue, this'll be yours to tackle. No worries if you've changed your mind or don't have the time, though; just please let me know and I'll re-open it for others.

from guppy.

joshwcomeau avatar joshwcomeau commented on July 23, 2024

@V1shvesh how's this going? Not urgent at all, just checking in to see if you have any questions, or if I can do anything to help :)

from guppy.

V1shvesh avatar V1shvesh commented on July 23, 2024

@joshwcomeau Hey there!
Well, I didn't know much about Redux and reducers, so I kinda went learning through the docs. I am trying to understand it myself.

I'll surely clear any doubts with you, would love your help.

Hope to fix this in 2-3 days.:relaxed:

from guppy.

V1shvesh avatar V1shvesh commented on July 23, 2024
const buildUniqueTaskId = (projectId, name) => `${projectId}-${name}`;

I believe this isn't needed anymore?

from guppy.

joshwcomeau avatar joshwcomeau commented on July 23, 2024

Well, I didn't know much about Redux and reducers, so I kinda went learning through the docs. I am trying to understand it myself.

Ahh I understand. Ok! Very brave of you to try and tackle such a big refactor without prior redux knowledge, haha. Will be glad to answer any questions, although it may take me a while to respond, busy these days working to get a talk prepared.

Hope to fix this in 2-3 days.☺️

No rush :)

const buildUniqueTaskId = (projectId, name) => ${projectId}-${name};
I believe this isn't needed anymore?

Right. I'm pretty sure you won't need that anymore. The thing to check is where those unique IDs are used, and to see if a non-unique Id (like the task name, eg. start) will be sufficient. I believe it will be, but I'm not sure off the top of my head.

from guppy.

V1shvesh avatar V1shvesh commented on July 23, 2024

busy these days working to get a talk prepared.

This sounds cool!

Also,

type State = {
  [projectId: string]: {
    [taskName: string]: Task,
  },
};

This'll be the structure of state, I suppose.

from guppy.

joshwcomeau avatar joshwcomeau commented on July 23, 2024

@V1shvesh yeah, that's right! The Task type will likely need to change a bit as well, to remove id.

from guppy.

V1shvesh avatar V1shvesh commented on July 23, 2024

Hey @joshwcomeau

Please check my PR and let me know if I went wrong anywhere.

Apart from that, in redux-persistence.service.js,

const scrubbedTasks = Object.keys(reconstructedState.tasks).reduce(
  (acc, taskId) => {
    const task = { ...reconstructedState.tasks[taskId] };
    task.status = 'idle';
    task.processId = null;
    task.logs = [];

    return { ...acc, [taskId]: task };
  },
  {}
);

Do we want to have a nested structure in scrubbedTasks?

from guppy.

joshwcomeau avatar joshwcomeau commented on July 23, 2024

Yay, thanks @V1shvesh! Checking now.

For redux-persistence, it should match the same structure (since this structure will be used for the initial state on next load). So yeah it should be nested as well. Which does make this operation a bit trickier... hopefully not too bad though!

from guppy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.