Git Product home page Git Product logo

udk's People

Contributors

enten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

udk's Issues

EISDIR: illegal operation on a directory after updating to 0.802/8.2,0

When I build the project using the latest of angular, devkit and cli I get this error:

An error occurred during write index:
Error: EISDIR: illegal operation on a directory, open '/home/qdouble/playground/angular-universal/dist/app/browser'
    at Object.openSync (fs.js:443:3)
    at Object.writeFileSync (fs.js:1194:35)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node/host.js:176:20)
    at Observable._trySubscribe (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:30:22)
    at /home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToObservable.js:10:20
    at Object.subscribeToResult (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
    at SwitchMapSubscriber._innerSub (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/switchMap.js:65:54)
    at SwitchMapSubscriber._next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/switchMap.js:55:14)
    at SwitchMapSubscriber.Subscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:66:18)
    at SafeSubscriber.__tryOrUnsub (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:207:16)
    at SafeSubscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:145:22)
    at Subscriber._next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)
    at SafeSubscriber.__tryOrUnsub (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:207:16)
    at SafeSubscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:145:22)

It does it on my main project and I tried it on your angular-universal starter above. If I downgrade the packages to 8.1.3 it builds just fine.

udk v1

udk v1

backlog

  • rewrite with typescript
  • use webpack-plugin-compat to ensure webpack v3 and v4 compatibility
  • refactor MultiCompiler: hook Compiler.prototype.compile instead of hook compiler stage
  • container: add cli option --require to allow loaders (like ts-node/register)
  • dev container: load webpack config @webpack-contrib/config-loader
  • add support for webpack-command cli
  • make webpack-command compatible with webpack v3
  • remove extra features: webpack config extreme reloading with cli, dev container serve web assets and stats request injection

files

bin

lib

lib/util

"Module not found: Error: Can't resolve" when using import with index.ts file.

Issue reproduces only on Windows. Lunix and Mac OS works fine.

Trying to build project from https://github.com/Stivin/angular-universal

  1. Clone project.
  2. npm install
  3. npm run dev

Result:

ERROR in /C/Source/angular-universal/src/app/shared/layout/toolbar/toolbar-lang/toolbar-lang.component.ts
Module not found: Error: Can't resolve '../../../translate' in '/C/Source/angular-universal/src/app/shared/layout/toolbar/toolbar-lang'

Broken line:
import { TranslateService } from './translate';
Works fine:
import { TranslateService } from './translate/index';
or
import {TranslateService} from './translate/translate.service';

Can you please have a look?

Sumbitting issue here because I got no errors when building via ng cli commands.

normalizeFileReplacements(...).pipe is not a function with Angular 7.2

After upgrading from Angular 7.1.x to the just released 7.2 the build with UDK fails throwing the following exception:

normalizeFileReplacements(...).pipe is not a function
TypeError: normalizeFileReplacements(...).pipe is not a function
    at supportFileReplacement (/Users/heb/devel/my-project/node_modules/udk/angular/lib/udk-builder.js:32:68)
    at MergeMapSubscriber._getBuilderConfig.pipe.operators_1.concatMap [as project] (/Users/heb/devel/my-project/node_modules/udk/angular/lib/udk-builder.js:175:41)
    at MergeMapSubscriber._tryNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
    at MergeMapSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
    at InnerSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
    at /Users/heb/devel/my-project/node_modules/rxjs/internal/util/subscribeTo.js:17:28
    at Object.subscribeToResult (/Users/heb/devel/my-project/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
    at MergeMapSubscriber._innerSub (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:82:29)
    at MergeMapSubscriber._tryNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:76:14)
    at MergeMapSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
    at InnerSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
    at MapSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/map.js:55:26)
    at MapSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
    at InnerSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)

package.json.txt

WatchpackFork: killer's callback called twice

In lib/util/WatchpackFork.js, the method close() used the package killer to kill the child process.

On Windows, the callback passed to killer is called more than once: that is a source of bugs.

// udk/lib/util/WatchpackFork
// 0d5d7da on 19 Oct 2017@enten

const Watchpack2 = require('./Watchpack2')
const childProcess = require('child_process')
const killer = require('killer')

class WatchpackFork extends Watchpack2 {
  // ...
  close (callback) {
    const done = () => {
      this.child = undefined
      
      callback && callback()
    }

    return super.close(() => {
      if (!this.child) {
        return done()
      }

      killer(this.child.pid, done)
    })
  }
  // ...
}

For example, in lib/util/container.js, the method runContainer() call the method closeContainer() when the container has already a watcher (if the container is already forked): that method is called with a callback which will be called by WatchpackFork.close() when the fork process will be killed. That callback will restart the container: if it called more than once, each called will potentially starts a new fork process.

Temporary fix: we can ensure that the callback is called only once.

  close (callback) {
    let doneCalled = false // +++

    const done = () => {
      if (doneCalled) { // +++
        return // +++
      } // +++

      doneCalled = true // +++
      this.child = undefined
      
      callback && callback()
    }

    return super.close(() => {
      if (!this.child) {
        return done()
      }

      killer(this.child.pid, done)
    })
  }

Better fix: understand why killer called the callback twice under Windows and fix it.

TODO

extractCss no longer working

If I build the browser and server separately, the css gets extracted just fine, but when I build with udk, while it seems to work fine with the dev server, the css doesn't get put into the head tag when doing a regular build.

