Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-ast-hot-load

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-ast-hot-load

Ember components hot-reload addon

  • 0.0.17
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
93
decreased by-13.08%
Maintainers
1
Weekly downloads
 
Created
Source

ember-ast-hot-load

Components hot-reloading

Main Idea of this addon - ad-hock components transformation.

glimmer hot-reload test #1

glimmer hot-reload test #2

https://github.com/adopted-ember-addons/ember-cli-hot-loader

refs astexporer

{{component 'foo-bar' a="1"}}
{{component (mut 1 2 3) b c d e="f"}}
{{foo-bar
  baz="stuff"
}}
{{#foo-boo}}
dsfsd
{{/foo-boo}}
{{doo-bar 1 2 3 hoo-boo name=(goo-boo "foo")}}
{{component (hot-load "foo-bar") baz="stuff"}}
{{test-component}}
{{test-component}}
{{test-component}}

will be transformed to

{{component (hot-load "foo-bar") a="1"}}
{{component (hot-load (mut 1 2 3)) b c d e="f"}}
{{component (hot-load "foo-bar") baz="stuff"}}
{{#component (hot-load "foo-boo")}}dsfsd
{{/component}}{{component (hot-load "doo-bar") 1 2 3 hoo-boo name=(goo-boo "foo")}}
{{component (hot-load "foo-bar") baz="stuff"}}
{{component (hot-load "test-component")}}
{{component (hot-load "test-component")}}
{{component (hot-load "test-component")}}

and hot-load helper will manage component reloading

Installation

ember install ember-ast-hot-load

Usage

Helpers looks like components, but we don't support component-like helpers hot-reload. So, you need to exclude helpers from hot-loader pipeline.

Let's copy all applcation's hot-reload confusing helpers.

var componentLikeHelpers = Object.keys(require.entries)
    .filter(name=>(name.includes('/helpers/')|| name.includes('/helper')))
    .filter(name=>!name.includes('/-')).map(name=>{
        let path = name.split('/helpers/');
        return path.pop();
    }).filter(name=>!name.includes('/')).uniq();
	
copy(JSON.stringify(componentLikeHelpers))

in ember-cli-build.js you need to specify this helpers

new EmberApp(defaults, {
  'ember-ast-hot-load': {
    helpers: ["foo-bar", "liquid-if", ... ],
    enabled: true
  }
});

Contributing

Installation

  • git clone <repository-url>
  • cd ember-ast-hot-load
  • yarn install

Linting

  • yarn lint:hbs
  • yarn lint:js
  • yarn lint:js --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 10 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc