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.

Upgrade 0.5.0 -> 1.0.0

See original GitHub issue

Hi,

Just some feedback. I am using confetti in Angular 8. When I run 0.5.0 it shows up on the full screen. No code changes were made on my side.

  • When I updated to 1.0.0 all confetti happens just in a small rectangle in the top left corner 300x 150. I fixed it by adding undefined, { resize: true, useWorker: true } to confetti.create().
  • I had to switch to useWorker: false as the UI became unresponsive, not sure why. I attached some screenshots of CPU.

useWorker: false - after confetti fineshed image

useWorker: true - after confetti fineshed image

 showConfetti() {
    try {
      confetti.create(undefined, { resize: true, useWorker: false })({
          angle: this.random(20, 100),
          spread: this.random(50, 60),
          startVelocity: 80,
          particleCount: this.random(250, 350),
          ticks: 400,
          origin: {
            x: 0.2,
            y: 0.8
          }
        });
    } catch (e) {
    }
  }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
catdadcommented, Dec 24, 2019

I just tried the following:

ng new confetti-test
cd confetti-test
npm i -S canvas-confetti
npm start

I confirmed that this is using Angular 8 and canvas-confetti 1.0.0.

Then, I changed src/app/app/component.ts to include the following (I also tried some variations as well):

import { Component } from '@angular/core';
import confetti, { create } from 'canvas-confetti';

const thing = create(undefined, { useWorker: true, resize: true });

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'confetti-test';
}

setTimeout(() => {
  confetti();
}, 1000);

setTimeout(() => {
  thing({
    angle: 90,
    spread: 60,
    particleCount: 350,
    ticks: 400
  });
}, 3000);

In both cases, the confetti were fullscreen and I did not see any significant CPU usage. I think something non-trivial is going on in your application that I am not sure how to reproduce.

1reaction
VaclavEliascommented, Dec 24, 2019

Ohh, if you like javascript I recommend to play with TypeScript. You might like to rewrite confetti to TypeScript 😃 and Angular is then not far away from it. I like canvas-confetti library as it adds up some fun to boring websites. Also this one caught my eye https://auz.github.io/Bug/ but would prefer different kind of entities moving around and even following some path…

Let’s see as the holidays is now here but will be in touch once I have my test app ready 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade grid from 0.5.0 to 1.0.0 - Telerik UI for Blazor
Handle the changes in the grid API between the 0.5.0 pre-release and the first official 1.0.0 version. Read more in our Blazor Knowledge...
Read more >
Upgrading to Vault 0.5.0 - Guides - HashiCorp Developer
This page contains the full list of breaking changes for Vault 0.5, including actions you must take to facilitate a smooth upgrade path....
Read more >
npm-upgrade
Interactive CLI utility to easily update outdated NPM dependencies. Latest version: 3.1.0, last published: a year ago.
Read more >
Upgrading to IBM AD V5.1.0.2 from versions V5.0.5.0, V5.0.5.1 ...
Upgrading to IBM AD V5.1.0.2 from versions V5.0.5.0, V5.0.5.1, V5.0.5.2 or V5.1.0.0. Note: Once the latest version of IBM® Application Discovery and ...
Read more >
Upgrading — Vagga 0.8.1 documentation - Read the Docs
For most users upgrade should be seamless. ... Upgrading 0.5.0 -> 0.6.0¶ ... TarInstall url: http://static.rust-lang.org/dist/rust-1.0.0-alpha-x86_64- ...
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