Do not produce preRenderData when --no-prerender option is specified. #1516
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug. Not harmful, but I think this is not intended behavior.
Did you add tests for your changes?
No.
Summary
preact build --no-prerender
produces<script type="__PREACT_CLI_DATA__">"preRenderData": { "url" : "/" }</script>
inbuild/index.html.
But preRenderData is used in pre-rendered components, I expect that
--no-prerender
needs to prevent preRenderData.Does this PR introduce a breaking change?
Yes.
I think existing programs do not rely on it.
Other information
Environment Info:
System:
OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: (6) x64 AMD Ryzen 5 3500 6-Core Processor
Binaries:
Node: 14.15.4 - /usr/bin/node
npm: 6.14.10 - /usr/bin/npm
npmPackages:
preact: ^10.3.2 => 10.5.10
preact-cli: ^3.0.0 => 3.0.5
preact-render-to-string: ^5.1.4 => 5.1.12
preact-router: ^3.2.1 => 3.2.1