Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: try fix our requireJS clash with building for the node platform and not browser #3395

Merged
merged 4 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
109 changes: 109 additions & 0 deletions .changeset/sweet-rats-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
'@twilio-paste/uid-library': major
'@twilio-paste/color-contrast-utils': major
'@twilio-paste/account-switcher': major
'@twilio-paste/alert': major
'@twilio-paste/alert-dialog': major
'@twilio-paste/anchor': major
'@twilio-paste/avatar': major
'@twilio-paste/badge': major
'@twilio-paste/base-radio-checkbox': major
'@twilio-paste/breadcrumb': major
'@twilio-paste/button': major
'@twilio-paste/button-group': major
'@twilio-paste/callout': major
'@twilio-paste/card': major
'@twilio-paste/chat-composer': major
'@twilio-paste/chat-log': major
'@twilio-paste/checkbox': major
'@twilio-paste/code-block': major
'@twilio-paste/combobox': major
'@twilio-paste/data-grid': major
'@twilio-paste/date-picker': major
'@twilio-paste/description-list': major
'@twilio-paste/detail-text': major
'@twilio-paste/disclosure': major
'@twilio-paste/display-heading': major
'@twilio-paste/display-pill-group': major
'@twilio-paste/editable-code-block': major
'@twilio-paste/file-picker': major
'@twilio-paste/file-uploader': major
'@twilio-paste/form': major
'@twilio-paste/form-pill-group': major
'@twilio-paste/heading': major
'@twilio-paste/help-text': major
'@twilio-paste/in-page-navigation': major
'@twilio-paste/inline-code': major
'@twilio-paste/inline-control-group': major
'@twilio-paste/input': major
'@twilio-paste/input-box': major
'@twilio-paste/label': major
'@twilio-paste/list': major
'@twilio-paste/menu': major
'@twilio-paste/minimizable-dialog': major
'@twilio-paste/modal': major
'@twilio-paste/pagination': major
'@twilio-paste/paragraph': major
'@twilio-paste/popover': major
'@twilio-paste/product-switcher': major
'@twilio-paste/progress-steps': major
'@twilio-paste/radio-button-group': major
'@twilio-paste/radio-group': major
'@twilio-paste/screen-reader-only': major
'@twilio-paste/select': major
'@twilio-paste/separator': major
'@twilio-paste/side-modal': major
'@twilio-paste/sidebar': major
'@twilio-paste/skeleton-loader': major
'@twilio-paste/slider': major
'@twilio-paste/spinner': major
'@twilio-paste/status': major
'@twilio-paste/switch': major
'@twilio-paste/table': major
'@twilio-paste/tabs': major
'@twilio-paste/textarea': major
'@twilio-paste/time-picker': major
'@twilio-paste/toast': major
'@twilio-paste/tooltip': major
'@twilio-paste/topbar': major
'@twilio-paste/truncate': major
'@twilio-paste/user-dialog': major
'@twilio-paste/visual-picker': major
'@twilio-paste/core': major
'@twilio-paste/aspect-ratio': major
'@twilio-paste/flex': major
'@twilio-paste/grid': major
'@twilio-paste/media-object': major
'@twilio-paste/stack': major
'@twilio-paste/box': major
'@twilio-paste/combobox-primitive': major
'@twilio-paste/disclosure-primitive': major
'@twilio-paste/listbox-primitive': major
'@twilio-paste/menu-primitive': major
'@twilio-paste/modal-dialog-primitive': major
'@twilio-paste/non-modal-dialog-primitive': major
'@twilio-paste/sibling-box': major
'@twilio-paste/tabs-primitive': major
'@twilio-paste/text': major
'@twilio-paste/tooltip-primitive': major
'@twilio-paste/customization': major
'@twilio-paste/design-tokens': major
'@twilio-paste/icons': major
'@twilio-paste/animation-library': major
'@twilio-paste/clipboard-copy-library': major
'@twilio-paste/code-editor-library': major
'@twilio-paste/data-visualization-library': major
'@twilio-paste/dropdown-library': major
'@twilio-paste/lexical-library': major
'@twilio-paste/react-spectrum-library': major
'@twilio-paste/react-textarea-autosize-library': major
'@twilio-paste/reakit-library': major
'@twilio-paste/styling-library': major
'@twilio-paste/syntax-highlighter-library': major
'@twilio-paste/style-props': major
'@twilio-paste/theme': major
'@twilio-paste/types': major
'@twilio-paste/utils': major
---

