Giter Club home page Giter Club logo

Comments (15)

scttcper avatar scttcper commented on June 7, 2024

Released 3.2.3 that includes a UMD packed toastr.umd.js You should load this the same way you load other UMD packed packages. https://github.com/scttcper/toastr-ng2#systemjs
I copied the UMD packing config from ng-bootstrap and didn't test it, good luck.

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 7, 2024

Is there an issue with npm or did you unpublish 3.2.3? I cannot install it to test this.

from ngx-toastr.

scttcper avatar scttcper commented on June 7, 2024

@yarrgh looks like it didn't go. Try again now.

from ngx-toastr.

clabough avatar clabough commented on June 7, 2024

toastr.umd.js came down for me just now. Seems a bit large for such a small library.

from ngx-toastr.

clabough avatar clabough commented on June 7, 2024

that umd.js file isn't going to work. It's designed for bootstrap. It throws errors like "Cannot read property 'defaultDoc' of null"

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 7, 2024

Full error:

TypeError: Cannot read property 'defaultDoc' of null
    at _document (http://localhost:3000/node_modules/toastr-ng2/toastr.umd.js:3238:101)
    at AppModuleInjector.get (/AppModule/module.ngfactory.js:39:83)
    at AppModuleInjector.get (/AppModule/module.ngfactory.js:74:106)
    at AppModuleInjector.get (/AppModule/module.ngfactory.js:79:110)
    at AppModuleInjector.get (/AppModule/module.ngfactory.js:99:87)
    at AppModuleInjector.getInternal (/AppModule/module.ngfactory.js:244:49)
    at AppModuleInjector.NgModuleInjector.get (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:8913:48)
    at ComponentFactory.create (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:7700:48)
    at ApplicationRef_.bootstrap (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:8672:61)
    at eval (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:8501:93)
    at Array.forEach (native)
    at PlatformRef_._moduleDoBootstrap (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:8501:46)
    at eval (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:8453:31)
    at ZoneDelegate.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:229:26)
    at Object.onInvoke (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:4405:41)

from ngx-toastr.

scttcper avatar scttcper commented on June 7, 2024

Dang... what is defaultdoc... How are you guys testing this? Are there other packages that do this?

@clabough I see what you're saying theres a DomAdapter in there and stuff.

i put it all in https://github.com/scttcper/toastr-ng2/blob/master/rollup.js
Its run via ./stage-release.sh which prepares a ./deploy folder. Feel free to play around.

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 7, 2024

I'm using the quickstart

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 7, 2024

I think I have a working umd file. I compiled the source like normal but modified the rollup.js file to the following:

export default {
  entry: './deploy/toastr.js',
  dest: './deploy/toastr.umd.js',
  format: 'umd',
  moduleName: 'toastrng2',
  globals: {
    '@angular/core': 'ng.core',
    '@angular/compiler': 'ng.compiler',
    '@angular/platform-browser': 'ng.platformBrowser',
    '@angular/http': 'ng.http',
    'rxjs/Observable': 'Rx',
    'rxjs/Subject': 'Rx'
  }
};

And then used rollup to target that rollup.js as a config file. For example node_modules\.bin\rollup -c rollup.js.

The umd file is now much leaner and works correctly with systemjs.

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 7, 2024

If you want I can create a pull request for you to review

from ngx-toastr.

scttcper avatar scttcper commented on June 7, 2024

Yeah, please do.

from ngx-toastr.

clabough avatar clabough commented on June 7, 2024

That's looking pretty good to me so far.

from ngx-toastr.

scttcper avatar scttcper commented on June 7, 2024

released 3.2.4

edit: oops wrong button.

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 7, 2024

So far it's working great with the quickstart app.

@clabough @cmk1523 can you guys install 3.2.4 and make sure it works in your projects?

from ngx-toastr.

clabough avatar clabough commented on June 7, 2024

working for me. thank you.

from ngx-toastr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.