tsParticles 2.11.0 Changelog
Bug Fixes
- Removed console log, closes #5003
- Fixed getPositionOrSize function
- Fixed some shapes
New Features
- Added refresh flag for loading plugins, this will prevent multiple refresh of the instance
- Added animated gif support to image drawer (use it with caution, gifs are heavy)
- Added setLogger and getLogger functions, this will prevent
console.logmistakenly left in the code. - Added export plugins, previous export functions were removed (barely used), and a 3 new plugins are available. The available exports plugin are: Image, JSON, Video. The first two were already present, the third one is new.
- Added new rounded polygon shape
Other Changes
- Removed fallbacks for requestAnimationFrame, they're useless.
- Added tree shaking capabilities
- Added ESLint
no-consolerule, to avoid other issues likes #5003,getLoggermust be used when needed some logs.
How do setLogger and getLogger functions work?
If you want to customize the log of tsParticles you can call setLogger(logger) function, passing a ILogger object.
The setLogger function prevents undefined properties assigning the default one.
setLogger({
debug: console.debug,
error: console.error,
info: console.info,
log: console.log,
verbose: console.log,
warning: console.warn,
});
This assigns all the log functions console functions, but you can use empty functions (() => {}) to disable every function.
If there's a console.log left like in #3552, #3528 or #5003, you can disable the log property of the setLogger parameter to get rid of it, so you don't have to wait the next release.
The getLogger function, returns the object set using setLogger, every plugin MUST use getLogger() for logging things, so mistakes can be fixed easily, even errors can be muted or redirected to your favorite logging platform.
If you want to log something use this code:
getLogger().log("tsParticles is awesome");
--
Social links
matteobruni
/
tsparticles
tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
tsParticles - TypeScript Particles
A lightweight TypeScript library for creating particles. Dependency free (*), browser ready and compatible with React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components
Table of Contents
-
tsParticles - TypeScript Particles
- Table of Contents
- Do you want to use it on your website?
- Library installation
- Official components for some of the most used frameworks
- Presets
- Templates and Resources
- Demo / Generator
- Video Tutorials
- …




Top comments (0)