Repository navigation
Release v0.2.0: size, center, CSS styling and tests - #102
Merged
Merged
Conversation
Fix the CommonJS build, which required ./FetchLoading and tslib that are not part of the published package, and ship separate type declarations for import and require. Add size and center props, pass className, style and other div attributes through, accept any CSS color and support the --fetch-loading-color and --fetch-loading-size custom properties. Respect prefers-reduced-motion. Inline the styles instead of injecting them via PostCSS and drop the unused react-dom peer dependency. Remove five unneeded build dependencies, which also resolves the deepmerge audit warnings. Add render, type and package export tests, run CI against React 18 and 19, and check the published package weekly. Add animated SVG previews to the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Summary
Review of the package with a focus on how easily it can be integrated into and customized in other projects, plus a test setup that catches broken builds before and after publishing.
Bug fixes
dist/index.jsonly containedrequire("tslib")andrequire("./FetchLoading"), neither of which is part of the published package. Any consumer usingrequire(Jest, CJS SSR, older Next.js setups) crashed. Cause wasmodule: nodenextintsconfig.json.publintreported that the types were interpreted as CJS forimport. There is now a separatedist/index.d.mts, andpackage.jsondeclares"type": "commonjs".rgba(…, 1)was rejected while some invalid strings were accepted. The validation is removed (see below).New features
size: number (px) or any CSS length; gap, padding and bounce height scale with it.center: fills the parent and centers the dots horizontally and vertically.className,styleand all otherdivattributes are passed through;FetchLoadingPropsis exported.themeaccepts any CSS color (named colors,hsl(),var(--x), …).--fetch-loading-colorand--fetch-loading-sizefor theming via CSS. Built-in styles use:where(), so consumer CSS always wins.prefers-reduced-motion: a gentle fade instead of the bouncing animation.Dependencies
@rollup/plugin-node-resolve,@rollup/plugin-commonjs,rollup-plugin-peer-deps-external,rollup-plugin-postcss(styles are now inlined as a<style>element, SSR-safe,"sideEffects": false). This also resolves the two low-severitydeepmergeadvisories;npm auditreports 0 vulnerabilities.react-domfrompeerDependencies, the component never uses it.react,react-dom,publintand@arethetypeswrong/clifor the tests.exportsfield andprepublishOnly(build + all tests).Tests and CI
npm test: 16 render tests for both the ESM and the CJS build, resolved through the package's ownexports.npm run test:types: type checks a consumer file against the published declarations, including@ts-expect-errorcases.npm run test:package:publint --strictandattw --pack.npm packtarball (instead of yalc) for React 18 and 19 and checks dot count, size, color and animation in Puppeteer.fetch-loading@latestfrom npm against the latest React releases.actions/setup-nodebumped to v4.Docs
README documents the new props, CSS custom properties, reduced motion, a props table and the development scripts. Animated SVG previews live in
assets/and are referenced viaraw.githubusercontent.comURLs so they also render on npmjs.com; they only show up once this is merged intomain.Notes for reviewers
themevalues are no longer filtered by validation; the browser ignores invalid CSS and the default color applies.ariaLabelon purpose, since a fixed English "Loading" is not appropriate for every project.🤖 Generated with Claude Code