Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor(jqLite): make HTML-parsing constructor more robust #6962

Closed
wants to merge 188 commits into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Apr 2, 2014

Previously, the jqLite constructor was limited and would be unable to
circumvent many of the HTML5 spec's "allowed content" policies for various
nodes. This led to complicated and gross hacks around this in the HTML
compiler.

This change refactors these hacks by simplifying them, and placing them in
jqLite rather than in $compile, in order to better support these things, and simplify code.

While the new jqLite constructor is still not even close to as robust as
jQuery, it should be more than suitable enough for the needs of the
framework, while adding minimal code.

Closes #6941 Closes #6926

takashi and others added 30 commits March 7, 2014 15:03
- Adds accessibility attributes to links and images.
- Adds a note on using NVM for node.
Jasmine doesn't live at the replaced link anymore.
It has a link to click through, but I figured it would be better
to just go directly to the correct location.

Closes angular#6591
The meta-data should be parsed from the name not the id.
If the first element in a template is a <thead> or a <tfoot>, then
use the existing logic to handle table elements compilation.

Closes angular#6289
The docs were relying on the grunt/util module for getting version info
but this was unreliable and full of custom regexes.  This is moved into
a new version-info module that makes much better use of the semver library.
As highlighted by the new sterner dgeni.
`restictions` -> `restrictions`

Closes angular#6604
`preferrable` -> `preferable`

Typo fixed

Closes angular#6606
this is primarily to resolve peerdependency version mismatch issue
`consititute` -> `constitute`

Typo fixed

Closes angular#6607
It is a bit rough and ready but does a better job than nothing.
winkler1 and others added 25 commits March 27, 2014 14:39
The doc mentions filters can be used in services and controllers but directives
aren't mentioned. This could lead to confusion for beginners.
Fix broken internal link in directive documentation.

Closes angular#6802
The previous link throws a 404.
Using node_module/.bin/gulp will enable to gulp command to run
both on Windows and Linux. In its current form, the default action of
executing a Javascript file on Windows does not use node.
Requires quotes around the command to correctly resolve path on Windows

Closes angular#6346
Due to a known V8 memory leak[1] we need to perform extra cleanup to make it easier
for GC to collect this scope object.

The theory is that the V8 leaks are due to inline caches which are caches
built on the fly to speed up property access for javascript objects.

By cleaning the scope object and removing all properties, we clean up ICs
as well and so no leaks occur.

I was able to manually verify that this fixes the problem for the following
example app: http://plnkr.co/edit/FrSw6SCEVODk02Ljo8se?p=preview

Given the nature of the problem I'm not 100% sure that this will work around
the V8 problem in scenarios common for Angular apps, but I guess it's better
than nothing.

[1] V8 bug: https://code.google.com/p/v8/issues/detail?id=2073

Closes angular#6794
Closes angular#6856
It is too easy to forget to check jscs for things like trailing whitespace
before pushing commits, such as simple doc changes.  This then breaks the
build and is messy.  Adding jscs to the test task gives people a slightly
better chance of catching these before pushing.
If the type of a type-hint was not recognized, say a "Promise", then
the background color was left as white.  Given that the default
foreground color is also white, this meant that such type-hints were
invisible.

Closes angular#6934
…ze leaks

This reverts commit f552f25.

The commit is causing regressions.

Closes angular#6897
Previously, constant numbers with a unary minus sign were not treated as constants. This fix corrects
this behaviour, and may provide a small performance boost for certain applications, due to constant
watches being automatically unregistered after their first listener call.

Closes angular#6932
Previously, the jqLite constructor was limited and would be unable to circumvent many of the HTML5
spec's "allowed content" policies for various nodes. This led to complicated and gross hacks around
this in the HTML compiler.

This change refactors these hacks by simplifying them, and placing them in jqLite rather than in
$compile, in order to better support these things, and simplify code.

While the new jqLite constructor is still not even close to as robust as jQuery, it should be more
than suitable enough for the needs of the framework, while adding minimal code.

Closes angular#6941
Closes angular#6926
@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6962)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@caitp caitp closed this Apr 2, 2014
@caitp caitp deleted the jqlite-html-parser-1.2.x branch April 2, 2014 18:19
@caitp
Copy link
Contributor Author

caitp commented Apr 2, 2014

I royally made a mess with this, I need to stop being lazy and use cherry-pick instead of git am more often =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom <select> directive: Transclude and replace <option>s not working in IE9