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 - npm Package Compare versions

Comparing version 0.0.57 to 0.0.58

1

addon/services/hot-loader.js

@@ -273,2 +273,3 @@ import Service from "@ember/service";

isComponent(name, currentContext) {
// todo - must be route-related logic
if (!(name in COMPONENT_NAMES_CACHE)) {

@@ -275,0 +276,0 @@ // classic + pods

Examples
------------------------------------------------------------------------------
[hbs-ast-builders](https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/syntax/lib/builders.ts)

@@ -15,4 +16,31 @@ [glimmer hot-reload test #1](https://github.com/emberjs/ember.js/blob/master/packages/%40ember/-internals/glimmer/tests/integration/application/hot-reload-test.js)

```hbs
<FooBar />
<Baz as |ctx|>
<ctx.boo />
</Baz>
<Boo as |Foo|>
<Foo />
</Boo>
```
to
```hbs
{{#let (component 'foobar') as |FooBar|}}
<FooBar />
{{/let}}
{{#let (component 'baz') as |Baz|}}
<Baz as |ctx|>
<ctx.boo />
</Baz>
{{/let}}
{{#let (component 'boo') as |boo|}}
<Boo as |Foo|>
<Foo />
</Boo>
{{/let}}
```
```hbs
{{component 'foo-bar' a="1"}}

@@ -27,6 +55,7 @@ {{component (mut 1 2 3) b c d e="f"}}

{{doo-bar 1 2 3 hoo-boo name=(goo-boo "foo")}}
{{component (hot-load "foo-bar") baz="stuff"}}
{{test-component}}
{{test-component}}
{{test-component}}
{{component @fooBar}}
{{component this.fooBar}}
{{component fooBar}}
{{component args.fooBar}}
```

@@ -36,3 +65,2 @@

```hbs

@@ -43,9 +71,11 @@ {{component (hot-load "foo-bar") a="1"}}

{{#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}}
{{component (hot-load "doo-bar") 1 2 3 hoo-boo name=(goo-boo "foo")}}
{{component (hot-load "test-component")}}
{{component (hot-load "test-component")}}
{{component (hot-load "test-component")}}
{{component (hot-load @fooBar)}}
{{component (hot-load this.fooBar)}}
{{component (hot-load fooBar)}}
{{component (hot-load args.fooBar)}}
```
and `hot-load` helper will manage component reloading

23

lib/ast-transform.js

@@ -224,5 +224,18 @@ /* global module */

function captureBlockParams(node) {
const params = node.blockParams;
if (node.__ignore) {
return;
}
params.forEach((param)=>{
if (!nestedNames.includes(param)) {
nestedNames.push(param);
}
});
}
function wrapAngeBrackedComponentWithLetHelper(b, node) {
const tagName = node.tag;
const newNode = JSON.parse(JSON.stringify(node));
captureBlockParams(node);
newNode.cloned = true;

@@ -273,11 +286,3 @@ node.type = "BlockStatement";

Program(node) {
const params = node.blockParams;
if (node.__ignore) {
return;
}
params.forEach((param)=>{
if (!nestedNames.includes(param)) {
nestedNames.push(param);
}
});
captureBlockParams(node);
},

@@ -284,0 +289,0 @@ ElementNode(node) {

{
"name": "ember-ast-hot-load",
"version": "0.0.57",
"version": "0.0.58",
"description": "Ember components hot-reload addon",

@@ -5,0 +5,0 @@ "keywords": [

@@ -13,3 +13,3 @@ ember-ast-hot-load [![Build Status](https://travis-ci.com/lifeart/ember-ast-hot-load.svg?branch=master)](https://travis-ci.com/lifeart/ember-ast-hot-load) [![Greenkeeper badge](https://badges.greenkeeper.io/lifeart/ember-ast-hot-load.svg)](https://greenkeeper.io/)

* `ember-cli-hot-loader` implemented using middleware for `ember-resolver` and `wrapping` components.
* `ember-as-hot-load` implemented using compile-time templates `ast` transformations.
* `ember-ast-hot-load` implemented using compile-time templates `ast` transformations.

@@ -20,2 +20,3 @@ | Point | ember-ast-hot-load | ember-cli-hot-loader |

| Classic route templates | + | - |
| MU route templates | + | - |
| reducers reloading | - | + |

@@ -38,3 +39,2 @@ | performance impact | low | middle |

Installation

@@ -41,0 +41,0 @@ ------------------------------------------------------------------------------

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