dart-archive / web-components

Dart package providing the web components platform polyfills
https://pub.dartlang.org/packages/web_components
BSD 3-Clause "New" or "Revised" License
18 stars 10 forks source link

pub serve hangs forever after a change (using the web-components transformer) #27

Closed kasperpeulen closed 9 years ago

kasperpeulen commented 9 years ago

pub serve hangs forever after a change (using the web-components transformer)

similar to these issues: https://github.com/angular/angular.dart/issues/1709 https://github.com/angular/angular.dart/issues/1276

jakemac53 commented 9 years ago

Re-opening this as we should try to fix the actual issue. The current fix creates a new resolver every time, which is probably going the have bad performance implications.

kasperpeulen commented 9 years ago

@jakemac53 For me, the deadlock occurs in this method: https://github.com/dart-lang/code_transformers/blob/master/lib/src/resolvers.dart#L54

If I don't run this method, the deadlock won't occur. If I run this method (and if don't do anything else after running this method), the deadlock occurs.

If I change:

var resolver = _resolvers.putIfAbsent(
      id, () => new ResolverImpl(dartSdk, dartUriResolver, options: options));

to

var resolver = new ResolverImpl(dartSdk, dartUriResolver, options: options));

then everything goes fine as well

jakemac53 commented 9 years ago

Thanks for investigating this, the actual problem is we were never releasing the resolver inside our web_components transformer :). You can see a mention of that in the comments for that method. I will work on a pull request and release a new version asap.

jakemac53 commented 9 years ago

published as 0.12.0+1