GithubHelp home page GithubHelp logo

canjs / can-view-nodelist Goto Github PK

View Code? Open in Web Editor NEW
3.0 14.0 0.0 207 KB

Node list helpers

Home Page: https://canjs.com/doc/can-view-nodelist.html

License: MIT License

JavaScript 99.03% HTML 0.97%

can-view-nodelist's Introduction

can-view-nodelist's People

Contributors

andrejewski avatar bmomberger-bitovi avatar chasenlehara avatar cherifgsoul avatar christopherjbaker avatar daffl avatar greenkeeper[bot] avatar greenkeeperio-bot avatar imaustink avatar justinbmeyer avatar matthewp avatar nlundquist avatar phillipskevin avatar sinjhin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

can-view-nodelist's Issues

Remove NodeList

This issue is used to note progress and remaining todos of removing nodelists from CanJS.

Status: Getting can-view-live.list to work.

Branches

  • canjs/can-view-live (major)
  • canjs/can-diff#patch-sort (minor)
  • canjs/can-dom-mutate#onNodeRemoved (minor but might major)
  • canjs/can-observation#dom-queue (minor)
  • canjs/can-queues#dom-queue (minor)

Things to do

  • Get all of can-view-live to work
  • Get can-stache to work
  • Get scopeKeyData to be passed an element
  • Get can-component to work

Cleanup things (stuff to come back to)

  • Can can-dom-mutate be made faster? Do we need a weakmap now?
    • Could we just add a symbol to elements and say you can only listen once to these things?
    • Should we track the types of nodes used to listen to remove and configure the tree-walker accordingly? Meaning, should we only add placeholder text nodes instead of comment nodes?
    • Would using mutation observer help performance? Could we at least us it to allow users to mutate connected DOM w/o using the can-dom-mutate/node apis?
  • Do we need all the queues in can-queues? Are they named right?
  • Does enqueueByQueue need to loop through every queue or should it be using Object.keys()?

What has been done

  • can-queues has "dom" related queues that require an element. Tasks get sorted by element.
  • can-observation can be passed an associated element with can.setElement. (other observables will need this)
  • can-dom-mutate MUST be used, but it will call onNodeRemoved() handlers anytime an element is removed from a parent node (including all children). This is probably SLOW.
  • can-diff has a patch-sort module that can make sure deletes come before inserts. This was needed to fix a likely long standing bug in can-view-live.list. Now we will remove elements from the dom immediately, but do insertions later. It's a bit hacking right now.

after method fails on unparented nodes

The after method in can-view-nodelist fails to take into account recently unparented DOM nodes.
It calls domMutate.appendChild.call(last.parentNode, newFrag) where parentNode may be null, leading to a crash.

Specifically; this happens when a node which renders with the live.list helper is removed in the same logic tick as when the list itself is emptied out, leading to its addFalseyIfEmpty branch being executed.

An in-range update of can-util is breaking the build 🚨

Version 3.3.7 of can-util just got published.

Branch Build failing 🚨
Dependency can-util
Current Version 3.3.6
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As can-util is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v3.3.7

makeMutationEvent correctly handles adding multiple listeners

Commits

The new version differs by 3 commits .

  • 000f4b6 Update dist for release
  • b2bfce8 Merge pull request #237 from canjs/two-remove-event-listeners
  • 027aac3 Counting the number of event handlers for each element/event combo

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

parentList.replacements keeps growing

Scenario:

Stache sort of like this:

{{#each list}}
    <input type="text" value:from="name" />
{{/each}}
<a on:click="changeList()">Change</a>

changeList() should be a function that will manipulate list in some way, such as adding or removing elements. Each time changeList() is called, a nodeList will be added to the replacements list associated with the each helper, which never appears to be cleaned up. This results in a full leak of the entire UI associated with the list.

An in-range update of can-dom-mutate is breaking the build 🚨

The dependency can-dom-mutate was updated from 1.3.4 to 1.3.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

can-dom-mutate is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for Another fix for IE11

#49

Commits

The new version differs by 3 commits.

  • d72d54a 1.3.5
  • a32913a Merge pull request #49 from canjs/typeof-set-take-2
  • 5094ee6 changing typeof Set to fix IE11 issue

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of can-util is breaking the build 🚨

Version 3.9.0 of can-util just got published.

Branch Build failing 🚨
Dependency can-util
Current Version 3.8.5
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

can-util is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 3 commits.

  • d16c7de Update dist for release
  • 9c1d867 fixing postversion script
  • f381873 Do Not Merge - can-reflect (#287)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

New NodeList API

test('unregisters child nodeLists', function () {
	expect(3);
	// two spans that might have been created by #each
	var spansFrag = fragment("<span>1</span><span>2</span>");
        var spansList = new NodeList( spansFrag );
        spansList.onUnbound(function(){
		ok(true,"unregistered spansList");
	});
        

	// A label that might have been created by #foo
	var labelFrag = fragment("<label>l</label>");
	var labelList = new NodeList(labelFrag);
        labelList.onUnbound( function(){
		ok(true,"unregistered labelList");
	});

	// the html inside #if}
	var ifList = new NodeList( frag(["~","","-",""]) );

	ifList.splice(1,1,spansFrag);

	// 4 because 2 elements are inserted, and ifChildNodes is live
	ifList.splice(4,1,labelFrag);
        ifList.onUnbound(function(){
		ok(true,"unregistered ifList");
	});

	deepEqual(ifList.nodes,[
		ifEls[0],
		spansList,
		ifEls[2],
		labelList
	]);

        ifList.replace( [document.createTextNode("empty")] );

});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.