mirror of https://github.com/grpc/grpc-web.git
Replace use of `third_party/closure-library` submodule
... in favor of `google-closure-library` npm package. Removed the third_party/closure-library submodule following the instructions here: https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial#Removal Tested: - Verified that `npm run build` inside `packages/grpc-web` generates exactly the same output as before. - Test ran closure client: `docker-compose up --build node-server envoy closure-client`
This commit is contained in:
parent
a56e7212a3
commit
a489de6f9e
|
@ -1,6 +1,3 @@
|
||||||
[submodule "third_party/closure-library"]
|
|
||||||
path = third_party/closure-library
|
|
||||||
url = https://github.com/google/closure-library.git
|
|
||||||
[submodule "third_party/protobuf"]
|
[submodule "third_party/protobuf"]
|
||||||
path = third_party/protobuf
|
path = third_party/protobuf
|
||||||
url = https://github.com/protocolbuffers/protobuf.git
|
url = https://github.com/protocolbuffers/protobuf.git
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -8,13 +8,6 @@ plugin:
|
||||||
install-plugin:
|
install-plugin:
|
||||||
cd "$(ROOT_DIR)"/javascript/net/grpc/web && make install
|
cd "$(ROOT_DIR)"/javascript/net/grpc/web && make install
|
||||||
|
|
||||||
client:
|
|
||||||
cd "$(ROOT_DIR)"/net/grpc/gateway/examples/echo && make client
|
|
||||||
|
|
||||||
install-example:
|
|
||||||
cd "$(ROOT_DIR)"/net/grpc/gateway/examples/echo && make install
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd "$(ROOT_DIR)"/net/grpc/gateway/examples/echo && make clean
|
|
||||||
cd "$(ROOT_DIR)"/javascript/net/grpc/web && make clean
|
cd "$(ROOT_DIR)"/javascript/net/grpc/web && make clean
|
||||||
cd "$(ROOT_DIR)"
|
cd "$(ROOT_DIR)"
|
||||||
|
|
|
@ -14,18 +14,11 @@
|
||||||
|
|
||||||
FROM grpcweb/prereqs
|
FROM grpcweb/prereqs
|
||||||
|
|
||||||
RUN apt-get -qq update && apt-get -qq install -y \
|
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo
|
||||||
default-jdk
|
|
||||||
|
|
||||||
WORKDIR /github/grpc-web
|
RUN npm install
|
||||||
|
|
||||||
RUN curl -sS https://dl.google.com/closure-compiler/compiler-20190909.zip \
|
RUN make client && make install
|
||||||
-o compiler-latest.zip
|
|
||||||
|
|
||||||
RUN rm -f closure-compiler.jar && \
|
|
||||||
unzip -p -qq -o compiler-latest.zip *.jar > closure-compiler.jar
|
|
||||||
|
|
||||||
RUN make client && make install-example
|
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
|
|
@ -26,20 +26,20 @@ WORKDIR /github/grpc-web
|
||||||
COPY ./scripts ./scripts
|
COPY ./scripts ./scripts
|
||||||
RUN ./scripts/init_submodules.sh
|
RUN ./scripts/init_submodules.sh
|
||||||
|
|
||||||
|
COPY ./packages ./packages
|
||||||
|
RUN cd ./packages/grpc-web && \
|
||||||
|
npm install && \
|
||||||
|
npm run build && \
|
||||||
|
npm link
|
||||||
|
|
||||||
COPY ./Makefile ./Makefile
|
COPY ./Makefile ./Makefile
|
||||||
COPY ./WORKSPACE ./WORKSPACE
|
COPY ./WORKSPACE ./WORKSPACE
|
||||||
COPY ./bazel ./bazel
|
COPY ./bazel ./bazel
|
||||||
COPY ./javascript ./javascript
|
COPY ./javascript ./javascript
|
||||||
COPY ./net ./net
|
COPY ./net ./net
|
||||||
COPY ./packages ./packages
|
|
||||||
COPY ./src ./src
|
COPY ./src ./src
|
||||||
COPY ./test ./test
|
COPY ./test ./test
|
||||||
|
|
||||||
RUN cd ./packages/grpc-web && \
|
|
||||||
npm install && \
|
|
||||||
npm run build && \
|
|
||||||
npm link
|
|
||||||
|
|
||||||
RUN wget -nv -O buildifier \
|
RUN wget -nv -O buildifier \
|
||||||
https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier && \
|
https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier && \
|
||||||
chmod +x ./buildifier && \
|
chmod +x ./buildifier && \
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
/package-lock.json
|
||||||
|
/node_modules
|
|
@ -13,9 +13,9 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ROOT_DIR = ../../../../..
|
ROOT_DIR = ../../../../..
|
||||||
|
NPM_DIR = ./node_modules
|
||||||
PROTOC = protoc
|
PROTOC = protoc
|
||||||
PROTOS_PATH = ../..
|
PROTOS_PATH = ../..
|
||||||
EXAMPLES_PATH = net/grpc/gateway/examples/echo
|
|
||||||
HTML_DIR = /var/www/html
|
HTML_DIR = /var/www/html
|
||||||
JS_IMPORT_STYLE = import_style=closure,binary
|
JS_IMPORT_STYLE = import_style=closure,binary
|
||||||
JS_PATH = javascript/net/grpc/web
|
JS_PATH = javascript/net/grpc/web
|
||||||
|
@ -36,12 +36,12 @@ compiled-js:
|
||||||
rm $(ROOT_DIR)/$(PROTOBUF_PATH)/js/compatibility_tests/v3.0.0/commonjs/*_test.js || true
|
rm $(ROOT_DIR)/$(PROTOBUF_PATH)/js/compatibility_tests/v3.0.0/commonjs/*_test.js || true
|
||||||
rm $(ROOT_DIR)/$(PROTOBUF_PATH)/js/compatibility_tests/v3.1.0/*_test.js || true
|
rm $(ROOT_DIR)/$(PROTOBUF_PATH)/js/compatibility_tests/v3.1.0/*_test.js || true
|
||||||
rm $(ROOT_DIR)/$(PROTOBUF_PATH)/js/compatibility_tests/v3.1.0/binary/*_test.js || true
|
rm $(ROOT_DIR)/$(PROTOBUF_PATH)/js/compatibility_tests/v3.1.0/binary/*_test.js || true
|
||||||
java \
|
./node_modules/.bin/google-closure-compiler \
|
||||||
-jar $(ROOT_DIR)/closure-compiler.jar \
|
--js=*.js \
|
||||||
--js $(ROOT_DIR)/javascript \
|
--js=$(OUT_DIR)/*.js \
|
||||||
--js $(ROOT_DIR)/net \
|
--js=$(ROOT_DIR)/javascript \
|
||||||
--js $(ROOT_DIR)/third_party/closure-library \
|
--js=$(ROOT_DIR)/$(PROTOBUF_PATH)/js \
|
||||||
--js $(ROOT_DIR)/$(PROTOBUF_PATH)/js \
|
--js=$(NPM_DIR)/google-closure-library \
|
||||||
--entry_point=goog:proto.grpc.gateway.testing.EchoServiceClient \
|
--entry_point=goog:proto.grpc.gateway.testing.EchoServiceClient \
|
||||||
--dependency_mode=PRUNE \
|
--dependency_mode=PRUNE \
|
||||||
--js_output_file compiled.js
|
--js_output_file compiled.js
|
||||||
|
@ -64,4 +64,5 @@ install:
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f compiled.js
|
rm -f compiled.js
|
||||||
|
rm -f *_pb.js
|
||||||
rm -rf $(OUT_DIR)
|
rm -rf $(OUT_DIR)
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "echo-closure-example",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "gRPC-Web Closure JS client example",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"google-closure-compiler": "~20200224.0.0",
|
||||||
|
"google-closure-library": "~20201102.0.1"
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,6 +26,7 @@
|
||||||
"@types/google-protobuf": "~3.7.0",
|
"@types/google-protobuf": "~3.7.0",
|
||||||
"command-exists": "~1.2.8",
|
"command-exists": "~1.2.8",
|
||||||
"google-closure-compiler": "~20200224.0.0",
|
"google-closure-compiler": "~20200224.0.0",
|
||||||
|
"google-closure-library": "~20201102.0.1",
|
||||||
"google-protobuf": "~3.14.0",
|
"google-protobuf": "~3.14.0",
|
||||||
"gulp": "~4.0.2",
|
"gulp": "~4.0.2",
|
||||||
"gulp-eval": "~1.0.0",
|
"gulp-eval": "~1.0.0",
|
||||||
|
|
|
@ -27,7 +27,7 @@ const indexPath = path.relative(cwd, path.resolve(__dirname, "../index.js"));
|
||||||
const jsPaths = [
|
const jsPaths = [
|
||||||
"../exports.js",
|
"../exports.js",
|
||||||
"../../../javascript",
|
"../../../javascript",
|
||||||
"../../../third_party/closure-library",
|
"../node_modules/google-closure-library",
|
||||||
].map(jsPath => path.relative(cwd, path.resolve(__dirname, jsPath)));
|
].map(jsPath => path.relative(cwd, path.resolve(__dirname, jsPath)));
|
||||||
|
|
||||||
const closureArgs = [].concat(
|
const closureArgs = [].concat(
|
||||||
|
|
|
@ -472,7 +472,7 @@ describe('grpc-web generated code (closure+grpcwebtext)', function() {
|
||||||
const jsPaths = [
|
const jsPaths = [
|
||||||
".",
|
".",
|
||||||
"../../../javascript",
|
"../../../javascript",
|
||||||
"../../../third_party/closure-library",
|
"../node_modules/google-closure-library",
|
||||||
"../../../third_party/protobuf/js",
|
"../../../third_party/protobuf/js",
|
||||||
].map(jsPath => path.relative(cwd, path.resolve(__dirname, jsPath)));
|
].map(jsPath => path.relative(cwd, path.resolve(__dirname, jsPath)));
|
||||||
const closureArgs = [].concat(
|
const closureArgs = [].concat(
|
||||||
|
|
|
@ -16,5 +16,4 @@ set -ex
|
||||||
|
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
git submodule --quiet update --init --recursive
|
git submodule --quiet update --init --recursive
|
||||||
(cd third_party/closure-library && git checkout tags/v20201102)
|
|
||||||
(cd third_party/protobuf && git checkout tags/v3.15.6)
|
(cd third_party/protobuf && git checkout tags/v3.15.6)
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit be4ae2429d4cce84c9c0ede68328ae010c24328a
|
|
Loading…
Reference in New Issue