Skip to content

Commit 36e5f73

Browse files
committed
feat(many): instUI v11 release
many new changes removal of propTypes BREAKING CHANGE: - remove propTypes - remove CodeEditor
1 parent 04e93c8 commit 36e5f73

File tree

721 files changed

+10546
-30006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

721 files changed

+10546
-30006
lines changed

.github/workflows/visual-regression.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
env:
2424
ELECTRON_EXTRA_LAUNCH_ARGS: "--remote-debugging-port=9222"
2525
with:
26-
start: npm run dev
26+
build: npm run build
27+
start: npm start
2728
working-directory: regression-test
2829
- name: Upload cypress artifact for chromatic
2930
uses: actions/upload-artifact@v4
@@ -43,7 +44,7 @@ jobs:
4344
fetch-depth: 0
4445
- uses: actions/setup-node@v4
4546
with:
46-
node-version: 22.12.0
47+
node-version: 22
4748
- name: Install dependencies
4849
run: npm ci
4950
working-directory: regression-test

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ Instructure UI is an open source UI framework and design system for React. Its c
1212

1313
## Contributing
1414

15-
Before contributing please read our [code of conduct](https://instructure.design/#CODE_OF_CONDUCT) and read the [contribution guidelines](https://instructure.design/#contributing).
16-
17-
## React Support
18-
19-
Instructure UI currently supports 16.14.0 and higher.
15+
Before contributing, please read our [code of conduct](https://instructure.design/#CODE_OF_CONDUCT) and read the [contribution guidelines](https://instructure.design/#contributing).
2016

2117
## Browser Support
2218

cypress/component/Emotion-withStyle.cy.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
WithStyleProps,
3030
withStyle
3131
} from '@instructure/emotion/src/index'
32-
import PropTypes from 'prop-types'
3332

3433
import '../support/component'
3534
import 'cypress-real-events'
@@ -102,10 +101,6 @@ const generateStyle = function (
102101

103102
@withStyle(generateStyle, generateComponentTheme)
104103
class ThemeableComponent extends Component<Props, State> {
105-
static propTypes = {
106-
inverse: PropTypes.bool
107-
}
108-
109104
static defaultTypes = {
110105
inverse: false
111106
}

docs/contributor-docs/api-guidelines.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,42 @@ order: 4
1010

1111
- All components should pass through additional props down to the root DOM element using the `passthroughProps` utility. (e.g. `<div {...passthroughProps(this.props)}>`). Note that in addition to allowing only valid DOM node attributes, `passthroughProps` will remove the `className` and `style` props to prevent unexpected style issues. These need to be set explicitly and used with caution. It also removes the `styles` and `makesStyles` properties added by the [withStyle](#withStyle) decorator.
1212
- Avoid props that could be computed from other props. (e.g. prefer `<Select filter={handleFilter} />` over `<Select shouldFilter filter={handleFilter} />`. Prefer determining whether filtering should happen based on the presence of the `filter` function prop.)
13-
- Avoid situations where certain prop combinations are not supported. Prefer splitting the component into separate components with fewer props or using `PropTypes.oneOf`.
13+
- Avoid situations where certain prop combinations are not supported. Prefer splitting the component into separate components with fewer props.
1414
- Set default prop values for non-required props when possible.
1515

1616
#### General Naming Conventions
1717

1818
- Component prop names should be camelCase.
1919
- Avoid the 'default' prop prefix since all components should be controlled only.
2020
- If the component should allow custom DOM elements, it should provide an `as` prop. (e.g. `<Tag as="span" />` will render an HTML `span` element.)
21-
- Enum (`PropType.oneOf`) prop values should be kebab-case (dashes) (e.g. `size="x-small"`).
21+
- Enum prop values should be kebab-case (dashes) (e.g. `size="x-small"`).
2222

2323
#### Boolean props
2424

25-
- Boolean props should be avoided when possible in favor of `PropTypes.oneOf` (a list of possible values) so that it's easier to extend later on.
26-
- Avoid Boolean props that are mutually exclusive in favor of `PropTypes.oneOf` or separate components. For example, prefer `<Input interaction="disabled" />` over `<Input disabled />` where the `interaction` prop is `PropTypes.oneOf(['disabled', 'enabled', 'readonly'])`. Note that an input cannot be disabled and readonly, so these are mutually exclusive.
25+
- Avoid Boolean props that are mutually exclusive in favor of separate components. For example, prefer `<Input interaction="disabled" />` over `<Input disabled />` where the `interaction` prop is `'disabled' | 'enabled' | 'readonly'`. Note that an input cannot be disabled and readonly, so these are mutually exclusive.
2726
- Boolean props should begin with `should`/`is`/`does`/`has`/`with`.
2827
- When possible, default boolean props to `false` so that they can be set to `true` without a value. (e.g. prefer `<Modal isOpen />` over `<Modal isClosed={false} />`)
2928

3029
#### Function props
3130

32-
- Function props that provide custom rendering should be prefixed with `render` (e.g. `renderLabel`, `renderHeader`). These props can be set to `PropTypes.oneOfType([PropTypes.node, PropTypes.func])` for the most flexibility. If your prop only accepts strings and provides text that is only read by screen readers, use the `screenReader` prefix (e.g., `screenReaderLabel`).
31+
- Function props that provide custom rendering should be prefixed with `render` (e.g. `renderLabel`, `renderHeader`). If your prop only accepts strings and provides text that is only read by screen readers, use the `screenReader` prefix (e.g., `screenReaderLabel`).
3332
- Function props that handle events should be prefixed with `on` (e.g. `onDismiss`, `onClose`, `onSelect`).
3433
- Function props that handle DOM events should always pass in the [React SyntheticEvent](https://reactjs.org/docs/events.html) object as the first argument and any meta data about the event as a second argument.
3534
- Function props that handle DOM events should be chained (e.g. `createChainedFunction(this.props.onFocus, this.handleFocus)`) so that consumers are able to attach their own handlers in addition to the built in handlers.
3635
- Function [ref](https://reactjs.org/docs/refs-and-the-dom.html) props should have a `Ref` suffix and should describe the element to which it provides a ref (e.g. `inputRef`).
37-
- All components should provide an `elementRef` prop that will return a ref to the root DOM element.
36+
- All components should provide an `ref` prop that will return a ref to the root DOM element.
3837

3938
#### Children
4039

4140
- Prefer child components and composition with JSX vs. complex prop types. (e.g. prefer `<List><List.Item label="foo" /></List>` over `<List items={['foo']} />`)
4241
- Avoid using internal child components that aren't meant to be exported as part of the public component API. Prefer composition using other publicly available components that can be rendered in isolation or provide public child components.
4342
- If your component accepts a list of children, make sure it handles `null` children.
44-
- Child components that can't be used on their own should be exported as static properties on the parent component (e.g. `Table.Row`, `Menu.Item`), so that only one import is required to render the component (e.g. `import Table from '@instructure/ui-tables'`).
43+
- Child components that can't be used on their own should be exported as static properties on the parent component (e.g. `Table.Row`, `Menu.Item`), so that only one import is required to render the component (e.g. `import Table from '@instructure/ui-table'`).
4544
- If the parent component can only be used with specific children that can also be used on their own, it should have the `Group` suffix (e.g. `<RadioGroup><Radio /><Radio /></RadioGroup>`, `<ButtonGroup><Button /><Button /></ButtonGroup>`).
4645

47-
### styles.js Class Names
46+
### styles.ts Class Names
4847

49-
- In the `styles.js`, use the name of the component in camelCase (e.g. `appNav`) as the key of the root element's style object. Use camelCase for the keys of child elements as well (e.g. `list` and `listItem`).
48+
- In the `styles.ts`, use the name of the component in camelCase (e.g. `appNav`) as the key of the root element's style object. Use camelCase for the keys of child elements as well (e.g. `list` and `listItem`).
5049
- All style object names should be semantic (describe the content, not what it looks like).
5150
- We make use of the `label` property of [Emotion.js](https://emotion.sh/) so that it gets displayed in the generated class name for easy readability and targetability. We use a naming convention based on [BEM naming convention](#http://getbem.com/naming/):
5251
- For the root element, add a label with the name of the component in camelCase \

docs/contributor-docs/codemods.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ We support testing these warnings using special fixtures and a console.warn spy.
7070
---
7171
<MyComponent deprecatedProp="value" />
7272
```
73-
3. Create new sample output file with the array of expected warning messages in the `__testfixtures__` folder, filename follows the following naming convention: `[fixtureName].warning.output.[js/ts/tsx]`:
74-
```ts
73+
3. Create new sample output file with the array of expected warning messages in the `__testfixtures__` folder, filename follows the following naming convention: `[fixtureName].warning.output.json`:
74+
```json
7575
---
7676
type: code
7777
---

docs/contributor-docs/contributing.md

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Please follow the steps on the [how to build guide page](#building-instui).
2828
### Running the documentation app
2929

3030
1. Run `npm start`
31-
1. Open [http://localhost:8001](http://localhost:8001) in your browser
31+
1. Open [http://localhost:9090](http://localhost:9090) in your browser
3232

3333
### Development
3434

@@ -41,73 +41,29 @@ Please follow the steps on the [how to build guide page](#building-instui).
4141

4242
### Testing
4343

44-
See the [testing documentation](#testing-components) for details.
44+
See the [testing documentation](#testing-overview) for details.
4545

4646
### Linters and Code Formatting
4747

48-
Linters are run as part of the build. If you use the Sublime Text, Atom, or VSCode editors, you can set up the following plugins to catch lint and formatting errors earlier.
48+
Linters are run as part of the build. If you use VSCode, you can set up the following plugins to catch lint and formatting errors earlier.
4949

50-
1. Install the _Linter_ plugin [Sublime](http://sublimelinter.readthedocs.org/en/latest/), [Atom](https://atom.io/packages/linter). Linting is included in VSCode.
51-
1. Install the _EditorConfig_ plugin [Sublime](https://github.com/sindresorhus/editorconfig-sublime), [Atom](https://github.com/sindresorhus/atom-editorconfig), [VSCode](https://github.com/editorconfig/editorconfig-vscode)
52-
1. Install the _Eslint_ plugin [Sublime](https://github.com/roadhump/SublimeLinter-eslint), [Atom](https://github.com/AtomLinter/linter-eslint), [VSCode](https://github.com/Microsoft/vscode-eslint)
53-
1. Install the _Stylelint_ plugin [Sublime](https://github.com/kungfusheep/SublimeLinter-contrib-stylelint), [Atom](https://atom.io/packages/linter-stylelint), [VSCode](https://github.com/shinnn/vscode-stylelint)
50+
1. Install the _Eslint_ plugin [VSCode](https://github.com/Microsoft/vscode-eslint)
51+
1. Install the _Stylelint_ plugin [VSCode](https://github.com/stylelint/vscode-stylelint)
5452
1. Run `npm install` to install the dependencies
5553
1. Restart your editor
5654

5755
### Documentation
5856

5957
Please update the documentation and examples with any changes.
6058

61-
- `npm start` will build the production version of the documentation. You can view it at [http://localhost:8001](http://localhost:8001).
59+
- `npm start` will build the production version of the documentation. You can view it at [http://localhost:9090](http://localhost:9090).
6260
- All components and utilities should be well documented, including examples.
6361
- Write documentation inline in code comment blocks. The code and docs should
6462
always be in sync.
6563

6664
### Commit Guidelines
6765

68-
1. Run `git commit` to commit your changes and follow our commit message format.
69-
1. Please do not include the output of `npm run build` in your commits.
70-
71-
### Adding a package
72-
73-
1. Run `npm run generate:package` and choose a name for your package (use "kebab" case (dashes), e.g. 'my-package').
74-
2. Run `npm install` to update the lockfile.
75-
3. Give a new package `description` in the `package.json` file.
76-
4. Add package reference in the root `tsconfig.references.json`.
77-
5. Register your package in the **docs app**:
78-
1. Add an alias for your package in `packages/__docs__/resolve.js`.
79-
2. Add the dependency in `packages/__docs__/package.json`.
80-
3. Add the reference in `packages/__docs__/tsconfig.build.json`.
81-
6. Stop the dev server (if you have it running), and run `npm run dev` to pick up the new package.
82-
7. Visit [http://localhost:9090](http://localhost:9090) in a browser. You should see your package listed in the docs.
83-
84-
### Adding a component
85-
86-
1. Run `npm run generate:component` and choose a name for your component (use Pascal case: e.g., 'MyComponent').
87-
2. Choose to create a new package for your component, add it to an existing package, or create the component with no package.
88-
3. If you added the component to an **existing package**:
89-
1. Don't forget to [add the new dependencies and devDependencies](/#contributing/#code-guidelines-adding-a-new-dependency) to the package.
90-
2. List the new component in the package's `README.md` file under the `### Components` title (use other packages as reference when there is no "Components" block yet).
91-
3. Export the component from the `packages/[package]/src/index.js` (`export { MyComponent } from './MyComponent'`)
92-
4. Export the "Props type" from the `packages/[package]/src/index.js` (`export type { MyComponentProps } from './MyComponent/props'`)
93-
4. If you created a **new package** for your component:
94-
1. Follow the setup steps 2-5 of [Adding a package](/#contributing/#code-guidelines-adding-a-package). Do not start the dev server yet.
95-
2. The exports for the component and its Props type will be added automatically to `packages/[package]/src/index.js`.
96-
5. When adding a child component to another component, modify the child's `componentId` to be prefixed with the parent, e.g.: `MyComponent.Item`.
97-
6. [Register the components Theme type](/#contributing/#code-guidelines-registering-the-components-theme-type). For the initial setup, define the mock variables used in the `theme.js`.
98-
7. Run `npm install` to update the lockfile.
99-
8. Run `npm run bootstrap` to generate the `es`, `lib` and `types` directories for your component.
100-
9. Add your component to `packages/__docs__/components.js`.
101-
10. Stop the dev server (if you have it running), and run `npm run dev` to pick up the new component.
102-
11. Visit [http://localhost:9090](http://localhost:9090) in a browser. You should see your component listed in the docs.
103-
12. Start making changes to your component, and watch it update in the browser automatically.
104-
13. Resolve all `FIXME` comments in the generated code (except in the `MyComponentLocator.ts`).
105-
14. Add a short description of the new component to the `packages/__docs__/buildScripts/ai-accessible-documentation/summaries-for-llms-file.json` file. This will optimize the component's documentation for consumption by AI agents.
106-
107-
### Adding a new dependency
108-
109-
1. Add the new dependency or devDependency in the package's `package.json`.
110-
2. If the dependency is one of our own `@instructure/` packages, add it to the type references in the package's `tsconfig.build.json` too.
66+
Run `git commit` to commit your changes and follow our commit message format.
11167

11268
### Registering the components Theme type
11369

docs/contributor-docs/release.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ git push origin release
152152

153153
Major version updates are very similar to minor updates but there are a couple additinal things to take care of.
154154

155-
##### 1. Create a maintenance branch
155+
##### 1. Write an upgrade guide
156+
157+
Update `upgrade-guide.md` with the new major version and the breaking changes.
158+
159+
##### 2. Create a maintenance branch
156160

157161
Before the update, create a maintenance branch from the current master and push it to remote. If the current major version is 11, then:
158162

@@ -164,17 +168,16 @@ git checkout -b v11_maintenance
164168
git push origin v11_maintenance
165169
```
166170

167-
##### 2. Update the version mapping for the docs
171+
##### 3. Update the version mapping for the docs
168172

169173
Update the fields in the file `./packages/__docs__/versions.json` with the latest version and the maintenance branch map. Remove old unsupported versions if they are no longer needed and you don't want them to appear in the docs page version selector.
170174

171-
##### 3. Update version references in the docs app
175+
##### 4. Update version references in the docs app
172176

173177
1. In `docs/getting-started/usage.md` update the version in the code snippet for `package.json`
174-
2. In `packages/__docs__/src/Hero/index.tsx` update the url and title of the Upgrade Guide button
175-
3. In `packages/__docs__/src/Hero/index.tsx` update the url and title of the Upgrade Guide link in the "What's new?" section
176-
4. In `packages/__docs__/src/CodeSandboxButton/index.tsx` update the `@instructure/` dependencies to the latest version
178+
2. In `packages/__docs__/src/Hero/index.tsx` update title of the Upgrade Guide button
179+
3. In `packages/__docs__/src/CodeSandboxButton/index.tsx` update the `@instructure/` dependencies to the latest version
177180

178-
##### 4. Do a release like it was a minor update
181+
##### 5. Do a release like it was a minor update
179182

180183
Follow the same process as it's described above. The `npm run bump` command should automatically recognise that there were a breaking commit and it should be a major version change.

docs/contributor-docs/theming/theming-class-based.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ import generateComponentTheme from './theme'
2727

2828
@withStyle(generateStyle, generateComponentTheme)
2929
class Button extends React.Component {
30-
static propTypes = {
31-
// eslint-disable-next-line react/require-default-props
32-
makeStyles: PropTypes.func,
33-
// eslint-disable-next-line react/require-default-props
34-
styles: PropTypes.object
35-
}
36-
3730
componentDidMount() {
3831
this.props.makeStyles()
3932
}
@@ -213,13 +206,6 @@ type: code
213206
---
214207
// Button/index.js
215208
class Button extends React.Component {
216-
static propTypes = {
217-
// eslint-disable-next-line react/require-default-props
218-
makeStyles: PropTypes.func,
219-
// eslint-disable-next-line react/require-default-props
220-
styles: PropTypes.object
221-
}
222-
223209
constructor(props) {
224210
super(props)
225211

0 commit comments

Comments
 (0)