Skip to content

Instantly share code, notes, and snippets.

@sjmiles
Last active June 7, 2018 00:55
Show Gist options
  • Select an option

  • Save sjmiles/f14ec792b9766fbb04ff to your computer and use it in GitHub Desktop.

Select an option

Save sjmiles/f14ec792b9766fbb04ff to your computer and use it in GitHub Desktop.

Revisions

  1. Scott J. Miles revised this gist Jun 7, 2018. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    ## Polymer Magic Server
    ## Polygit

    The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature.
    > Polygit is deprecated and only compatible with Bower and Polymer 1.0 & Polymer 2.0.
    > As an alternative, use this [Glitch](https://glitch.com/edit/#!/polymer-repro) to load dependencies via Bower.
    Polygit serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature.

    Examples:

    @@ -85,4 +88,4 @@ Pull all `super-` elements from `sjmiles` org: `super*+sjmiles`

    `http://polygit.org/polymer+:master/super*+sjmiles+*/paper-button+v1.0.2/components/`

    Remember that all URLs hitting the magic server must contain the complete configuration.
    Remember that all URLs hitting the magic server must contain the complete configuration.
  2. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -8,13 +8,15 @@ Examples:

    ```html
    <base href="http://polygit.org/polymer+:master/components/">

    <link href="polymer/polymer.html" rel="import">
    ```

    **Load polymer v1.0.3, load latest release of _vellum-*_ from _sjmiles_ org**

    ```html
    <base href="http://polygit.org/polymer+v1.0.3/vellum-*+sjmiles+*/components/">

    <link href="polymer/polymer.html" rel="import">
    <link href="vellum-grid/vellum-grid.html" rel="import">
    ```
  3. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 32 additions and 5 deletions.
    37 changes: 32 additions & 5 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,33 @@
    ## Polymer Magic Server

    The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature.
    The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature.

    Examples:

    **Load polymer from _master_ branch (full debug mode)**

    ```html
    <base href="http://polygit.org/polymer+:master/components/">
    <link href="polymer/polymer.html" rel="import">
    ```

    **Load polymer v1.0.3, load latest release of _vellum-*_ from _sjmiles_ org**

    ```html
    <base href="http://polygit.org/polymer+v1.0.3/vellum-*+sjmiles+*/components/">
    <link href="polymer/polymer.html" rel="import">
    <link href="vellum-grid/vellum-grid.html" rel="import">
    ```

    ### Features:
    * stateless, stores nothing
    * maintenance free (modulo GitHub API access limits)
    * only serves files from `cdn.rawgit.com`

    ### Constraints:
    * configuration must be embedded in all request URLs
    * does no dependency resolution, user configuration is absolute
    * only serves files from `cdn.rawgit.com`

    This implementation uses a _fat URL_ scheme, where the user configuration is contained entirely in each URL (making the URLs potentially quite long). Other implementations may be possible using cookies or other schemes to eliminate the need for fat URLs.

    @@ -10,17 +37,17 @@ This server concept is primarily for hit-and-run testing, jsbins, etc. The perfo

    `<server-name>/[<configurations>/]components/<component>/<path>`

    Currently a server is stood up at `polymer-magic-server.appspot.com`. `components` is literal. `<component>/<path>` is the canonical path to a component resource.
    Currently a server is stood up on app-engine at `polymer-magic-server.appspot.com`, which is aliased as `polygit.org`. `components` is literal. `<component>/<path>` is the canonical path to a component resource.

    Example using defaults (no `<configurations>`):

    ```html
    <link href="http://polymer-magic-server.appspot.com/components/polymer/polymer.html" rel="import">
    <link href="http://polygit.org/components/polymer/polymer.html" rel="import">
    ```
    Because the URL quickly becomes unwieldy, using `<base>` tag is recommended.

    ```html
    <base href="http://polymer-magic-server.appspot.com/components/">
    <base href="http://polygit.org/components/">

    <link href="polymer/polymer.html" rel="import">
    ```
    @@ -54,6 +81,6 @@ Pull all `super-` elements from `sjmiles` org: `super*+sjmiles`

    ### Example base URL with multiple configurations

    `http://polymer-magic-server.appspot.com/polymer+:master/super*+sjmiles+*/paper-button+v1.0.2/components/`
    `http://polygit.org/polymer+:master/super*+sjmiles+*/paper-button+v1.0.2/components/`

    Remember that all URLs hitting the magic server must contain the complete configuration.
  4. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pms.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a

    This implementation uses a _fat URL_ scheme, where the user configuration is contained entirely in each URL (making the URLs potentially quite long). Other implementations may be possible using cookies or other schemes to eliminate the need for fat URLs.

    This server is primarily for hit-and-run testing, jsbins, etc. The performance is less than ideal.
    This server concept is primarily for hit-and-run testing, jsbins, etc. The performance is less than ideal and there is very little error reporting or other niceties.

    ### Basic Usage

  5. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pms.md
    Original file line number Diff line number Diff line change
    @@ -54,6 +54,6 @@ Pull all `super-` elements from `sjmiles` org: `super*+sjmiles`

    ### Example base URL with multiple configurations

    `http://polymer-magic-server.appspot.com/polymer+:master/super*-sjmiles-*/paper-button+v1.0.2/components/`
    `http://polymer-magic-server.appspot.com/polymer+:master/super*+sjmiles+*/paper-button+v1.0.2/components/`

    Remember that all URLs hitting the magic server must contain the complete configuration.
  6. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    ## Polymer Magic Server

    The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature. This implementation uses a _fat URL_ scheme, where the user configuration is contained entirely in each URL (making the URLs potentially quite long).
    The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature.

    Other implementations may be possible using cookies or other schemes to eliminate the need for fat URLs.
    This implementation uses a _fat URL_ scheme, where the user configuration is contained entirely in each URL (making the URLs potentially quite long). Other implementations may be possible using cookies or other schemes to eliminate the need for fat URLs.

    This server is primarily for hit-and-run testing, jsbins, etc. The performance is less than ideal.

  7. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@ The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a

    Other implementations may be possible using cookies or other schemes to eliminate the need for fat URLs.

    This server is primarily for hit-and-run testing, jsbins, etc. The performance is less than ideal.

    ### Basic Usage

    `<server-name>/[<configurations>/]components/<component>/<path>`
  8. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -33,25 +33,25 @@ Default configuration is to use serve the latest **release** version for each co

    `<configurations>` are a series of configuration directives `<config1>[/<config2>...]`.

    Each `<config>` looks like `<component>[+<org>]+<ver>|master|*`.
    Each `<config>` looks like `<component>[+<org>]+<ver>|:<branch>|*`.

    `master` means pull from latest SHA on master branch.
    `:<branch>` means pull from latest SHA on `<branch>`.
    `*` means pull latest release.

    Examples,

    Pull `polymer` from default org, `master` branch: `polymer+master`
    Pull `polymer` from default org, `master` branch: `polymer+:master`
    Pull `super-gif` from `sjmiles` org, latest release: `super-gif+sjmiles+*`
    Pull `paper-button` from default org, `v1.0.2` release: `paper-button+v1.0.2`

    Note: if `<org>` is specified, do not forget to also include version information (`+<ver>|master|*`).
    Note: if `<org>` is specified, do not forget to also include version information (`+<ver>|:<branch>|*`).

    Wilcards are supported in `component`

    Pull all `super-` elements from `sjmiles` org: `super*+sjmiles`

    ### Example base URL with multiple configurations

    `http://polymer-magic-server.appspot.com/polymer+master/super*-sjmiles-*/paper-button+v1.0.2/components/`
    `http://polymer-magic-server.appspot.com/polymer+:master/super*-sjmiles-*/paper-button+v1.0.2/components/`

    Remember that all URLs hitting the magic server must contain the complete configuration.
  9. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion pms.md
    Original file line number Diff line number Diff line change
    @@ -23,6 +23,8 @@ Because the URL quickly becomes unwieldy, using `<base>` tag is recommended.
    <link href="polymer/polymer.html" rel="import">
    ```

    http://jsbin.com/wihame/edit?html,output

    ### Default Configuration

    Default configuration is to use serve the latest **release** version for each component. An organization is automatically selected for `polymer`, `webcomponents*`, `google-*` components. All other components are assumed to be `PolymerElements`.
    @@ -53,4 +55,3 @@ Pull all `super-` elements from `sjmiles` org: `super*+sjmiles`
    `http://polymer-magic-server.appspot.com/polymer+master/super*-sjmiles-*/paper-button+v1.0.2/components/`

    Remember that all URLs hitting the magic server must contain the complete configuration.

  10. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pms.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ Example using defaults (no `<configurations>`):
    ```html
    <link href="http://polymer-magic-server.appspot.com/components/polymer/polymer.html" rel="import">
    ```
    Because the URL quickly becomes unwieldy, using `<base>` tags is recommended.
    Because the URL quickly becomes unwieldy, using `<base>` tag is recommended.

    ```html
    <base href="http://polymer-magic-server.appspot.com/components/">
  11. Scott J. Miles revised this gist Jun 25, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@ Other implementations may be possible using cookies or other schemes to eliminat

    `<server-name>/[<configurations>/]components/<component>/<path>`

    Currently a server is stood up at `polymer-magic-server.appspot.com` (use this for `<server-name>`). `components` is literal. `<component>/<path>` is the canonical path to a component resource.
    Currently a server is stood up at `polymer-magic-server.appspot.com`. `components` is literal. `<component>/<path>` is the canonical path to a component resource.

    Example using default configuration (no `<configurations>`):
    Example using defaults (no `<configurations>`):

    ```html
    <link href="http://polymer-magic-server.appspot.com/components/polymer/polymer.html" rel="import">
  12. Scott J. Miles created this gist Jun 25, 2015.
    56 changes: 56 additions & 0 deletions pms.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    ## Polymer Magic Server

    The _Magic Server_ serves files directly from github (via `cdn.rawgit.com`) in a manner that is compatible with HTML Imports natural deduplication feature. This implementation uses a _fat URL_ scheme, where the user configuration is contained entirely in each URL (making the URLs potentially quite long).

    Other implementations may be possible using cookies or other schemes to eliminate the need for fat URLs.

    ### Basic Usage

    `<server-name>/[<configurations>/]components/<component>/<path>`

    Currently a server is stood up at `polymer-magic-server.appspot.com` (use this for `<server-name>`). `components` is literal. `<component>/<path>` is the canonical path to a component resource.

    Example using default configuration (no `<configurations>`):

    ```html
    <link href="http://polymer-magic-server.appspot.com/components/polymer/polymer.html" rel="import">
    ```
    Because the URL quickly becomes unwieldy, using `<base>` tags is recommended.

    ```html
    <base href="http://polymer-magic-server.appspot.com/components/">

    <link href="polymer/polymer.html" rel="import">
    ```

    ### Default Configuration

    Default configuration is to use serve the latest **release** version for each component. An organization is automatically selected for `polymer`, `webcomponents*`, `google-*` components. All other components are assumed to be `PolymerElements`.

    ### Custom Configurations

    `<configurations>` are a series of configuration directives `<config1>[/<config2>...]`.

    Each `<config>` looks like `<component>[+<org>]+<ver>|master|*`.

    `master` means pull from latest SHA on master branch.
    `*` means pull latest release.

    Examples,

    Pull `polymer` from default org, `master` branch: `polymer+master`
    Pull `super-gif` from `sjmiles` org, latest release: `super-gif+sjmiles+*`
    Pull `paper-button` from default org, `v1.0.2` release: `paper-button+v1.0.2`

    Note: if `<org>` is specified, do not forget to also include version information (`+<ver>|master|*`).

    Wilcards are supported in `component`

    Pull all `super-` elements from `sjmiles` org: `super*+sjmiles`

    ### Example base URL with multiple configurations

    `http://polymer-magic-server.appspot.com/polymer+master/super*-sjmiles-*/paper-button+v1.0.2/components/`

    Remember that all URLs hitting the magic server must contain the complete configuration.