-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support auto scan #18
Conversation
CLA is valid! |
return; | ||
} | ||
self._detectElement(self._i13nNode, self.enterViewportCallback, self.exitViewportCallback); | ||
self._subComponentsViewportDetection && self._subComponentsViewportDetection(); |
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.
change some detail implementation of viewport detection, will detect subcomponents as well
👍 |
waiting for @redonkulus's ship then I will rebase and merge it. |
|
||
### Inherit Architecture | ||
* We can define i13n data for each level, whenever we want to get the `i13nModel` for certain node, it traverses back to the root and merge all the `i13nModel` information in the path. Since the tree is already built and we don't need extra DOM access, it should be pretty cheap and efficient. | ||
>>>>>>> modify for feedbacks |
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.
looks like a diff issue. also was main ideas supposed to be added?
updated according to the feedback |
@@ -16,6 +16,16 @@ Typically, you have to manually add instrumentation code throughout your applica | |||
* **Performant** - Tracking data (`i13nModel`) can be a plain JS object or custom function. This means you can [dynamically change tracking data](./docs/guides/integrateWithComponents.md#dynamic-i13n-model) without causing unnecessary re-renders. | |||
* **Adaptable** - If you are using an isomorphic framework (e.g. [Fluxible](http://fluxible.io)) to build your app, you can easily [change the tracking implementation](./docs/guides/createPlugins.md) on the server and client side. For example, to track page views, you can fire an http request on server and xhr request on the client. | |||
* **Optimizable** - We provide an option to enable viewport checking for each `I13nNode`. Which means that data will only be beaconed when the node is in the viewport. This reduces the network usage for the user and provides better tracking details. | |||
* **Auto Scan Links** - Support [auto scan links](./docs/api/createI13nNode.md) for the cases you are not able to replace the component you are using to get it tracked, e.g., if you have dependencies or you are using `dangerouslySetInnerHTML`. We scan the tags you define on client side, track them and build nodes for them in i13n tree. | |||
|
|||
## Main Ideas |
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.
We don't need this section as I already added it here. I just made it part of the i13n Tree section.
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 cannot recall why did I add this, I guess it's a copy mistake from some old branch, already remove it :)
squash and 👍 |
cf21af8
to
dcb4fe1
Compare
#8
@redonkulus @lingyan
support auto scan to track links, it's
not a recommend way
but sometime users will need that, for example when they are usingdangerouslySetInnerHTML
, they cannot change<a>
to<I13nAnchor>
, they will need this, we will scan tags withcomponentDidMount
bygetElementsByTagName
, andfor each scanned links
Usage
add
scanLinks
as props in I13nComponent,