Open meek0 opened 5 years ago
Considering that webpack is a module loader, we would need to either add imports for all modules or use grunt to concatenate all files and use that file as module (or use a similar tactic).
It seems that Angular is using angular-cli to build apps instead of webpack or systemJs as they mentioned in their docs (it also seems like their docs are not up to date).
A stackoverflow answer seems to have a feasible hybrid solution solution.
Some of our dependencies have import problems when using webpack with some module imports. Need to investigate further.
Using this, this and this as base.
The strategy would entail:
npm install --save angular@1.6.9 angular-animate@1.6.9 angular-cookies@1.6.9 angular-i18n@1.6.9 angular-resource@1.6.9 angular-route@1.6.9 angular-sanitize@1.6.9
npm install --save modernizr jquery@2.2.4 angular-ui-bootstrap@2.5.0 angular-chosen-localytics@1.8.0 angular-loading-bar@0.9.0 angular-nvd3@1.0.9 angular-translate@2.17.0 angular-translate-loader-static-files@2.17.0 angular-translate-storage-cookie@2.17.0 ui-select@0.19.8 angular-ui-sortable@0.19.0 bootstrap@3.3.7 bootswatch@3.3.7 font-awesome@4.7.0 jquery-ui@1.12.1 json3@3.3.2 ng-file-upload@12.2.13 https://github.com/obiba/mica-study-timeline.git#1.0.5 https://github.com/obiba/ng-obiba.git#1.9.4 https://github.com/obiba/ng-obiba-mica.git#master filesize@3.6.0 ngclipboard angular-utils-pagination@0.11.1 angular-local-storage@0.7.1 angular-schema-form@0.8.13 https://github.com/obiba/angular-schema-form-bootstrap.git#1.1.4 https://github.com/obiba/angular-schema-form-ui-ace.git#v0.1.2 angular-ui-ace@0.2.3 angular-moment@1.2.0 https://github.com/obiba/angular-schema-form-datetimepicker.git#0.1.9 angular-xeditable@0.8.1 angular-media-queries@0.6.1 https://github.com/obiba/sf-localized-string.git#1.3.3 https://github.com/obiba/sf-obiba-file-upload.git#1.1.3 https://github.com/obiba/sf-checkboxgroup.git#1.0.1 https://github.com/obiba/sf-typeahead.git#1.1.1 https://github.com/obiba/sf-obiba-countries-ui-select.git#1.0.3 https://github.com/obiba/sf-radio-group-collection.git#master https://github.com/obiba/obiba-shims.git#1.0.0
with typescript and utilities as dev dependencies
- "modularize" the project (create module files and import the assets, be it the templates, the styles or the assets)
- create a main Angular project with angular-cli that will bootstrap the old AngularJs project
- use ngUprade to bootstrap the AngularJs project
- use angular-cli to build the whole thing
Would need to learn angular-cli at least to configure the build (the Angular part of the project should be minimal, enough to bootstrap the AngularJs project and maybe apply some configuration).
Must check that angular-cli can build a minified file with our old AngularJs projects (e.g. ng-obiba-mica, ng-obiba), webpack had problems doing so natively (had to use the raw-loader and even then it seems that all it does is call `eval` on the library).
Follow Angular's guide.
Angular and AngularJs will have to be run side by side, a hybrid application. Main app must use typescript, additional migration (component) might be required.
Using a module loader is recommended (webpack is most used). Will have to remove grunt and bower dependencies.