-
Notifications
You must be signed in to change notification settings - Fork 248
feat(components): add support for CSS encapsulation to transcluding components #1315
Conversation
bool get isBody => true; | ||
} | ||
|
||
class _Lexer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could csslib help here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll investigate if it can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be used, but since the library is generic and does more than we need, importing it adds 160Kb to the generated (and minified) JS file. So we should probably try to build something more tailored to our use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have think that the tree shaking would have been more effective...
I think we can forget it then
What about #1305, do you think it could be added ? |
In think you already have solved #1304, that was the issue with the cache keys (not depending on the selector) |
abstract class WebPlatformShim { | ||
/** | ||
* Because this code uses `strictStyling` for the polymer css shim, it is required to add the | ||
* custom element’s name as an attribute on all DOM nodes in the shadowRoot (e.g. <span x-foo>). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vsavkin this comment should probably be updated ?
@vicb you are totally right about #1304. It is included into this PR. Talking of #1305. I've added unit tests for ShimmingViewCache and DefaultPlatformShim, but not for PlatformJsBasedShim. The main responsibility of PlatformJsBasedShim is to delegate to Platform.js, so I'm not sure how much value we would get by isolating it from platform.js. To do it we would have to wrap platform.js in another object, register it with DI, and then pass it to PlatformJsBasedShim. Not sure if all this is necessary, considering we would have to have some integration tests (or e2e tests) anyways. What do you think? |
@@ -53,7 +53,8 @@ void main() { | |||
beforeEachModule((Module m) { | |||
return m | |||
..bind(ComponentFactory, toImplementation: TranscludingComponentFactory) | |||
..bind(SimpleComponent); | |||
..bind(SimpleComponent) | |||
..bind(DefaultPlatformShim, toImplementation: DefaultPlatformShim); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bind(DefaultPlatformShim);
?
I would prefer to see some unit tests, e2e tests only test for whatever It should not be that complex by using the way I've suggested in the PR:
If you can come something simple like this, it's probably worth it. If On 08/06/2014 04:27 PM, Victor Savkin wrote:
|
@vicb I'm not sure if we should mock the Platform object. Doing so breaks "Don't Mock What You Don't Own". I'd prefer to wrap the Platform object into something we control and mock that. |
|
||
async.Future<String> _fetch(String cssUrl) { | ||
return http.get(cssUrl, cache: templateCache) | ||
.then((resp) => resp.responseText, onError: (e) => '/*\n$e\n*/\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove the \n
from here, they make testing with IE fails, see https://github.com/angular/angular.dart/pull/1288/files#diff-184d55c4be9ba89ff317b308735c6ae9R91. You would also need to update the corresponding test.
I think is it much easier to include this here are this will not be updated while merging the PRs to master as the file has changed.
585fafe
to
cc9e973
Compare
cc9e973
to
22d4294
Compare
@mhevery is it "review" or "rebase"? |
22d4294
to
78175c4
Compare
3b174c0
to
d616410
Compare
8fd235c
to
50e2645
Compare
1ba3218
to
ad194a0
Compare
…ents * Extract ComponentCssLoader so it can be shared by ShadowDomComponentFactory and TranscludingComponentFactory * Provide a built-in implementation of WebPlatformShim using css_shim * Implement a CSS transformer similar to the one provided by Platform.JS * Rename EventHandler into ShadowBoundary
ad194a0
to
18843e1
Compare
This PR depends on #1293.
TODO:
Includes #1304