aurelia / validation

A validation plugin for Aurelia.
MIT License
132 stars 129 forks source link

Extract ValidationGroupBuilder dependency from ValidationGroup #147

Closed JeroenVinke closed 8 years ago

JeroenVinke commented 9 years ago

The typescript definition generator doesn't like circular dependencies (between ValidationGroupBuilder and ValidationGroup). It is throwing this error:

Error: validation-group.js can not come before validation-group-builder.js
    at C:\Development\validation\node_modules\aurelia-tools\node_modules\breeze-
dag\node_modules\gaia-tsort\lib\tsort.js:92:15
    at Array.forEach (native)
    at doVisit (C:\Development\validation\node_modules\aurelia-tools\node_module
s\breeze-dag\node_modules\gaia-tsort\lib\tsort.js:90:19)
    at C:\Development\validation\node_modules\aurelia-tools\node_modules\breeze-
dag\node_modules\gaia-tsort\lib\tsort.js:95:7
    at Array.forEach (native)
    at doVisit (C:\Development\validation\node_modules\aurelia-tools\node_module
s\breeze-dag\node_modules\gaia-tsort\lib\tsort.js:90:19)
    at C:\Development\validation\node_modules\aurelia-tools\node_modules\breeze-
dag\node_modules\gaia-tsort\lib\tsort.js:95:7
    at Array.forEach (native)
    at doVisit (C:\Development\validation\node_modules\aurelia-tools\node_module
s\breeze-dag\node_modules\gaia-tsort\lib\tsort.js:90:19)
    at C:\Development\validation\node_modules\aurelia-tools\node_modules\breeze-
dag\node_modules\gaia-tsort\lib\tsort.js:95:7

You get this error when you add import {ValidationGroup} from './validation-group'; to validation-group-builder.js. Since ValidationGroup imports the builder, you get the circular dependency.

Should we try and fix this in the build or can we refactor the ValidationGroupBuilder dependency out of ValidationGroup?\

plwalters commented 9 years ago

@cmichaelgraham do you remember the workaround for this?

cmichaelgraham commented 9 years ago

@PWKad - when the output is combined into a single file like the other aurelia repos, this problem will be resolved. not sure what to do until then...

plwalters commented 9 years ago

Ok thanks I'll see if we can get the built version soon, thanks!

plwalters commented 8 years ago

Thanks for submitting this / commenting on this. At this time we are closing this because we have completely re-written and are deprecating the previous feature set. If you feel this should be re-opened please feel free to review this blog post and submit either again on this repository, or on the new validatejs bridge repository

Thanks again!