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
[clover] Proposal: transferrable assets #2132
Comments
Hi @lacolaco, Thanks for this request but I am not understanding the use-case of this. We already provide a way to intercept and cache all HTTP requests, using the |
@alan-agius4 Yes This is a similar approach to |
I now see what you mean. Ideally, we should do this without extending the API, we already intercept the all HTTP request in I think in this case what we can do is add a fallback handler that adds a JFYI: in the code provided above, the assets are actually stored in that state but are never used by the client, this is because the cache key that the HTTP interceptor uses is more complex universal/modules/common/clover/src/transfer-http-cache/transfer-http-cache.interceptor.ts Line 65 in 094756f
|
@alan-agius4 That sounds the best. The difficulty is that not all requests should be fallback to |
I did some research on integration with msw to see if it might be useful. It may be able to solve the problem by actually creating a server instance of Node.js. |
Yeah, spawning a server is also another very valid approach. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Proposal
What is the summary of the proposal?
This proposal adds a capability for static rendering with external content files.
Usecases
What is the proposal?
Builder-side
Adding a
transferAssets
option to the@nguniversal/builders:static-generator
, which is an array that accepts paths of assets. It is relative from the output path of the browser target.Engine-side
Embedding assets as a JSON state immediately after
ngRenderMode
has been built.TransferState
will be initialized with the state.This is an implementation for proof of concept. I don't think it is production-ready but enough to explain what this proposal aims for.
lacolaco@52f7b7d
Is there anything else we should know?
Considerations
CustomResourceLoader
cannot help this usecase.assets
from the browser target can be used for this purpose, but assets can contain non-text files like images. So explicit option would be needed.The text was updated successfully, but these errors were encountered: