diff --git a/can-component.js b/can-component.js index b5a95c5..3a2b842 100644 --- a/can-component.js +++ b/can-component.js @@ -32,8 +32,8 @@ require('can-view-model'); require("can-define/list/list"); var domData = require('can-dom-data-state'); -var getChildNodes = require('can-util/dom/child-nodes/child-nodes'); -var string = require("can-util/js/string/string"); +var getChildNodes = require('can-child-nodes'); +var string = require("can-string"); var domEvents = require('can-dom-events'); var domMutate = require('can-dom-mutate'); var domMutateNode = require('can-dom-mutate/node'); diff --git a/docs/beforeremove.md b/docs/beforeremove.md index 30c57f2..3401eb1 100644 --- a/docs/beforeremove.md +++ b/docs/beforeremove.md @@ -5,8 +5,8 @@ An event called only on component’s elements before they are removed from the document if live binding is performing the removal. It can be listened to within a component’s [can-component.prototype.events] object or on a component element with [can-stache-bindings.event] bindings. This is an additional -special event only on component elements. [can-util/dom/events/inserted/inserted] -and [can-util/dom/events/removed/removed] events are available on all elements. +special event only on component elements. Checkout [can-dom-mutate//events/events] +for other mutation events. @signature `"{element} beforeremove": function(element, event)` diff --git a/docs/component.md b/docs/component.md index 3ec2d69..ede5c2d 100644 --- a/docs/component.md +++ b/docs/component.md @@ -341,7 +341,7 @@ adds “!” to the message every time `` is clicked: ```js Component.extend( { tag: "hello-world", - view: stache( "

{{message}}

" ), + view: "

{{message}}

", events: { "click": function() { const currentMessage = this.viewModel.message; @@ -351,10 +351,9 @@ Component.extend( { } ); ``` -Components have the ability to bind to special [can-util/dom/events/inserted/inserted], -[can-component/beforeremove] and [can-util/dom/events/removed/removed] events -that are called when a component’s tag has been inserted into, -is about to removed, or was removed from the page. +Use [can-component/connectedCallback] to listen to when an component's element +is inserted or removed from the DOM. + ### Helpers diff --git a/package.json b/package.json index 0557211..977905e 100644 --- a/package.json +++ b/package.json @@ -38,25 +38,27 @@ }, "dependencies": { "can-assign": "^1.1.1", + "can-child-nodes": "^1.0.0", "can-construct": "^3.2.0", "can-control": "^4.0.0", "can-define": "^2.0.0", "can-dom-data-state": "^1.0.1", "can-dom-events": "^1.1.0", "can-dom-mutate": "^1.0.0", + "can-fragment": "^1.0.0", "can-globals": "^1.0.0", "can-log": "^1.0.0", "can-namespace": "1.0.0", "can-observation": "^4.0.0", "can-queues": "^1.0.0", "can-reflect": "^1.6.0", - "can-simple-map": "^4.0.0", + "can-simple-map": "^4.1.0", "can-simple-observable": "^2.0.0", "can-stache": "^4.1.0", "can-stache-bindings": "^4.0.3", "can-stache-key": "^1.0.0", + "can-string": "0.0.5", "can-symbol": "^1.4.1", - "can-util": "^3.9.5", "can-view-callbacks": "^4.0.0", "can-view-model": "^4.0.0", "can-view-nodelist": "^4.0.0", diff --git a/test/component-define-test.js b/test/component-define-test.js index 418b177..75c5e8c 100644 --- a/test/component-define-test.js +++ b/test/component-define-test.js @@ -6,7 +6,7 @@ var define = require("can-define"); var DefineMap = require("can-define/map/map"); var viewModel = require("can-view-model"); -var canDev = require("can-util/js/dev/dev"); +var canDev = require("can-log/dev/dev"); var testHelpers = require("can-test-helpers"); QUnit.module("can-component with can-define"); diff --git a/test/component-view-test.js b/test/component-view-test.js index d98b580..db6b5d8 100644 --- a/test/component-view-test.js +++ b/test/component-view-test.js @@ -11,7 +11,7 @@ var insertedEvent = domMutateDomEvents.inserted; var canViewModel = require('can-view-model'); var DefineMap = require("can-define/map/map"); var queues = require("can-queues"); -var getFragment = require("can-util/dom/fragment/fragment"); +var getFragment = require("can-fragment"); var viewCallbacks = require("can-view-callbacks"); var Scope = require("can-view-scope"); var observe = require("can-observe"); diff --git a/test/example-test.js b/test/example-test.js index 75ccc4e..e6ce738 100644 --- a/test/example-test.js +++ b/test/example-test.js @@ -12,7 +12,7 @@ var canViewModel = require("can-view-model"); var domMutateNode = require('can-dom-mutate/node'); var domMutateDomEvents = require('can-dom-mutate/dom-events'); var insertedEvent = domMutateDomEvents.inserted; -var canLog = require("can-util/js/log/log"); +var canLog = require("can-log"); var queues = require("can-queues"); var innerHTML = function(el) { diff --git a/test/helpers.js b/test/helpers.js index 13cd910..c9fcb08 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -1,5 +1,6 @@ -var MUTATION_OBSERVER = require('can-util/dom/mutation-observer/mutation-observer'); -var DOCUMENT = require("can-util/dom/document/document"); +var MUTATION_OBSERVER = require('can-globals/mutation-observer/mutation-observer'); +var globals = require("can-globals"); +var DOCUMENT = require("can-globals/document/document"); var makeDocument = require('can-vdom/make-document/make-document'); var domMutate = require('can-dom-mutate'); var domMutateNode = require('can-dom-mutate/node'); @@ -20,16 +21,18 @@ var helpers = { }, makeTest: function(name, doc, mutObs, test, qUnitTest) { var DOC = DOCUMENT(); - var MUT_OBS = MUTATION_OBSERVER(); + //var MUT_OBS = MUTATION_OBSERVER(); QUnit.module(name, { setup: function () { DOCUMENT(doc); - MUTATION_OBSERVER(mutObs); + if(!mutObs) { + globals.setKeyValue("MutationObserver", mutObs); + } if(doc) { - this.document = doc; + this.document = doc; this.fixture = doc.createElement("div"); doc.body.appendChild(this.fixture); } else { @@ -42,7 +45,7 @@ var helpers = { setTimeout(function(){ start(); DOCUMENT(DOC); - MUTATION_OBSERVER(MUT_OBS); + globals.deleteKeyValue("MutationObserver"); }, 100); } });