Skip to content

Commit

Permalink
Update dependencies and build
Browse files Browse the repository at this point in the history
  • Loading branch information
yysun committed Dec 8, 2023
1 parent 5ff9105 commit daa51b7
Show file tree
Hide file tree
Showing 28 changed files with 1,691 additions and 2,180 deletions.
34 changes: 34 additions & 0 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
## What's New

### Support the _mounted_ function when starting a component manually

> Dec, 8, 2023
When using a component in JSX, AppRun always invokes the the _mounted_ lifecycle function each time the component is loaded.

```js
class ComponentClass extends Component {
mounted = () => console.log('mounted is called');
}
app.render(document.body, <ComponentClass />);
```

However, the _mounted_ function is not called when you start the component manully in the previous versions.

```js
class ComponentClass extends Component {
mounted = () => console.log('mounted is called'); // not called in previous versions
}
new ComponentClass().start(document.body);
```

Now, the _mounted_ function is called when the component is started.

```js
class ComponentClass extends Component {
mounted = () => console.log('mounted is called'); // called in this version
}
new ComponentClass().start(document.body);
```

This change make the _mounted_ funciton compatible in JSX and in manual start.


### Support View Transition API

> September, 27, 2023
Expand Down
2 changes: 1 addition & 1 deletion demo/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/app.js.map

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions demo/new.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
<h2 id="whats-new">What&#39;s New</h2>
<h3 id="support-the-mounted-function-when-starting-a-component-manually">Support the <em>mounted</em> function when starting a component manually</h3>
<blockquote>
<p>Dec, 8, 2023</p>
</blockquote>
<p>When using a component in JSX, AppRun always invokes the the <em>mounted</em> lifecycle function each time the component is loaded.</p>
<pre><code class="language-js">class ComponentClass extends Component {
mounted = () =&gt; console.log(&#39;mounted is called&#39;);
}
app.render(document.body, &lt;ComponentClass /&gt;);
</code></pre>
<p>However, the <em>mounted</em> function is not called when you start the component manully in the previous versions.</p>
<pre><code class="language-js">class ComponentClass extends Component {
mounted = () =&gt; console.log(&#39;mounted is called&#39;); // not called in previous versions
}
new ComponentClass().start(document.body);
</code></pre>
<p>Now, the <em>mounted</em> function is called when the component is started.</p>
<pre><code class="language-js">class ComponentClass extends Component {
mounted = () =&gt; console.log(&#39;mounted is called&#39;); // called in this version
}
new ComponentClass().start(document.body);
</code></pre>
<p>This change make the <em>mounted</em> funciton compatible in JSX and in manual start.</p>
<h3 id="support-view-transition-api">Support View Transition API</h3>
<blockquote>
<p>September, 27, 2023</p>
Expand Down
2 changes: 1 addition & 1 deletion dist/apprun-dev-tools.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-dev-tools.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/apprun-html.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-html.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-html.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-html.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/apprun-play-html.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-play-html.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-play.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-play.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion esm/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion esm/app.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion esm/apprun.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion esm/apprun.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 44 additions & 35 deletions esm/component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit daa51b7

Please sign in to comment.