Modified the compile target of our JavaScript bundles from `node` to `browser` to minimize the risk of clashing with RequireJS. This is marked as a major out of an abundance of caution. You shouldn't need to do anything but we wanted you to be aware of the change on the off chance it has unintended consequences
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@
},
"resolutions": {
"csstype": "3.0.11",
"playwright": "1.28.1"
"playwright": "1.28.1",
"tslib": "2.6.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes all the different versions

},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-libraries/uid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"tsc": "tsc"
},
"dependencies": {
"react-uid": "2.3.1"
"react-uid": "2.3.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes tslib as a dependency.

},
"peerDependencies": {
"react": "^16.8.6 || ^17.0.2 || ^18.0.0",
Expand Down
28 changes: 21 additions & 7 deletions packages/paste-website/src/pages/core/upgrade-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ export const getStaticProps = async () => {

<content>

### Core 19.0.0
### Core 20.0.0 - August '23'

Updated the compilation target of our JavaScript bundles to be `browser` and not `node`. This has resulted in a small `24.5 kB` reduction in file size across the entire Core library.

**ACTION NEEDED**: None. This should be 100% backwards compatible, but you should be aware you are running different code.

See [the full change list](/core/changelog#20-0-0)

### Core 19.0.0 - March '23

- We have moved `@types/react` and `@types/react-dom` to peer dependencies of the library. This should allow for greater control and backwards compatibility with older versions of React as Paste is no longer bundling the type libraries. Your application likely has both of these as dependencies anyway, but it is now up to you to manage that version number.

Expand All @@ -49,7 +57,9 @@ Ensure `@types/react` and `@types/react-dom` are installed as dependencies of yo

**ACTION NEEDED**: No action should be necessary. If you are still using the `__console_patch` prop with Toast and this change affects your codebase, please [reach out to us with a Github Discussion](https://github.com/twilio-labs/paste/discussions/new/choose).

### Core 18.0.0
See [the full change list](/core/changelog#19-0-0) and the [documentation snapshot](https://release-v19--paste-docs.netlify.app/).

### Core 18.0.0 - February '23

- Adds [support for React 18](https://github.com/twilio-labs/paste/pull/2965). This should "just work" and remains backwards compatible. [Let us know if you have any issues](https://github.com/twilio-labs/paste/discussions).
- This major version included listing all the missing peer dependencies for each Paste package.
Expand All @@ -60,7 +70,9 @@ install all the missing peer dependencies.

**ACTION NEEDED**: If you are using the deprecated light/dark named design tokens, you will need to update your references to the new weak/strong named design tokens. You can find the new design tokens in the [design tokens changelog](/tokens/design-tokens-package#6-7-0).

### Core 17.0.0
See [the full change list](/core/changelog#18-0-0) and the [documentation snapshot](https://release-v18--paste-docs.netlify.app/).

### Core 17.0.0 - October '22'

- [Switch] Updated Switch component API to match other form components in Paste.

Expand All @@ -84,17 +96,19 @@ install all the missing peer dependencies.
- adds `checked?: boolean` to use the Switch in a controlled manner.
- adds `defaultChecked?: boolean` to set the default checked value in an uncontrolled manner.

**ACTION NEEDED**: If you are using the Switch component, you will need to update your code to use the new API. You can find the new API in the [Switch documentation](/components/switch).
**ACTION NEEDED**: If you are using the Switch component, you will need to update your code to use the new API. You can find the new API in the [Switch documentation](/components/switch).

See [the full change list](/core/changelog#17-0-0) and the [documentation snapshot](https://deploy-preview-2779--paste-docs.netlify.app/).

### Core 16.0.0
### Core 16.0.0 - October '22

- [Modal] We removed the `\_\_console_patch`` prop because it is no longer necessary. It was a hack needed for the legacy Console application, which is no longer in use. [See PR #2697](https://github.com/twilio-labs/paste/pull/2697)

**ACTION NEEDED**: None, but the `__console_patch` prop will no longer work if you are on a legacy application and need to use the Modal component. We recommend migrating to the new Console application.

See [the full change list](https://github.com/twilio-labs/paste/pull/2687) and the [documentation snapshot](https://deploy-preview-2687--paste-docs.netlify.app/).

### Core 15.0.0
### Core 15.0.0 - August '22

- [Design tokens] Created a new category of design token, Data Visualization, and subsequently relocated all
of the Data Visualization tokens from the generic Color category. If you are using categorized Data
Expand All @@ -104,7 +118,7 @@ See [the full change list](https://github.com/twilio-labs/paste/pull/2687) and t

See [the full change list](https://github.com/twilio-labs/paste/pull/2579/files) and the [documentation snapshot](https://deploy-preview-2579--paste-docs.netlify.app/).

### Core 14.0.0
### Core 14.0.0 - June '22

- [Textarea] Update Textarea to use `@twilio-paste/react-autosize-textarea` library and add the `resize` prop which allows users to resize the Textarea height.

Expand Down
2 changes: 1 addition & 1 deletion tools/build/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function build(packageJson) {
*/
mainFields: ['module', 'main'],
// Fixes issues related to SSR (website builds)
platform: 'node',
platform: 'browser',
bundle: true,
/**
* Sets the target environment so the code is changed into a format that
Expand Down