eh

ember-hellgate

This addon helps you migrate an old application to Ember. It lets you define routes that load plain html pages inside an Ember app.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

15

Maintenance

Last Commit

6yrs ago

Contributors

4

Package

Dependencies

2

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

ember-hellgate Build Status

This addon helps you migrate an old application to Ember. It lets you define routes that load plain html pages inside an Ember app.

Pages loaded in a hellgate are loaded inside an iframe, so, they're totally isolated from the Ember app.

The objective of this addon is to let you create an Ember app that links to pages of the old system and, as you migrate each page to Ember, you replace the "hellgate" with normal routes.

Install

ember install ember-hellgate

Defining hellgates

In the router you call this.hellgate(route, url) to define the name of the route and the url that should be loaded.

// app/router.js
Router.map(function() {
  this.hellgate('some-page', '/somepage.html');
  this.hellgate('my-search', 'http://apple.com');
});

Escaping hell

The page loaded inside a "hellgate" can call actions of the route. For that, you should use the function escapeHell.

// app/router.js
Router.map(function() {
  this.hellgate('test', '/test.html');
});
<!-- test.html (Page loaded inside a hellgate) -->
<html>
  <body>
    <span>Escape hell</span>
    <script type="text/javascript">
      window.parent.escapeHell('showMessage', 'Hello');
    </script>
  </body>
</html>
// app/routes/test.js
export default Ember.Route.extend({
  actions: {
    showMessage(message) {
      alert(`Message from hell: ${message}`);
    }
  }
});

Styling the hellgate

The hellgate generates the following HTML:

<div class="hellgate-container">
  <iframe class="hellgate-iframe" src="..."></iframe>
</div>

So you can define styles for the container and for the iframe:

.hellgate-container {
  width: 100px;
  height: 400px;
  border: 1px solid red;
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100