WebStorm typings in external libraries - reactjs

I am trying to update my react-router library from version 5 to version 6.
I have updated my package.json file and the library installs correctly in my "nodes" folder.
However I have noticed that there is this annoying WebStorm/IntelliJ typing folder called Project #types under "External Libraries".
This contain old typings from react-router version 5.
On closer inspection I noticed that it is under my AppData:
Why does this exist? Where does it come from? And can I just delete it?
UPDATE
I have tried deleting it, but magically it recreates the folder again :( . This is really really annoying. I do not want my project dependant on some old typings in some AppData folder; I want it dependant on the typings in the "nodes" folder.

IDEA downloads typings for some popular libraries to its configuration folder and uses it to enhance code completion. Please try to either disable typescript.external.type.definitions Registry key or remove react-router-dom from typescript.external.type.definitions.packages key value and then remove the auto-downloaded typings from <IDEA system folder>\javascript\typings folder.
The Registry can be located via: Help > Find action > type Registry...

Related

How can I create a node module using lottie-react-native?

I'm building a React-Native component library.
I built a simple loader using lottie-react-native.
When installing the library locally, the component works.
After publishing the package on github and installing it, there is no error but the component is not displayed at all.
(FYI, I first encountered an issue installing it which has been resolved here : Why a dependency would not want to install when installing a library?
Now, the lottie-react-native dependencies appears in my node_modules).
I think I spotted the issue but I'm not sure and I don't how to resolve it.
First have a look at the freshly installed library's folder tree in the node_modules folder:
At this point, the lib folder shows an error, let's open it :
Ok, let's open the TS folder and sub-folders until I reach the error:
Now the index.d.ts file containing the error:
Originally, the assets folders contains the json files needed for the Lottie view.
When running the publishing process, my src folder is compiled to TS and the .d files are created.
I think the issue could be due to some tsconfig options or maybe the way I import things, but I'm not sure.
Here's the folder structure in the dev environnement:
Since it works fine when the lib is installed locally, I'm pretty sure that the issue occurs when compiling to TS.
What do you think?
Looks like you have 2 problems here.
png and json extension are not copied to the destination folder. You can fix this by copying manually or using tsc-hook.
.js extension files are not compiled. I think your tsconfig file has set emitDeclarationOnly to true. Try setting that to false.

create-react-app taking up too much disk space and time

It's my first experience with react and as stated in official docs, I was trying out create-react-app to create my first react app.
But I notice that it takes around 15-20 minutes to get finished( even though I have good internet connection) and once it was completed, I noticed the space taken by the newly created folder to be around 165-170 MB.
Isn't there any quicker way to get started with react as the above mentioned method probably installs some modules that are never going to be used.
Thank You.
I also faced the same problem when i first started learning react. What i did was i manually configured webpack to bundle my code. And then i created central node_modules folder in particular place. So anytime i want start a react project i just create a symlink to the node_modules folder. And also if i want install a new package, i go the central folder and install it, so the package will be available in the node_modules folder and for any of my project that may need it. That way i only need to install a package once not every time i want to use it for a new project.
But recently i found a package manager called pnpm. Instead of downloading a package anytime need to install it, pnpm maintains a central cache of packages such that anytime you want to install a package, it just creates a symlink(or junction in windows) (similar to what i used to do).
Conclusion
In conclusion i would recommend you to just configure a bundler (vite is cool) by yourself and use pnpm to install packages. You can read more about pnpm on there website

Umbraco Package (ImageProcessor) Crashing site

So I tried to install a package called 'Image Processor' to our Umbraco build which I later found was incompatible. How do I manually remove this package from the build? I've tried removing all mention of 'ImageProcessor' from the Web.config, packages.config etc still no cigar.
This is the error we're getting.
Check in the /bin/ folder for the Image Processor DLL file. If this file is present, I believe that the application is trying to load it. However, this file requires something from Umbraco.Core which isn't there, so it crashes.
If you find the DLL, try deleting it and reloading the application.
Also, I assume you installed this package through Umbraco. In the future I would recommend using NuGet to install packages, as it allows you to add, update and remove packages without running the application (so if you were to get an error like this again, you would be able to easily uninstall the package).

Using Quick Install in Visual Studio doesn't actually add the packages to your project

Hello I'm trying to use the Visual Studio extension Quick Install Package to install packages via bower and npm. One example is angular-loading-spinner
When I give the command using the interface, I see that the package.json file is updated and or the bower.json file is updated with the package dependency, but I'm still unable to actually reference the packages as instructed in my html using the tags. No actual files are added to the project, so I feel like I'm really missing something here, or simply don't understand what this package installer is actually meant to do. There doesn't seem to be any clear tutorial on this I can find online, or any good information. It just all assumes it works fine. Can anyone please advise? Thanks]1
Mike, I'm glad to know that my answer was the correct. For future users that have the same concern, they need to look at the folder node_modules to find out all the libraries installed.
This was put in the node_modules folder as pointed out by Jonathan Brizio. The issue was that the files were hidden and had to be included in the project.

Composer update root package

I want to make the system updates based on composer
With updating dependencies no special problems, but how to update the root package, it is not clear
I'm trying to understand the code composer and so far without success
I think a root project put into dependencies and leave only the bare minimum
or download the project archive from the github and manually remake it
Maybe someone faced with such a task
I don't think there is any way to update the main project.
This is when you've, say, installed a project with composer create-project proj/name . * or similar? Running composer update of course updates the dependencies, but nothing exists to update the project itself.
One way to do it might be as you say, and make the root project nothing but a composer.json file that lists the dependencies, and move the project to operate as a dependency. Bit of a change to the structure though, so this mightn't be possible.
You'll have to use git to do this. This is currently not possible using composer. I was faced with the same problem.
Publish your project on github (or another service)
Install git on the server
Clone the project from git (using git clone git#github.com:whatever folder-name) onto your server wherever you want your root folder located
Whenever you need to update the root project, open a git command window from the root project directory, and run git pull origin v1.0.1. This will essentially patch the project files from the tag you specify.

Resources