This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server/ssr): move server push code to own file
feat(server/ssr): move server push code to own file and comment it
- Loading branch information
Showing
2 changed files
with
45 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Object.keys(assets).map(key => { | ||
// const bundle = assets[key] | ||
// Object.keys(bundle).map(async filetype => { | ||
// const filename = bundle[filetype] | ||
// const isJS = filetype === 'js' | ||
// const isCSS = filetype === 'css' | ||
// | ||
// var stream = res.push(filename, { | ||
// status: 200, // optional | ||
// method: 'GET', // optional | ||
// request: { | ||
// accept: '*/*' | ||
// }, | ||
// response: { | ||
// 'content-type': isJS | ||
// ? 'application/javascript' | ||
// : isCSS ? 'text/css' : 'text/html' | ||
// } | ||
// }) | ||
// | ||
// const readFileAsync = path => { | ||
// return new Promise((resolve, reject) => { | ||
// try { | ||
// readFile(path, (err, data) => { | ||
// if (err) { | ||
// reject(err) | ||
// } | ||
// resolve(data) | ||
// }) | ||
// } catch (e) { | ||
// reject(e) | ||
// } | ||
// }) | ||
// } | ||
// | ||
// const memoizedReadFileAsync = _.memoize(readFileAsync) | ||
// const dataToStream = await memoizedReadFileAsync( | ||
// `${process.env.CLIENT_DIST_PATH}/${filename}` | ||
// ) | ||
// stream.end(dataToStream) | ||
// }) | ||
// }) |