12466
Offtopic group for casual talking about anything. @rules_for_python still apply (except for the ontopic rule)
well, I recommend use pnpm to manage dependencies, but I can't help you on integrating python with js, never did that yet, to learn more of pnpm go to its site:
https://pnpm.io/
start a new project with pnpm, because diference between pnpm and npm can cause problems...
some videos to start with pnpm:
PNPM basics:
https://www.youtube.com/watch?v=mZxAv0bpMWI
PNPM config for beginers:
https://www.youtube.com/watch?v=hH4e8PJaFeg
and i recomend to use nvm or fnm to manage your node versions (if not use bun or deno):
https://www.fnmnode.com/
I prefered FNM...
or
https://www.nvmnode.com/
that's it, it's all that i can do for you...
npm, pnpm and yarn are like pip in python...
bun, deno are like node but with ts integrated and some more features...
don't use npm instead use pnpm...
and maybe you wanna use biome in place of eslint...
but those are unwanted files when i just want warning over not using funciton, wrong naming and so on in js , but pylance offer this so easily no new file needs in my repo, but for js they say me to run this,npm init @eslint/config@latest
and as a result i got many many files 😨, as i dont know those files do actually what or maybe make my code slower in real hosting, so i fear to use those files, and also i want to use js type sugession and so on 😅
its so problamatic, actually i still not undersand the npm and the lot of files coming in my repo so scary to see and undersatnd those files in the /node_modules, is this like the python libraries but just need for eslint?
i wanted to get sugession in my .js files as i am doing in flask but the real js code need to be done in js structer, so i wish i only want like pylance's error for my js but i found when i try to do setup the eslint, it say https://eslint.org/docs/latest/use/getting-started#quick-start
and form here i foudn in my repo there just making the package.json, ... node_modules are also creating in my python repo, is this really ok there in my flask code?
Is anyone here JavaScript Developer ???
Since I realized I need to use JavaScript anyway, I am currently using VS Code. However, I am not receiving proper warnings when writing JS code, likely because the HTML elements are not recognized, even though the code itself does not show any errors. This is different from Python, where Pylance in strict mode provides clear warnings.
What extensions do you recommend for .js files to get similar functionality? As I am completely new to JavaScript, I would like to start with the best tools from the beginning. Any suggestions?
What i found by my research is this: EsLint -> but i am not getting why it say after install the extension i need to do some global, local setup even i am using python, so why i will do local setup of using npm here i am confused or is this standard to use?
https://flask-wtf.readthedocs.io/en/0.15.x/csrf/#javascript-requests
Читать полностью…
right now I'm trying to disable or remove this anti malware thing in windows 11 somehow, but it keeps turning itself back on.
Читать полностью…
When installing packages like Bootstrap 5 and HTMX, do I need to use npm, pnpm, or yarn? Currently, I download the raw .js and .css files directly. Is it okay to install these in my repository using pnpm, or should I continue with my current approach? If I switch to pnpm, what basic concepts do I need to learn to manage dependencies effectively?
Читать полностью…
i even don't know about npm and what those files are doig and again, pnmp, bun yarn all i will got cracked one day
Читать полностью…
yes so i am confused as in my github repo the js thigns will also got uploded even those not need for my python app.
Читать полностью…
If you want js tooling somewhere will need to be referenced right?
Читать полностью…
What it has to do EsLint with python? Just setup EsLint in your computer so the extension can use it
Читать полностью…
Thanks for this btw, i though i need to do something like this, but i missed this part 😅 💚
For me in this case, in the js funciton i just add this:
var csrfToken = document.querySelector(
'meta[name="csrf-token"]'
).content;
Hello, I was using the Flask-WTF library and have the following code in my head:
<meta name="csrf-token" content="{{ csrf_token() }}">
async function fetchRights(contentId, options) {
var response = await root.fetch((options && options.rightsUrl) || RIGHTS_URL, {
method: "POST",
headers: { Accept: "application/json", "Content-Type": "application/json" },
body: JSON.stringify({
content_params: { content_id: contentId, content_type: CONTENT_TYPE }
}),
signal: options && options.signal
});
I disabled it again and this time it worked somehow
Читать полностью…