X Tutup
Skip to content

refactor: convert custom JS components to Bootstrap-style classes#2587

Open
codecalm wants to merge 12 commits intodevfrom
dev-js-libraries
Open

refactor: convert custom JS components to Bootstrap-style classes#2587
codecalm wants to merge 12 commits intodevfrom
dev-js-libraries

Conversation

@codecalm
Copy link
Member

@codecalm codecalm commented Jan 10, 2026

This pull request makes significant improvements to the JavaScript codebase by refactoring several UI utility modules into class-based, modular implementations with better initialization, instance management, and extensibility. It also updates GitHub Actions workflows for build and test, and simplifies Bootstrap component imports for more consistent usage.

Refactoring and Modularization of UI Utilities:

  • Converted autosize.ts, clipboard.ts, countup.ts, and input-mask.ts to class-based implementations, encapsulating their logic, supporting instance management, and providing clear APIs for initialization, updating, and disposal. These changes improve maintainability and extensibility of these modules. [1] [2] [3] [4] [5]
  • Added instance storage using WeakMap for all above modules, enabling safe retrieval and management of instances associated with DOM elements. [1] [2] [3] [4]

Bootstrap Integration and Component Initialization:

  • Switched imports of Bootstrap components (e.g., Dropdown, Popover) from local wrappers to direct imports from the bootstrap package, ensuring up-to-date and consistent usage. [1] [2]
  • Added new files for initializing Bootstrap-based components (collapse.ts, modal.ts, offcanvas.ts) directly on elements with appropriate data attributes, supporting more declarative UI behavior. [1] [2] [3]

Workflow and Build Improvements:

  • Added a new GitHub Actions workflow file .github/workflows/build.yml to automate build steps on pull requests, including caching, dependency installation, and building the project.
  • Updated .github/workflows/test.yml to clarify the job name, and changed the workflow to run tests instead of building, aligning with best CI practices. [1] [2]

Cleanup and Simplification:

  • Removed the bootstrap.ts re-export file, favoring direct imports for clarity and to reduce indirection.

Summary of Most Important Changes:

1. Refactoring and Modularization

  • Refactored autosize.ts, clipboard.ts, countup.ts, and input-mask.ts into class-based modules with instance management, improving extensibility and maintainability. [1] [2] [3] [4] [5]

2. Bootstrap Component Initialization

  • Added or improved initialization scripts for Bootstrap components (collapse, modal, offcanvas, dropdown, popover) using direct imports and data attributes for declarative UI. [1] [2] Fd30be4R1, [3] [4]

3. GitHub Actions Workflows

  • Introduced a new build workflow and updated the test workflow to run tests instead of builds, improving CI clarity and efficiency. [1] [2] [3]

4. Cleanup

  • Removed the bootstrap.ts file and its re-exports, simplifying Bootstrap usage across the codebase.

@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2026

⚠️ No Changeset found

Latest commit: 224de12

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
tabler Ready Ready Preview, Comment Jan 11, 2026 2:30pm
tabler-docs Ready Ready Preview, Comment Jan 11, 2026 2:30pm

…al methods, and update documentation for usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup