markerikson/react-redux-cesium-testing-demo là dự án JavaScript với 52 sao. A sample project demonstrating configuration of React, Redux, Webpack, Cesium, and Mocha
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This sample project demonstrates a variety of useful project configuration and setup techniques, including:
Application
Application code using React and Redux, with bare-basic usage of loading images and CSS
Creation of a React component that is loaded asynchronously and rendered when it becomes available
Usage of the Cesium 3D globe library inside a React component, with another React component attaching a Cesium billboard to the globe
Webpack
Configuration using a "base" set of config options, and multiple extensions of that for development, production, and multiple test execution approaches
Use of Webpack's DllPlugin and DllReferencePlugin to pre-compile specific dependencies, allowing later application builds to be faster since those dependencies don't need to be parsed
Use of Cesium as installed from NPM, and with the Cesium pre-built assets served directly from /node_modules/cesium/ instead of requiring a copy step during development
Testing
Test configuration using Mocha+JSDOM+Chai+Sinon+Enzyme, allowing execution of application tests and React component unit tests in a Node environment without the need for Karma or a browser
Testing of a React component that uses Cesium primitives
Demonstration of several different approaches for running Mocha tests:
Build bundle with Webpack, run Mocha against the bundle
Use of mocha-loader to run a live-watching test server, with results displayed in a browser
Use of mocha-webpack to run a live-watching test process, with results displayed in a console
Miscellaneous Setup
Basic ESLint configuration for style checking
Use of the shrinkpack tool for committing dependencies with minimal overhead, thus allowing dependable and repeatable installations while minimizing the risk of being affected by problems like NPM-Left-Pad-Gate
Note that this codebase started as a prototype / research project, and any actual code in here is probably pretty ugly and not well documented. The intent is to demonstrate a mostly-working project configuration that implements some specific capabilities, and might serve as a useful example for others interested in the same approaches. You probably don't want to use this as the basis for an actual production application :)
Getting started
Clone this repo, and run npm install. All the dependencies should be installed directly from the /node_shrinkwrap/ folder, rather than having to go out to the NPM servers.
Then, execute npm run dll:build to pre-compile the "vendor" and "cesiumDll" bundles, which need to be available during the development process.
Finally, run npm run dev to start development.
Development commands
These commands are NPM scripts defined in the "scripts" section of package.json
npm run dev: starts the local app development-mode server, at http://localhost:3000
npm start: same as npm run dev
npm run build: does a production compile of the source, and writes it to /dist
npm run dll:build: builds both the "vendor" and "cesiumDll" bundles
npm run dll:build:vendor: builds the "vendor" bundle
npm run dll:build:cesium: builds the "cesiumDll" bundle
npm run lint: executes ESLint to flag code style problems
npm test: does a compile of the test dependencies, writes to /disttest, and executes the test suite
npm run test:build: does the test compilation step
npm run test:run: uses the Mocha test runner to execute an already-built test suite
npm run test:dev: starts the local test-running development-mode server for mocha-loader, at http://localhost:3001
npm run test:fast: uses mocha-webpack to compile and execute the test suite once
npm run test:watch: starts mocha-webpack to execute tests in live-watching mode in a console
Managing Dependencies using Shrinkpack
The recent uproar over the unpublishing of "left-pad" and the subsequent breakage of thousands of NPM packages and build environments demonstrates the need to maintain a fixed list of all transitive dependencies. However, the common suggestion of checking in /node_modules/ is a bad idea. A typical /node_modules/ folder is easily 20K files and 150MB, and probably has platform-specific post-installation build artifacts (such as node-sass's native-code SASS compiler).
While researching this issue in 2015, I ran across a tool called https://github.com/JamieMason/shrinkpack , which seems to solve most of this issue. It simply refers to a npm-shrinkwrap.json file, and uses NPM's caching abilities to grab the tarballs for each exact dependency. It copies those to a /node_shrinkwrap/ folder, which can then be easily committed. That folder will probably be more like 500-750 files and 20MB - much more manageable. Re-running shrinkpack after a package update will just add or remove a few tarballs as needed, rather than having to re-commit hundreds or thousands of files under /node_modules/. In addition, having the pre-install packages available means that the project can have npm install run on multiple platforms, without worrying that a Linux build artifact got checked out on Windows. There's also no need for NPM to go out to a server during an install, as all dependencies are right here and pre-specified. That means a build environment doesn't have to have a network connection.
A typical Shrinkpack workflow for managing dependencies looks like this:
# one-time global install of shrinkpack
npm install -g shrinkpack
# install whatever packages you want to update
npm install some-package --save-dev
# once you are ready to persist the upgrade, then re-generate
# npm-shrinkwrap.json, including devDependencies
npm shrinkwrap --dev
# re-run shrinkpack to rewrite the shrinkwrap links to
# point to ./node_shrinkwrap/some-tarball.tgz
shrinkpack
# add new package files to version control
git add npm-shrinkwrap.json
git add node_shrinkwrap
git commit -m "Updated some-package"
Repo Layout
$REPO
dist: output folder for the production build
disttest: output folder for the test build
distdll: output folder for the "DLL" bundles
node_modules: local installations of JS build and app dependencies (NOT checked in)
node_shrinkwrap: downloaded zip files needed to install those dependencies (checked in)
Đọc thêm về markerikson/react-redux-cesium-testing-demo ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/markerikson/react-redux-cesium-testing-demo là nguồn chính thức.
markerikson/react-redux-cesium-testing-demo có bao nhiêu sao?
markerikson/react-redux-cesium-testing-demo có 52 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/markerikson/react-redux-cesium-testing-demo. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
markerikson/react-redux-cesium-testing-demo có phải mã nguồn mở không?
Có — markerikson/react-redux-cesium-testing-demo phát hành theo license ISC, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/markerikson/react-redux-cesium-testing-demo.
markerikson/react-redux-cesium-testing-demo có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho markerikson/react-redux-cesium-testing-demo. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
markerikson/react-redux-cesium-testing-demo có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho markerikson/react-redux-cesium-testing-demo. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
markerikson/react-redux-cesium-testing-demo còn đang phát triển không?
Commit gần nhất trên markerikson/react-redux-cesium-testing-demo là 10.3 năm trước (theo timestamp GitHub). Repo có 6 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
react-redux-cesium-testing-demo có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về react-redux-cesium-testing-demo.