wclr / yalc

Work with yarn/npm packages locally like a boss.
MIT License
5.67k stars 147 forks source link

How to make code changes show when using yalc some strange things here please advice #172

Open erikswed opened 3 years ago

erikswed commented 3 years ago

I can only get the first code changes after doing yalc add test-lib. After that there is no way to get any yalc push code changes to work. I created a stackoverflowalso

steps(just normal steps):

When I then change the test-lib code and run yalc push then nothing happens.

Read on it getting stranger..

I even restart the App server and do the yalc update test-lib but the test-lib code changes is not visible.

The strange thing is in my app VSCode node_modules I see the test-lib code changes. It's like the yalc push is propagating the changes to the app but the app is not using them

It's even more strange is that when I restart VSCode and start the App Server the old test-lib code is stil used.

I test to remove the test-lib with the command yalc remove test-lib and restart laptop and then do again yalc add test-lib. I then see the old code again.

I tried in Chrome Browser to do hard reset empty cashes but no luck getting this to work thinking that chrome was using old code cache .

When I set a breakpoint in Chrome browser like this: image

The very strange thing then happens that VSCode is stopping at the file and code since the first time I did yalc add test-lib , Since then I have done 20 yalc push and even publish . Where is VSCode getting this code from I'm buffeled.

When I go and look in yalc Store here on Windows 10, I see the latest code. C:\Users\user\AppData\Local\Yalc\packages\notistack\1.0.10\src:

What I do now after 2 days to be able to continue work I must

Then start over publishing and ading the test-lib. It's time-consuming but works.

Again, sorry for long text, I can only get the first code changes after doing yalc add test-lib. After that there is no way to get any yalc push code changes to work.

please help me out here this is crazy shit LOL

How can I make code changes show in Yalc?

package.json for test-lib

{
    "name": "notistack",
    "version": "1.0.10",
    "description": "Highly customizable notification snackbars (toasts) that can be stacked on top of each other",
    "main": "src/index.js",
    "module": "dist/notistack.esm.js",
    "types": "src/index.d.ts",
    "license": "MIT",
    "author": {
        "name": "Hossein Dehnokhalaji",
        "email": "hossein.dehnavi98@yahoo.com",
        "url": "https://github.com/iamhosseindhv/notistack"
    },
    "homepage": "https://www.iamhosseindhv.com/notistack",
    "repository": {
        "url": "git+https://github.com/iamhosseindhv/notistack.git",
        "type": "git"
    },
    "scripts": {
        "build": "tsdx build --transpileOnly --entry ./src/index.js",
        "prebuild": "npm run docs",
        "prepublishOnly": "npm run build",
        "docs": "rimraf typedoc.json && typedoc --tsconfig",
        "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
    },
    "peerDependencies": {
        "@material-ui/core": "^4.0.0",
        "react": "^16.8.0 || ^17.0.0",
        "react-dom": "^16.8.0 || ^17.0.0"
    },
    "dependencies": {
        "clsx": "^1.1.0",
        "hoist-non-react-statics": "^3.3.0"
    },
    "bugs": {
        "url": "https://github.com/iamhosseindhv/notistack/issues"
    },
    "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/notistack"
    },
    "contributors": [
        "Hossein Dehnokhalaji (https://www.iamhosseindhv.com/)"
    ],
    "keywords": [
        "notistack",
        "enqueueSnackbar",
        "snackbarprovider",
        "useSnackbar",
        "multiple",
        "react",
        "javascript",
        "material-ui",
        "toast",
        "redux",
        "snackbar",
        "stacked",
        "notification",
        "material design",
        "hossein",
        "dehnokhalaji",
        "iamhosseindhv"
    ],
    "yalcSig": "073ef039ed1e473029c88b6ad9af16d9"
}
erikswed commented 3 years ago

Anyone please advice what to do. This happens also when I use the npm link btw.. feels like my hhd drive is messed up maybe

wclr commented 3 years ago

I don't think that yalc itself has anything to do with your problem -) It just copies changed files (when use push), and you say that it does this, and they happen to be in node modules? If you use yalc add it actually copies files to .yalc folder and then in node_modules (if folder is not linked from .yalc).

erikswed commented 3 years ago

I don't think that yalc itself has anything to do with your problem -) It just copies changed files (when use push), and you say that it does this, and they happen to be in node modules? If you use yalc add it actually copies files to .yalc folder and then in node_modules (if folder is not linked from .yalc).

Thanks yea your right and I see the pushed code changes also in app node_modules. When I then do npm start then Chrome is showing the old code. In Chrome Inspector Console I see old code but under Inspector source the correct code is there. This is so confusing. I cant set breakpoints either not in Inspector or in VSCode, breakpoints in the test-lib . It's like the JavaScript files are dislocated. This happens in both Edge and Chrome

wclr commented 3 years ago

You probably should look into the way how your sources happen to get into the browser (bundler?).

erikswed commented 3 years ago

You probably should look into the way how your sources happen to get into the browser (bundler?).

I still learn this can you explain what you mean? This is CRA app that is using this test-lib (notistack)

wclr commented 3 years ago

I dont' really know, there is probably webpack (or something else) that is watching for changes and grabs changed sources, maybe watching for changes in node_modules somewhat limited, for example.

erikswed commented 3 years ago

I dont' really know, there is probably webpack (or something else) that is watching for changes and grabs changed sources, maybe watching for changes in node_modules somewhat limited, for example.

What about the package.json, maybe I must change something in that

wclr commented 3 years ago

What about the package.json, maybe I must change something in that

I don't think so. You should understand the whole chain of tooling here, then you will be able to figure out what's wrong.

erikswed commented 3 years ago

I just fork it and try to yalc link or yalc add notistack to my app. I think notistack has some configurations maybe that I have missed because I cant git this to work. Would be good if someone else try this? finding the problem I really want to use this lib