Skip to content

chore: re-arrange sources to better reflect npm package and import paths #3713

Closed

Description

@jeffbcross

See this comment for details.

Essentially, the folder structure should be updated to look like this:

- modules/
--- angular2/
----- core/
----- forms/
----- http/...
----- router/...
----- web-worker/...
--- benchmarks/...
--- benchmarks_external/...
--- benchpress/...
--- examples/...
--- material2/...
--- rtts_assert/... (deprecated)
--- transforms/...

TODO:

  • Move docs outside of angular2.
  • Break test_lib and mocks into separate bundle-specific test folders, http_test, core_test, router_test.
  • Add Breaking Change notes to commits
  • Release ts2dart with updated paths chore: update facade paths to new paths in core dart-archive/ts2dart#266
  • Remove superfluous top-level exports
  • Add new public API exports to respective files/bundles.
  • Clean up the decorators spec to not leak between specs angular2/test/core/util/decorators spec "should not apply decorators from the prototype chain".
  • Manually test npm version of benchpress after all changes (it depends on di)
  • Test angular.io to make sure correct paths are reflected
  • Maybe re-write all angular2/angular2 imports to be more specific.
  • Update test paths to reflect src
  • Consolidate exports in src folders (to reduce redundancy between core and core_no_render exports).

Activity

  1. self-assigned this
    on Aug 19, 2015
  2. added this to the alpha-36 milestone on Aug 19, 2015
  3. gkalpak commented on Aug 19, 2015

    @gkalpak
    Member

    It would be nice to be consistent with filename separators (e.g. web-worker vs rtts_assert (- vs _)).

  4. mhevery commented on Aug 20, 2015

    @mhevery
    Contributor

    Rename web-worker to web_worker
    I think we should also make angular2/directives and angular2/pipes because they could technically be outside of the core.

  5. jeffbcross commented on Aug 21, 2015

    @jeffbcross
    ContributorAuthor

    K.

    I made some progress on the transition on this branch but have an issue with parse5Adapter not correctly setting DOM in time for application_spec. I'll have to revisit next week.

    I also started on removing src and test, but will take care of that after moving everything around.

  6. jeffbcross commented on Aug 24, 2015

    @jeffbcross
    ContributorAuthor

    I resolved blockers with test.unit.cjs and test.unit.js. Now on to fixing dart issues.

  7. 4 remaining items

  8. jeffbcross commented on Aug 25, 2015

    @jeffbcross
    ContributorAuthor

    Update: After updating ts2dart, there are still some issues I'm working through. This is the latest failing job: https://travis-ci.org/angular/angular/builds/77102478

    Some problems:

    • @Inject decorators being left in constructors where they shouldn't be.
    • Some unused dart imports
    • http.d.ts type declarations being interpreted as type-alias, so test is faliling
    • Some decorators/compiler unit tests are failing because of mismatched number expectations.
  9. jeffbcross commented on Aug 25, 2015

    @jeffbcross
    ContributorAuthor

    Some issues have been resolved.

    • @Inject was a matter of the decorator being imported instead of annotation.
    • The http.d.ts problem was an existing problem that hasn't been tested. The problem has been temporarily fixed with an issue fix(dgeni): correctly export type declarations #3828 opened for long-term fix.
  10. jeffbcross commented on Aug 26, 2015

    @jeffbcross
    ContributorAuthor

    I've merged the initial work of moving folders around, and am working on the rest of the TODOs in this issue. 5f6b7ff...8ed22ce

  11. jeffbcross commented on Sep 1, 2015

    @jeffbcross
    ContributorAuthor

    @mhevery in moving the default pipes outside of core, I assume I'll keep the DEFAULT_PIPES_TOKEN inside of core, bound to an empty list? The compiler relies on this binding so that it can flatten a View's pipes and the default pipes. So if a user wanted to use the default pipes, they would override the binding like so:

    bootstrap(MyComponent, [
      bind(DEFAULT_PIPES_TOKEN).toAlias(DEFAULT_PIPES)
    ]);
  12. mhevery commented on Sep 1, 2015

    @mhevery
    Contributor

    @jeffbcross Pipes and Directives should be set up same way. Since directives are part of the core, I think pipes should be as well.

  13. jeffbcross commented on Sep 1, 2015

    @jeffbcross
    ContributorAuthor

    Recapping VC with @mhevery:

    • Moving forms into core, and adding default bindings to root injector.
    • Keeping Pipes in core and keeping pipes' bindings in root injector.
    • Keeping directives in core bundle
    • angular2 bundle will include core, http, router concatenated, but will not include http and router bindings by default.

    Bundles:

    |- angular2.js
    |--- core.js
    |--- core_no_render.js
    |--- http.js
    |--- router.js
    |--- web_worker.js
    

    Plus testing bundles

  14. modified the milestones: alpha-36, alpha-37 on Sep 1, 2015
  15. jeffbcross commented on Sep 8, 2015

    @jeffbcross
    ContributorAuthor

    Closing this as the major work has been landed as of f14b212, and several follow-up issues have been filed:

  16. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  17. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions