Event that triggers when code is changed? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
Hi is there an event that detects changes to the js code so you could change the version number evertime you do something with the code
I am to lazy to change the version number on my site every time I work on it :)

There are a lot of ways to do this, which is the good news. The bad news is that the most appropriate method for your project will depend very heavily on the details of how your project is set up, what method you use to deploy it, and so on. Generally things like automatic version increments on deployment are done by CI/CD tools, and that's a large field. You'll have to do some research on your own, with your project specifics as well as your needs in mind, to decide on the best solution. For example, if this is a private project and you don't want to bother with semantic versioning you can simply increment a counter, whereas a more elaborate project might have more complicated requirements.
Your question is tagged with javascript, although it's not clear what package manager you're using (if any). If you're working with npm or yarn you can use push or commit hooks, which is perhaps the simplest option.

Related

Best way to remove unused javascript suggested by lighthouse. Is setTimeout a good idea? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Lighthouse suggests that I need to remove the unused javascript from the third party javascript library say index.js . It is okay for this particular library to load after few 10 seconds once the page is loaded. So I used the SetTimeout method to do that but I don't think that is the right approach to do it.
Once I do that, lighthouse does not complain about unused javascript from this library and improves the score, but I am worried that in production Google measure the overall performance of the page from the moment page loads to the moment user leaves the page. So in that sense, the unused javascript is never removed and just delayed for the execution. People also suggested that lazy loading JS on user events will help but in our the case mentioned above, the JS should load automatically.
I am basically looking for the suggestion to:
How to handle the JS libraries that I can't get rid of and which has lot of unused code in the page?
Is setTimeout good solution for the above case?
Is my understanding of performance calculation by Google correct (in production environment) although it does not show unused JS after delaying for 10seconds?
I would be more than happy to get the answers.

What is the best way of testing that, removing unused tables(migration) do not affect the application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We have some very old tables which we do not use. I am planning to remove those. My initial plan is to rename the tables and test if our application is affected anyway. But I am not sure how to test the application and make sure that it's not affected.
Ideally, you should have tests for your application, which are going to break if anything is using the deleted tables.
Assuming that you don't have tests, the next best way is to run a global search in your codebase and look for those models / table names being used in the code. If you still don't feel confident, you can manually go through every page and make sure that nothing is broken. Depending on the size of your app, that might be really slow and painful, but it's what you get for not writing tests from the start :P
Good luck!
Run all your automated tests. If you don't have any, right now is always the best time to start adding them.

What is React Hot Loader? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I used react on several of my project is that it was well passed, but it is last time I saw that there is a react-hot-reload
What is react-hot-loader?
What is its use?
difference between Hot Module Replacement in Webpack and React Hot Loader ?
What is the advantage it will bring to the workflow?
how it works behind
can anyone explain me plz :)
React Hot Loader is a React library used to edit your code and automatically reflect that change in your running app while keeping the components mounted, which means you don't need to refresh your browser and you won't lose your current state. It's pretty convenient as you won't have to go step-by-step to test a specific state in your app every time you make a change in the code.
Your workflow would be faster, simpler and more comfortable.
Here's a live demo: http://gaearon.github.io/react-hot-loader/
Edit: React Hot Loader is now deprecated, use React Fast Refresh

Combining JS Frameworks [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
From an experienced developer's perspective, is bad practice to create a web application using multiple JS frameworks ?
For example, if you start using AngularJS and if some tasks of the project can be done easier with JQuery, should you go for it, or try to make that part in Angular too ?
In my opinion, a framework should only be used if it's absolutly necessary. E.g if you do lots of DOM work, jQuery is the right one.
But, if you need a mvn framework, go for angular/backbone or something like this.
Tio many people today think that for each and every single problem, a framework is the best solution.
Sometimes, it could be the best solution to use 2 frameworks. E.g. jQuery + lodash.
So the answer is... It depends on the type of application you want to develop. My approach would be to allways ask whether the framework is really needed, or if you maybe just need a single function that you better could write on your own.

How do I make it so people can't save my JSFiddle over my own? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm having an issue with JSFiddle where when I go to my Dashboard and open up a JSFiddle owned by me that I was working on, it became rev 52 (mine was rev 43) and was COMPLETELY edited. As in all my code was gone and it was replaced with some random code that has nothing to do with my original Fiddle.
Am I doing something wrong with the way I setup my JSFiddle? Or is there something I can do?
If you're logged into jsFiddle, then only the logged in user owns the base version. I only share the base version. Others can make their own versions, but the base version never changes unless I set a new version to the base. "Use the base, Luke".
If I need to share multiple versions, I just hit Fork and make a new base version to share. This way my version that I created and shared is ALWAYS the base version. I also never have to remember which version is my version as it's always just the base version.

Categories