Apply instant loading with the PRPL pattern
I have no idea how local testing for Now is supposed to work, so I created a tiny HTTP server in dev.js
that calls the actual function that gets deployed.
Run npm run dev
to run a local version of the function for local testing.
- device (m): Which kind of device do you want to use in your tests. Should be one of -> m, t, d
- url: URLEncode of the url that ypu want to test.
- cdn: String to use in the filter of the results.
- strategy (allEvaluations): Which stategy do you want to use to filter the hints. Should be one of -> allEvaluations, longestEvaluation
- allEvaluations: Just all scripts evaluated, and coming from your CDN. Should be your ShellApp at least.
- longestEvaluation: From
allEvaluations
select the biggest evaluation, calculate his order of magnitude and use all the hints in the same order.
Using Now: now
.
$ now --prod -t $NOW_TOKEN