Using:

    "@angular-devkit/build-angular": "~0.801.0",
    "@angular/cli": "~8.1.0",
    "udk": "^1.1.4",

MultiCompiler: fix HMR on server side for webpack4

Source of the issue : lib/MultiCompiler.js

HMR on server side is broken for webpack4 when the server bundle hot reload a file which was already hot reloaded by a bundle dependency.

The event which hold hot updates is lost during waiting time.

Server Bundle ---> Shared Module <-- Client Bundle
      |                                    ^
      +------------------------------------+
  udk:client:cpl null invalid +3s
webpack building...
  udk:server:cpl null invalid +3s
webpack building...
  udk:client:cpl 8 watchRun +204ms
  udk:client:cpl 9 normalModuleFactory +1ms
  udk:client:cpl 10 contextModuleFactory +1ms
  udk:client:cpl 11 beforeCompile +0ms
  udk:client:cpl 12 compile +0ms
  udk:client:cpl 13 thisCompilation +1ms
  udk:client:cpl 14 compilation +1ms
  udk:client:cpl 15 make +2ms
  udk:server:cpl 8 watchRun +213ms
  udk:server:cpl wait for compiler 'client' +0ms
  udk:client:cpl 16 afterCompile +23ms
  udk:client:cpl 17 shouldEmit +0ms
  udk:client:cpl 19 emit +0ms
  udk:client:cpl 20 afterEmit +2ms
  udk:ctnr:fork update client stats +3s
  udk:client:cpl 21 done +3ms
  udk:server:cpl waiting ended for compiler 'client' +25ms
  udk:client:cpl invalid compiler 'server' due to change { fileName: '/home/steven/code/udk/examples/basic/src/shared.js', changeTime: 1522507183373 } +1ms
  udk:server:cpl null invalid +0ms
webpack building...
  udk:ctnr:fork compiler watching +4ms
  udk:server:cpl 9 normalModuleFactory +6ms
  udk:server:cpl 10 contextModuleFactory +0ms
  udk:server:cpl 11 beforeCompile +0ms
  udk:server:cpl 12 compile +1ms
  udk:server:cpl 13 thisCompilation +0ms
  udk:server:cpl 14 compilation +1ms
  udk:server:cpl 15 make +0ms
  udk:server:cpl 16 afterCompile +13ms
  udk:server:cpl 8 watchRun +0ms
  udk:server:cpl 9 normalModuleFactory +1ms
  udk:server:cpl 10 contextModuleFactory +0ms
  udk:server:cpl 11 beforeCompile +0ms
  udk:server:cpl 12 compile +0ms
  udk:server:cpl 13 thisCompilation +0ms
  udk:server:cpl 14 compilation +1ms
  udk:server:cpl 15 make +0ms
  udk:server:cpl 16 afterCompile +7ms
  udk:server:cpl 17 shouldEmit +0ms
  udk:server:cpl 19 emit +0ms
  udk:server:cpl 20 afterEmit +2ms
  udk:server:cpl 21 done +1ms
webpack built client e923e801f199865a2b0b in 31ms
webpack built server f920487f814020a1421a in 12ms
  udk:ctnr:fork compiler watching +37ms

How to omit "source-map"?

When running ng serve, I got:

Unknown option: '--source-map'

After a few minutes of Googling, I have tried an another approach with changes of angular.json as below:

...
{
  "serve": {
    "builder": "udk:udk-runner",
    "options": {
      "sourceMap": {
        "scripts": false,
        "styles": false
      }
    },
    "configurations": {}
  }
}
...

When running ng serve, I got these following errors:

Schema validation failed with the following errors:
  Data path "" should NOT have additional properties(sourceMap).

compatibility with @angular 8.1.0-rc.0

When updating to @next version angular, I'm getting the following error: An unhandled exception occurred: Cannot read property 'assertCompatibleAngularVersion' of undefined

The CLI outputs this error log:

[error] TypeError: Cannot read property 'assertCompatibleAngularVersion' of undefined
    at buildUniversal (/home/marketstripe/Sites/polysolo-workspace/node_modules/udk/angular/lib/udk-builder.js:25:25)
    at onInput (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular-devkit/architect/src/create-builder.js:145:30)
    at SafeSubscriber.context.inboundBus.subscribe.i [as _next] (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular-devkit/architect/src/create-builder.js:63:29)
    at SafeSubscriber.__tryOrUnsub (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:207:16)
    at SafeSubscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:145:22)
    at Subscriber._next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Object.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/observable/onErrorResumeNext.js:22:49)
    at SafeSubscriber.__tryOrUnsub (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:207:16)
    at SafeSubscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:145:22)
    at Subscriber._next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
    at ReplaySubject.Subject.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subject.js:60:25)
    at ReplaySubject.nextInfiniteTimeWindow (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/ReplaySubject.js:48:31)
    at Object.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/operators/shareReplay.js:33:50)
    at SafeSubscriber.__tryOrUnsub (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:207:16)

So Version is coming up undefined here:

Version.assertCompatibleAngularVersion(context.workspaceRoot);

Angular 9 Update?

Hey...I tried to see if I can start working with Angular 9 now that it is in rc, but udk doesn't work with it. Any plans to make it compatible soon?

Node 10/11 Support

Hi, do you have an idea of supporting Node 10/11? Package fails to install on Node 10 since you have engines defined in package.json

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.