Remove string-replace-webpack-plugin to fix critical security warning.#7127
Closed
na9da wants to merge 3 commits into
Closed
Remove string-replace-webpack-plugin to fix critical security warning.#7127na9da wants to merge 3 commits into
string-replace-webpack-plugin to fix critical security warning.#7127na9da wants to merge 3 commits into
Conversation
The plugin was mainly used for replacing babel generated getters with `superGet` in mobx 4. But after mobx upgrade this is no longer required. It is currently only used for upadting the credit string in Ion.js that is shown when using the default Ion token. I have dropped that in favour of keeping the build script simpler.
na9da
commented
May 2, 2024
Comment on lines
-98
to
-113
| config.module.rules.push({ | ||
| test: /\.js?$/, | ||
| include: path.resolve(cesiumDir, "Source", "ThirdParty"), | ||
| loader: StringReplacePlugin.replace({ | ||
| replacements: [ | ||
| { | ||
| pattern: /\/\*[\S\s]*?\*\//g, // find multi-line comments | ||
| replacement: function (match) { | ||
| // replace http:// and https:// with a spelling-out of it. | ||
| return match.replace(/(https?):\/\//g, "$1-colon-slashslash "); | ||
| } | ||
| } | ||
| ] | ||
| }) | ||
| }); | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
The sprintf credits this was trying to replace is no longer a dependency of Cesium.
na9da
commented
May 2, 2024
Comment on lines
-77
to
-88
| { | ||
| pattern: /Please assign <i>Cesium.Ion.defaultAccessToken<\/i>/g, | ||
| replacement: function () { | ||
| return 'Please set "cesiumIonAccessToken" in config.json'; | ||
| } | ||
| }, | ||
| { | ||
| pattern: / before making any Cesium API calls/g, | ||
| replacement: function () { | ||
| return ""; | ||
| } | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Do we really need this?
Contributor
There was a problem hiding this comment.
I think it's pretty important. The default message is flat out wrong.
Collaborator
Author
There was a problem hiding this comment.
Ok, I'll work out a way to include it - I thought it was too small to read.
Contributor
|
I think substituting the Cesium Ion key default message is important to us |
Closed
Contributor
|
This dependency was removed in #7351, so this PR should probably be closed. |
Collaborator
|
this was moved to terriajs-cesium |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 this PR does
Removes string-replace-webpack-plugin which generates a security warning due to one of its stale dependency.
The plugin was mainly used for replacing babel generated getters with
superGetin mobx 4. But after mobx upgrade this is no longer required.It is currently only used for updating the credit string in Ion.js that is shown when using the default Ion token.
It looks like this:

I'm not sure if it is a very useful customization to have, so I have dropped it in favor of keeping the build script simpler. However if the consensus is to add it back, I can use a more updated webpack plugin like string-replace-loader or see if we can customize it run time instead of build time.
Test me
Shouldn't affect the app except it will now show Cesium's default credit line when a default access token is used.
Checklist
doc/.