Welcome, and thank you for your interest in contributing to AppUI!
The goal of this document is to provide a high-level overview of how you can get involved.
We welcome contributions, large or small, including:
- Bug fixes
- New features
- Documentation corrections or additions
- Example code snippets
- Sample data
Have a question? Rather than opening an issue, first check the Github discussions page.
Our ui folder contains all our packages which are organized as such:
appui-reactshould contain exclusively layouts. These are the largest and most complicated components in AppUI.components-reactshould contain exclusively widgets: smaller components that are used insideappui-react. Ideally should largely be combinations of iTwinUI components.core-reactis marked to be decrepit at some point. Currently, it houses the smallest components inside AppUI. Ideally, all of these components would be replaced with the latest iTwinUI components and the entirecore-reactcould be deleted. Do not use these components if possible.imodel-components-reactcontains components and APIs that facilitate integration with an iTwin.js library.
Common fixes we are looking to solve include, but are not limited to:
- Replacing
@itwin/core-reactcomponents with iTwinUI components - Removing snapshot testing from unit tests
- Migrating to functional from class based React Components
Please follow these conventions when contributing to AppUI:
-
Consult the iTwinUI styling guide for all syntax conventions.
-
Be sure that your branch is up to date with the master branch (i.e.
git merge origin/master) -
All components should import a single SCSS file with a matching name, e.g.
Message.tsximportingMessage.scss. SCSS files should be siblings of their relative component files -
We are planning to migrate to CSS modules. Until then, minimize potential class name clashes by following this formula:
[abbr. of package name] + [folders] + [component]
Package name abbreviations:
- @itwin/appui-react - uifw
- @itwin/components-react - components
- @itwin/core-react - core
- @itwin/imodel-components-react - icr
For example, when working on MessageCenterField component under status-bar/fields directory in @itwin/appui-react one would use ”uifw-statusBar-fields-messageCenterField”
A Contribution License Agreement with Bentley must be signed before your contributions will be accepted. Upon opening a pull request, you will be prompted to use cla-assistant for a one-time acceptance applicable for all Bentley projects. You can read more about Contributor License Agreements on Wikipedia.
All submissions go through a review process from our developers using GitHub. Consult GitHub Help for more information on using pull requests.
See supported platforms for further information.
- Clone the repository.
- Go to the directory where you cloned the repo. e.g.
cd appui. - Install dependencies using
pnpm install. - Build the project using
pnpm build. - Run
pnpm devto start the storybook in the development environment. See testing options for alternative testing methods.
Note: It is a good idea to
pnpm installafter eachgit pullas dependencies may have changed.
pnpm cover
Each packages will generate a detailed coverage HTML report which can be accessed in
ui/[package]/lib/test/coverage/lcov-report/index.html. Ensure integration tests pass: See the related Readme
pnpm lint
pnpm prettier / pnpm prettier:fix
Please note that checking and documenting changes prior to PR submission is mandatory
pnpm extract-api
This will update the signature files, located in common/api. Note: before doing this, first do the following:
- Cleanup your build output:
pnpm clean - Rebuild the project:
pnpm build
Review any diffs to the API signature files in the common/api directory to ensure they are compatible with the intended release of the package.
If any differences are in packages not modified on this branch, revert the changes before committing.
Note: The CI build will break if changes are pushed without running
pnpm extract-api(if the API was changed).
pnpm changeset
Follow the prompts to enter changesets from which the changelog is generated. See README.md for more info
The repository is set up to allow 2 different ways of testing changes with manual interactions.
The test-app is an iTwin.js application that allows you to open both local .bim files and remote iModels from the iTwin Hub. See README.md for more info
Run pnpm app to start the test-app development server. Once running, you can access it at http://localhost:3000/. Make sure that the regular pnpm dev development environment is running in another terminal.
Note:
test-appis used by the end-to-end tests.
The storybook is a UI component explorer that uses Storybook.
Run pnpm dev to start the development server of storybook. Once running, you can access it at http://localhost:1801/.
Storybook is deployed with each PR build and can be accessed through the Storybook preview link in the PR checks. (Direct link: https://itwin.github.io/appui/[PR_NUMBER]) So adding stories for a feature facilitates PR reviews.
It is also deployed with master and can be accessed through this URL: https://itwin.github.io/appui/storybook
Have you identified a reproducible problem in iTwin.js AppUI? Have a feature request? We want to hear about it! Here's how you can make reporting your issue as effective as possible:
Before you create a new issue, please search open issues to see if the issue or feature request has already been filed.
If you find that your issue already exists, please add relevant comments and your reaction. Use a reaction in place of a "+1" comment:
- 👍 - upvote
- 👎 - downvote
If you cannot find an existing issue that describes your bug or feature, create a new issue using the guidelines below.
Please File a single issue per problem and feature request.
Refrain from adding your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
Please include the following information with each issue:
- A short description of the issue with a clear title
- Versions of relevant iTwin.js core and AppUI packages
- Minimal steps to reproduce the issue or a code snippet that demonstrates the issue
- What you expected to see, versus what you actually saw
- Images that help explain the issue
- Any relevant error messages, logs, or other details
- Impact of the issue
- Use the
bugorenhancementlabel to identify the type of issue you are filing
Please follow your issue and be responsive, as our developers might need more information! The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix!