Skip to content
This repository was archived by the owner on Mar 29, 2018. It is now read-only.
This repository was archived by the owner on Mar 29, 2018. It is now read-only.

Discussion: vendor deps #140

@stefanpenner

Description

@stefanpenner

It would be great if we could streamline the usage of foreign modules.

I realize this isn't entirely the responsibility of this project, but some aspects will require changes here, and others will likely happen outside (likely via integrations)

Anyways, this is likely a good place to have this chat.

Scenario:

task.js

import { Promise } from 'rsvp';

// task.js stuff

expected outcomes:

  1. bundle build: should inline RSVP
  2. AMD/CJS/System build: should be built without RSVP

actual outcomes:

  1. is awkward, some conventions here would be nice.
  2. asserts due to missing module rsvp

thoughts:

  1. can be solve by browserify (or browserify like step)
  2. can be solved by marking a module as vendored. In the node world, the node resolution algorithm assumes relative paths to be package local, and absolute paths to be foreign. This provides us with the marker needed to detect vendor'd vs package local. Seems like following this pattern is a good idea.

another note: JSPM uses the ~ operator, to annotate the current project root this might work nicely to provide a root without confusing what might be vendored.

It seems like we may need the concept of a foreign module, one that defers to the formatter on how to resolve. The bundle case would need to materialize and inline, and the AMD/CJS would maybe just validate import/export statements but not bother materializing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions