question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

console.log left in build

See original GitHub issue

Which version are you using? 1.24.1

Is the latest version affected?

  • Yes
  • No

Which library are you using?

  • Vanilla JS (tsparticles)
  • React (react-tsparticles)
  • Vue.js 2.x (particles.vue)
  • Vue.js 3.x (particles.vue3)
  • Angular (ng-particles)
  • Svelte (svelte-particles)
  • Preact (preact-particles)
  • Inferno (inferno-particles)
  • jQuery (jquery-particles)
tsParticles Configuration
  N/A

Describe the bug A clear and concise description of what the bug is. console.log() production build I dont know if it was to be expected that the console.log() was left in the production build. I only noticed it when testing my app.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.adamalston.com/
  2. Inspect Element
  3. Console
  4. See particles object

Expected behavior Remove console.log() from production build

Screenshots image

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context I do have an additional question. It seems like the particle speed has been increased significantly between 1.22.x and 1.24.x. What is the reasoning/explanation behind this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adamalstoncommented, Mar 24, 2021

Thanks for the explanation, the math behind the change seems interesting. Also sounds like performance will see an improvement due to the circular emitter and speed being more linear - not that it was bad before.

0reactions
matteobrunicommented, Mar 23, 2021

The new values are:

new x new y old x old y
top 0 -1 0 -1
top right sqrt(2)/2 -sqrt(2)/2 0.5 -0.5
right 1 0 1 0
bottom right sqrt(2)/2 sqrt(2)/2 0.5 0.5
bottom 0 1 0 1
bottom left -sqrt(2)/2 sqrt(2)/2 -0.5 0.5
left -1 0 -1 0
top left -sqrt(2)/2 -sqrt(2)/2 -0.5 -0.5

Using none instead of a couple of random values, it’s

const angle = Math.random() * Math.PI * 2;

horizontal = Math.cos(angle);
vertical = Math.sin(angle);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Should I be removing console.log from production code?
So I would suggest to leave console.log calls as they are for a most trickiest part of the codebase. Share.
Read more >
Hide 🙈 all console logs in production with just 3 lines of code
If you are using Terser in your build, they provide an option to remove log statements (drop_console: true) from your minified code.
Read more >
The simplest way to disable console.log for Production build in ...
The simplest way to disable console.log for Production build in Angular? · By using libraries such as logger · Creating a linting rule...
Read more >
Deactivate console.log on production (Why and How)
My advice is therefore either go through your code properly and remove all the console.log(…)s within your code-base or just deactivate it at ......
Read more >
JavaScript Console.log() Example – How to Print to the ...
Just open the console, Ctrl+Shift+K or F12 , and in the top right you will see a button that says "Switch to multi-line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found