fuse-box / angular2-example

43 stars 13 forks source link

fin-hypergrid not working #31

Open Tenvan opened 7 years ago

Tenvan commented 7 years ago

hi, last beta working well with covalent, now i get the next problem. i try to migrate our app from angular-cli to fuse-box, and now make the naxt library trouble: fin-hypergrid

bundling work, here the result:

└── default (0 files,  53 Bytes)
└── fusebox-hot-reload (1 files) 1.8 kB
└── fusebox-websocket (1 files) 2.9 kB
└── events (1 files) 9.8 kB
└── core-js (81 files) 57.1 kB
└── zone.js (1 files) 92.2 kB
└── @angular/platform-browser-dynamic (1 files) 6.7 kB
└── @angular/compiler (1 files) 973.1 kB
└── @angular/core (1 files) 460.5 kB
└── rxjs (95 files) 217.6 kB
└── @angular/common (1 files) 129 kB
└── @angular/platform-browser (2 files) 155.3 kB
└── @angular/forms (1 files) 202.4 kB
└── @angular/material (1 files) 870.6 kB
└── @angular/animations (2 files) 119.9 kB
└── @angular/http (1 files) 74 kB
└── http (1 files) 288 Bytes
└── lodash (1 files) 527.1 kB
└── fin-hypergrid (76 files) 640.8 kB
└── finbars (1 files) 33.8 kB
└── css-injector (1 files) 2.7 kB
└── rectangular (1 files) 109 Bytes
└── object-iterators (1 files) 10.3 kB
└── inject-stylesheet-template (1 files) 2.7 kB
└── automat (1 files) 5.7 kB
└── extend-me (1 files) 7.1 kB
└── overrider (1 files) 3 kB
└── sparse-boolean-array (1 files) 13.9 kB
└── fin-hypergrid-data-source-base (1 files) 8.6 kB
└── mustache (1 files) 19 kB
└── pop-menu (1 files) 12.4 kB
└── @covalent/core (18 files) 388.9 kB
└── @angular/material@2.0.0-beta.3 (1 files) 761.9 kB
└── @angular/flex-layout@2.0.0-rc.1 (1 files) 155.6 kB
└── @angular/router (1 files) 210.9 kB

    Size: 6 MB in 3s 450ms
└── default (11 files,  39.7 kB)
      main.js
      main.scss
      app.module.js
      app.component.js
      todo/todo-filter.pipe.js
      todo/todo-item.component.js
      todo/todo.model.js
      todo/todo-item.component.html
      todo/todo-list.component.js
      todo/todo.service.js
      todo/todo-list.component.html

but now this error:

Connecting to fusebox HMR at ws://localhost:4445
vendor.js:111229 Uncaught TypeError: Cannot read property 'Point' of undefined
    at Number.<anonymous> (vendor.js:111229)
    at c (vendor.js:171835)
    at w.require (vendor.js:171835)
    at Number.<anonymous> (todo-item.component.ts:4)
    at c (vendor.js:171835)
    at w.require (vendor.js:171835)
    at Number.<anonymous> (app.module.ts:13)
    at c (vendor.js:171835)
    at w.require (vendor.js:171835)
    at Number.<anonymous> (main.ts:9)
(anonymous) @ vendor.js:111229
c @ vendor.js:171835
w.require @ vendor.js:171835
(anonymous) @ todo-item.component.ts:4
c @ vendor.js:171835
w.require @ vendor.js:171835
(anonymous) @ app.module.ts:13
c @ vendor.js:171835
w.require @ vendor.js:171835
(anonymous) @ main.ts:9
c @ vendor.js:171835
r.import @ vendor.js:171835
(anonymous) @ todo.service.ts:5
(anonymous) @ todo.service.ts:5
vendor.js:171835 rectangular not found on request

but 'rectangular' is not included in result-js, but listet in bundle-log :/

Tenvan commented 7 years ago

test project is updated with a new branch feature/fin-hypergrid

nchanged commented 7 years ago

@Tenvan i see the problem. Package rectangular is broken. Check out node_modules/rectangular/package.json

"main": "./src/js/rectangular.js",

But the folder node_modules/rectangular contains no sub-folders. That's why fusebox is confused. We could technically check for entry point existence and fall back to index.js

For now, a solution is to override node_modules using register directive:

fuse.register("rectangular", { homeDir: "node_modules/rectangular", main: "index.js", instructions: "**/**.js" })

I just tested and it works just fine

Tenvan commented 7 years ago

ok, migrating now complete and all is working... with a huge bundle of packages (angular, covalent, fin-hypergrid, redux, edge, moment, lodash and some more) fuse-box is a very fine and greate tool :)

nchanged commented 7 years ago

Nice! You will be able to make your bundles smaller :) very soon :)