Skip to content

Fix for #1538 #1552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compile/nodes/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class Component extends Node {

const name = this.var;

const componentInitProperties = [`root: #component.root`];
const componentInitProperties = [`root: #component.root`, `store: #component.store`];

if (this.children.length > 0) {
const slots = Array.from(this._slots).map(name => `${quoteNameIfNecessary(name)}: @createFragment()`);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

export function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/basic/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/custom-element/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/dev/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
7 changes: 4 additions & 3 deletions test/cli/samples/dir-sourcemap/expected/Main.js

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

2 changes: 1 addition & 1 deletion test/cli/samples/dir-sourcemap/expected/Main.js.map

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

4 changes: 2 additions & 2 deletions test/cli/samples/dir-sourcemap/expected/Widget.js

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

5 changes: 3 additions & 2 deletions test/cli/samples/dir-subdir/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import Widget from './widget/Widget.html';
function create_main_fragment(component, ctx) {

var widget = new Widget({
root: component.root
root: component.root,
store: component.store
});

return {
Expand Down Expand Up @@ -72,7 +73,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/dir-subdir/expected/widget/Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
5 changes: 3 additions & 2 deletions test/cli/samples/dir/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import Widget from './Widget.html';
function create_main_fragment(component, ctx) {

var widget = new Widget({
root: component.root
root: component.root,
store: component.store
});

return {
Expand Down Expand Up @@ -72,7 +73,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/dir/expected/Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/globals/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var Main = (function(answer) { "use strict";

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/sourcemap-inline/expected/Main.js

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

2 changes: 1 addition & 1 deletion test/cli/samples/sourcemap/expected/Main.js

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

2 changes: 1 addition & 1 deletion test/cli/samples/store/expected/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function assign(tar, src) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/action/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/bind-width-height/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
3 changes: 2 additions & 1 deletion test/js/samples/component-static-array/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down Expand Up @@ -124,6 +124,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: [1, 2, 3] };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
1 change: 1 addition & 0 deletions test/js/samples/component-static-array/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: [1, 2, 3] };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down Expand Up @@ -128,6 +128,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: "bar" };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
1 change: 1 addition & 0 deletions test/js/samples/component-static-immutable/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: "bar" };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down Expand Up @@ -128,6 +128,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: "bar" };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
1 change: 1 addition & 0 deletions test/js/samples/component-static-immutable2/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: "bar" };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
3 changes: 2 additions & 1 deletion test/js/samples/component-static/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down Expand Up @@ -124,6 +124,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: "bar" };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
1 change: 1 addition & 0 deletions test/js/samples/component-static/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) {
var nested_initial_data = { foo: "bar" };
var nested = new Nested({
root: component.root,
store: component.store,
data: nested_initial_data
});

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/computed-collapsed-if/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/css-media-query/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/deconflict-builtins/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/deconflict-globals/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/do-use-dataset/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/dont-use-dataset-in-svg/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function init(component, options) {

component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
component.store = options.store || component.root.store;
}

function on(eventName, handler) {
Expand Down
Loading