Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group Issue: refactoring #10

Open
4 tasks
shlomiassaf opened this issue Oct 1, 2016 · 2 comments
Open
4 tasks

Group Issue: refactoring #10

shlomiassaf opened this issue Oct 1, 2016 · 2 comments

Comments

@shlomiassaf
Copy link

shlomiassaf commented Oct 1, 2016

To provide an easy to use, productive and dev friendly seed here are some suggested refactoring.
Each suggestion has an issue attached, this issue is used for managing the issues:

The ES5 version will be used when importing the package, this is done by setting

    "main": "path-to-es5-bundle.js`

in package.json

The ES6 version is a modular option that a developer need to opt-in to use, however it also plays a part in the ES5 UMD bundle.

When developing, user will usually:

import { Something } from 'my-lib'

The UMD bundle is used, it has no type information but the ES6 version does. The ES6 version comes with d.ts files and they are referenced inside package.json

  "typings": "esm/index.d.ts",

The ES6 version also hold *.metadata.json files so it provides support for AoT compilation.
Since main property references the UMD bundle we use the module property to make sure ES6 module syntax code get the modular ES6 version and not the UMD bundle (so AoT can work)

@NathanWalker
Copy link
Collaborator

NathanWalker commented Oct 2, 2016

Thanks @shlomiassaf !

@shlomiassaf
Copy link
Author

@NathanWalker I'm talking about a demo app that consumes a lib.

See https://github.com/shlomiassaf/angular2-modal/tree/master/src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants