Comments (8)
Seems a neat solution to me, it leaves decision to the application developer. We need to mention this in our doc though :)
from framework.
Hi, great to see you again (:
Nice idea, I will have to change the current custom element polyfill for this, but I plan to move to v1 soon anyways.
Gonna land in the next batch hopefully
from framework.
I have a small issue here: The main reason of FOUC (flash of unstyled content) is that the nx script is loaded after index.html is parsed (async or at the bottom of body). If I add the unresolved
rule to the script it won't solve the problem (it will also be loaded after the index.html is parsed). A possible solution would be to load nx in the head or add the unresolved rule by hand I guess.
I personally like to load NX synchronously in the head. A lot of people see this as a bad habit, but in case of a full app (not just a widget), the page would make no sense without NX loaded anyways.
What is your opinion?
from framework.
You are right, following angular docs.
For the best result, the angular.js script must be loaded in the head section of the html document; alternatively, the css rule above must be included in the external stylesheet of the application.
Anyways we should provide the rule and leave the decision to the application developer.
from framework.
Yes, that would be the best. So I will just put your snippet into the docs and into NX too.
I plan to do it when we replace the custom elements polyfill v0 with v1, since :unresolved
is replaced by :defined
in that spec. We have to wait until the Custom Elements v1 polyfill starts to support type extensions with the v0 -> v1 migration. Than it can be added (:
from framework.
LGTM π
from framework.
I looked a bit deeper into this. Polyfilling css pseudo classes (like :defined and :unresolved) seems to be not worth it (complexity and overhead are big). Neither the v0 nor the V1 custom element polyfill supports these selectors. I think we should go the angular way and use a simple cloak
attribute instead. The drawback is that developers would have to manually add the cloak
attribute to the component that causes FOUC instead of relying the custom element registration process in the background. (<my-element cloak>
instead of <my-element>
).
Hopefully this won't be needed frequently. If the render middleware is used to add content to the component FOUC is usually not an issue.
Thoughts?
from framework.
Otherwise it is a pretty small change and it will get into the alpha.5.1.0
from framework.
Related Issues (20)
- Planned features HOT 2
- Handling model data inside a component HOT 10
- npm install issues
- Bower support + Firefox NX source download bug HOT 12
- Reference to element in the component HOT 5
- Upcoming core rework HOT 3
- Is this project alive? HOT 3
- Why doesn't `exec` return values? HOT 5
- Web components org recommendation list HOT 1
- DOM node attribute changes not caught by handler HOT 3
- [Question] Can this framework be used with a template engine? HOT 3
- [MAJOR BUG] website won't openππ HOT 4
- Surviving contact with jquery and its libraries
- Usage inside meteor (amd/import usage instead of webpack) HOT 1
- Uncaught ReferenceError: module is not defined HOT 2
- history error HOT 3
- 402: Payment required HOT 1
- What is the status of this project? HOT 1
- Add supports for clipboard events. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.