Skip to content

fix(bundles): clean-up and re-organize UMD bundles#5697

Closed
pkozlowski-opensource wants to merge 1 commit into
angular:masterfrom
pkozlowski-opensource:sfx_cleanup
Closed

fix(bundles): clean-up and re-organize UMD bundles#5697
pkozlowski-opensource wants to merge 1 commit into
angular:masterfrom
pkozlowski-opensource:sfx_cleanup

Conversation

@pkozlowski-opensource
Copy link
Copy Markdown
Member

Fixes #5593
Part of #5665

BREAKING CHANGE:

Number and content of UMD bundles have changed:

  • we only publish one bundle that contains: core, common, platform/browser, http, router, instrumentation and upgrade
  • exported names have changed and now:
    • core is exported as ng.core
    • common is exported as ng.common
    • platform/browser is exported as ng.platform.browser
    • http is exported as ng.http
    • router is exported as ng.router
    • instrumentation is exported as ng.instrumentation
    • upgrade is exported as ng.upgrade

@pkozlowski-opensource
Copy link
Copy Markdown
Member Author

This PR, when merged will leave us with publishing only one UMD bundle. This one UMD bundle should replace our current SFX bundle, as discussed in #5665 (a separate PR with removal will follow).

This PR also fixes #5593 - @rkirov could you please check if the exports and their layouts are what you need for your work?

As requested by @IgorMinar we don't leave bundle entry point file in our modules/angular2 tree so people won't be able to import from it etc.

@pkozlowski-opensource
Copy link
Copy Markdown
Member Author

@IgorMinar this PR differs slightly from the proposal described in #5665 as it doesn't implement:

reexport via the ng namespace the most commonly needed stuff used for defining components, directives, pipes and services via chained DSL. This should be just a handful of symbols and we should document that they are being reexported in ES5 bundles for convenience.

It might not be necessary as chaining looks good IMO, here is example of a simple app in ES5 with a bundle from this PR:

 var MyComponent = ng.core.Component({
      selector: 'my-app',
      template: '' +
      '<h1>Hello, {{name}}!</h1>' +
      ' Say hello to: <input [value]="name" (input)="name = $event.target.value">' +
      ''
    }).Class({constructor: function() {
      this.name = 'World';
    }});

    ng.platform.browser.bootstrap(MyComponent);

@pkozlowski-opensource pkozlowski-opensource added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 8, 2015
@pkozlowski-opensource
Copy link
Copy Markdown
Member Author

@vsavkin I can see that as part of 4ea5b6e you've added angular2/router/router_link_dsl.js to UMD bundles. I'm not sure why it is needed so didn't include it in this PR.

It is also related to #5700 where we've got some exports in angular2/angular2 that are "suspicious" and didn't make it to bundles from this PR.

Could you help me with those 2 items?

@pkozlowski-opensource pkozlowski-opensource added this to the beta.0 milestone Dec 8, 2015
@vsavkin
Copy link
Copy Markdown
Contributor

vsavkin commented Dec 8, 2015

angular2/router/router_link_dsl.js

It has to be included

Comment thread gulpfile.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if dev and prod are the same right now, then why publish both?

let's drop prod?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prod and dev are not the same any more. Dev got in-lined source maps, so I believe that we need both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right (as always), ignore me

@IgorMinar
Copy link
Copy Markdown
Contributor

the rest looks good. can you send a follow up PR that adds markdown file into the repo with a table describing what is contained in what bundle.

thanks!

@IgorMinar
Copy link
Copy Markdown
Contributor

we'll later move the table to the dev guide but let's just publish it under https://github.com/angular/angular/tree/master/modules/angular2/docs for now

Fixes angular#5593
Part of angular#5665

BREAKING CHANGE:

Number and content of UMD bundles have changed:
- we only publish one bundle that contains: core, common, platform/browser, http, router, instrumentation and upgrade
- exported names have changed and now:
  - core is exported as `ng.core`
  - common is exported as `ng.common`
  - platform/browser is exported as `ng.platform.browser`
  - http is exported as `ng.http`
  - router is exported as `ng.router`
  - instrumentation is exported as `ng.instrumentation`
  - upgrade is exported as `ng.upgrade`
@IgorMinar
Copy link
Copy Markdown
Contributor

+1 to not reexporting Component and friends for now. let's see if ng.core.Component is sufficient.

@pkozlowski-opensource pkozlowski-opensource added pr_state: LGTM action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 8, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor

Lgtm

@mary-poppins
Copy link
Copy Markdown

Merging PR #5697 on behalf of @jelbourn to branch presubmit-jelbourn-pr-5697.

@mary-poppins
Copy link
Copy Markdown

Merging PR #5697 on behalf of @jelbourn to branch presubmit-jelbourn-pr-5697.

@IgorMinar IgorMinar assigned jelbourn and unassigned IgorMinar Dec 8, 2015
@IgorMinar IgorMinar added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 8, 2015
@angular-automatic-lock-bot
Copy link
Copy Markdown

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

angular2_all.umd.dev.js exports only Router symbols on the window.ng object

6 participants