window.location.href = 'file:///' will return console error: "Not allowed to load local resource"
1,306 karma · joined March 25, 2007
window.location.href = 'file:///' will return console error: "Not allowed to load local resource"
https://service.prerender.cloud/screenshot/https://google.co...
npm install -g prerendercloud-server
prerendercloud-server .
If you want to run your own rendertron instance as opposed to service.prerender.cloud, you can use that same package with an environment variable: PRERENDER_SERVICE_URL=http://localhost:8080 prerendercloud-server .
https://www.prerender.cloud/docs <div id='root'></div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.min.js'></script>
<script type='text/babel'>
const App = () => <div>Hello World</div>;
ReactDOM.render(<App />, document.getElementById('root'))
</script>I've been maintaining (thanks to this team and Headless Chrome) a convenience API based on this feature. Some additional features:
* React checksums for v14 and v15 (v16 no longer uses checksums)
* preboot integration for clean Angular server->client transition
* support for Webpack code splitting
* automatic caching of XHR content
https://www.prerender.cloud/and for the crawling or to delegate your single-page app hosting and server-side rendering entirely https://www.roast.io/
For example: you load the app in your headless browser and let it load as would in any browser. The browser fires some events and XHR/WebSocket requests and you can cleanly wait for them to finish as opposed to doing something like this: https://techbrunch.gousto.co.uk/2016/10/10/isomorphic-react-... which requires you to do some extra configuration in your app to help support a Node environment.
TL;DR: ReactDOMServer.renderToString won't wait for your async requests to finish, you need them to execute and finish before you call renderToString
Run it with:
--js-flags="--max_old_space_size=500"
to force the VM to keep it GC'd below 500Chrome v55 was a 30% memory savings, before that I used 1GB containers.
It's not perfect, but I am definitely pushing high volume (multiple tabs, concurrent activity) and I am not having any significant stability issues and I am pushing diverse sets of webpages.
> If built poorly, all of the browser features you've come to rely on break
Alternatively phrased: "you may have to learn some new APIs"
But the SEO can be an issue (Google is not consistently executing AJAX) and render performance is definitely an issue.
I made https://www.prerender.cloud/ to address the SEO and rendering performance but that still doesn't make SPA the obvious choice.
Do you need a rich client experience? ( a UI that continuously updates to reflect the state of a data store, or more generally, a complicated UI that doesn't do a hard page refresh ) If yes, then SPA is the better solution.
If you just need a non-interactive set of pages (a blog), then a SPA probably isn't the answer.
> If not, 10MB of the hottest new JS framework may not be for you...
What hot new JS framework is 10MB? React is ~60kb gzipped
The auth frameworks (auth0.com or AWS Cognito) are large though, ~150KB gzipped. But with code splitting you can eliminate that from your main page. Or you can move the auth part of your app to a subdomain (app.example.com) and keep example.com lightweight w/out auth0/cognito)
(you could use the prerendercloud npm middleware from the lambda edge)
Ask HN: How to get started with machine learning?
https://news.ycombinator.com/item?id=12713056My intention was merely to point out the difference between bare/raw HTTP on ec2 vs API Gateway (which is only HTTPS).
But this comparison is in fact almost useless because the world is moving to HTTPS everywhere.
The users browsing the AMP results may never feel compelled to scroll down to see non AMP results.
So a publisher's choice isn't: "standard size for faster delivery", it's: "use AMP or receive less traffic than you're currently receiving"
Except you don't have to peel through their code base or intercept any calls, they expose a clean interface for this: https://github.com/facebook/react-devtools
You can capture it like this:
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function(obj) {
// obj.Mount
}
Which is how we're doing SSR at https://www.prerender.cloud/ for compatibility across React versions.It's OK to jump in and try it without having background information. See how far you get and start researching when you hit a wall or find sudden interest.
If you like to study/read: the famous Coursera Andrew Ng machine learning course: https://www.coursera.org/learn/machine-learning
If you just want course materials from UC Berkeley, here's their 101 course: https://news.ycombinator.com/item?id=11897766
If you want a web based intro to a "simpler" machine learning approach, "decision trees": https://news.ycombinator.com/item?id=12609822
Here's a list of top "deep learning" projects on Github and great HN commentary on some tips on getting started: https://news.ycombinator.com/item?id=12266623
If you just want a high level overview: https://medium.com/@ageitgey/machine-learning-is-fun-80ea3ec...
My favorite part is Hoffman suggesting to know when to quit or look a reason to stop/quit and pivot or move on. Altman however, presents himself as he is well known for, and as PG has corroborated: tenacious/persistent. Hoffman responds to this with with what he calls "flexible persistence" - when founders have conviction with their own theory/vision but still the ability and willingness to listen to guidance. More specifically he suggests re-evaluating the original hypotheses and proposing slight alterations.
But that workflow doesn't make sense for real dev teams. So there's https://github.com/serverless/serverless . It's driven by a yaml file and is intuitive.
The only thing I'm bothered by is lack of environment variables (have to hard code them) and terrible API Gateway latency - see https://news.ycombinator.com/item?id=12681926 further down the page
Lambda itself is fairly quick (~75ms), but API Gateway needs some work.
Bare ec2: 15ms
Lambda via API Gateway: 276ms
[0]: http://prerender.cloud/lambda-latency [1]: https://news.ycombinator.com/item?id=12678011
and curiosity as to how far Lambda is from being used for anything latency sensitive - but it turns out Lambda isn't the slow part - it's API Gateway.