Discussion:
[dart-misc] Equivalent of React.renderToString() function in Dart?
try_dart
2016-02-09 11:01:52 UTC
Permalink
Hi Devs!

Thanks & hope you continue to do the great work you have been doing.

A version of our UI is in Dart, and it works great. But the problem is
search engine crawlers. Google webmaster tools claim that they handle
Javascript, and they do it quite well, I believe. But in practice it means
slower page loads, including timeouts. This is mainly because of increased
no. of requests, coupled with running the JS init()/start() code, then more
calls to get data, and then the DOM gets created.

Which makes it ineffective for use in SEO, and one is forced to fall back
to another version of static HTML (also implies dated) for SEO.

Recently, I came to know about this trend of ispmorphic web apps, which
work great with all the latest/cool JS in the browser, as well as takes
care of server side generation of HTML, which is achieved primarily by
calling functions like for e.g. React.renderToString() on a given
domElement, in React, . This way, it results in much faster page load as
well.

So the question is: Is there an equivalent of this function in Dart? If
not, are there any plans to add it? IMHO, this may be a feature requited by
lot others, as well.

Sincerely,
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Günter Zöchbauer
2016-02-09 12:16:42 UTC
Permalink
There is a react implementation for Dart that probably can do that as well.
The Dart team is also working on configurable imports and I guess this will
lead to and alternative `dart:html` implementation that allows to run and
render Dart client applications on the server without a browser.
Angular is also working on server side rendering and I assuem they will
implement this for Angular Dart as well.

Another approach is to use Phantom.js to render the client application and
create static snapshots.
Post by try_dart
Hi Devs!
Thanks & hope you continue to do the great work you have been doing.
A version of our UI is in Dart, and it works great. But the problem is
search engine crawlers. Google webmaster tools claim that they handle
Javascript, and they do it quite well, I believe. But in practice it means
slower page loads, including timeouts. This is mainly because of increased
no. of requests, coupled with running the JS init()/start() code, then more
calls to get data, and then the DOM gets created.
Which makes it ineffective for use in SEO, and one is forced to fall back
to another version of static HTML (also implies dated) for SEO.
Recently, I came to know about this trend of isomorphic web apps, which
work great with all the latest/cool JS in the browser, as well as takes
care of server side generation of HTML, which is achieved primarily by
calling functions like for e.g. React.renderToString() on a given
domElement, in React, . This way, it results in much faster page load as
well.
So the question is: Is there an equivalent of this function in Dart? If
not, are there any plans to add it? IMHO, this may be a feature required by
lot others, as well.
Sincerely,
EDIT: typos
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Khushnood Naqvi
2016-02-09 13:11:53 UTC
Permalink
Thanks for your reply. I saw that React- Dart. But I worry, that I will be
stuck with something un-maintainable. Also won't have the benefit of
dev/debug tools (React plugin for chrome).

Good to know about configurable imports and a server side implementation of
'dart:html'. Any idea by which version it will be available? From the sound
of it, looks to be a major version feature.

Phantom.js route looks cumbersome (managing static cache expiry; more
movable pieces, deploy process etc)...perhaps easier to embed dart code
compiled to JS, in the static pages somehow, which get served by a reliable
server already. (Just thinking aloud, don't mean to be argumentative)

Thanks again, for your pointers.
Post by Günter Zöchbauer
There is a react implementation for Dart that probably can do that as well.
The Dart team is also working on configurable imports and I guess this
will lead to and alternative `dart:html` implementation that allows to run
and render Dart client applications on the server without a browser.
Angular is also working on server side rendering and I assuem they will
implement this for Angular Dart as well.
Another approach is to use Phantom.js to render the client application and
create static snapshots.
Post by try_dart
Hi Devs!
Thanks & hope you continue to do the great work you have been doing.
A version of our UI is in Dart, and it works great. But the problem is
search engine crawlers. Google webmaster tools claim that they handle
Javascript, and they do it quite well, I believe. But in practice it means
slower page loads, including timeouts. This is mainly because of increased
no. of requests, coupled with running the JS init()/start() code, then more
calls to get data, and then the DOM gets created.
Which makes it ineffective for use in SEO, and one is forced to fall back
to another version of static HTML (also implies dated) for SEO.
Recently, I came to know about this trend of isomorphic web apps, which
work great with all the latest/cool JS in the browser, as well as takes
care of server side generation of HTML, which is achieved primarily by
calling functions like for e.g. React.renderToString() on a given
domElement, in React, . This way, it results in much faster page load as
well.
So the question is: Is there an equivalent of this function in Dart? If
not, are there any plans to add it? IMHO, this may be a feature required by
lot others, as well.
Sincerely,
EDIT: typos
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to a topic in the
Google Groups "Dart Misc" group.
To unsubscribe from this topic, visit
https://groups.google.com/a/dartlang.org/d/topic/misc/DOsSi6TBpVE/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
--
Khushnood
https://www.90di.com/
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...