-
Notifications
You must be signed in to change notification settings - Fork 144
Fix: Jest expects commonjs module by default #98
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
Conversation
"style": "release/dist/index.css", | ||
"typings": "release/index.d.ts", | ||
"module": "release/index.js", | ||
"main": "dist/cjs/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the jest issue.
I also moved the files into dist. I'm not sure why there was release
and dist
but it didn't seem necessary and was easy to clean up.
This should be backwards compatible since users shouldn't be referencing the release
paths directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was due to some legacy customer request, but, can remove now :)
"scripts": { | ||
"test": "jest", | ||
"test-update-snapshot": "jest -u", | ||
"cp-css": "./scripts/copy-css.sh", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cleaned up the rollup config so that this is no longer necessary. Rollup now outputs everything into dist
.
}, | ||
], | ||
], | ||
babelHelpers: 'bundled', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a warning:
babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
dir: 'dist/cjs', | ||
format: 'cjs', | ||
sourcemap: true, | ||
exports: 'named' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a warning:
(!) Entry module "src/lib/Sendbird.jsx" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "src/lib/Sendbird.jsx" to use named exports only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would remove this, makes our scope a little wider
Hey, thanks for the contribution, we need some time to a look at this~~ Probably take care of it end of this week/early next week |
@sravan-s any chance of landing this soon? it's blocking us from an upgrade since without it our jest-based test suite has trouble compiling. |
There is a release scheduled for 7th/8th of March, we can include this one there |
@aburgel We had soem holidays and bunch of other releases here. But we included it in 2.7.0 beta. We will test for a while and see if there are anyone with issues and release 2.7.0 formally https://github.com/sendbird/sendbird-uikit-react/releases/tag/v2.7.0-0 |
* [UK-965]Fix SENDING_MESSAGE_START payload mismatch (#18) * Fix SENDING_MESSAGE_START payload mismatch * Fix CSS issue with render custom message * [SBISSUE-5745] Add null check for sdk and sdk.ChannelHandler before createEventHandler (#20) * [UK-959] Use flex-end instead of end (#21) * Bugfix: Use simple logic to calculate isByMe (#23) * 2.4.2 * Add CHANGELOG for 2.4.2 * Updated the PR template to indicate we do not accepted external contributions * [UK-843] Add tests for message refactoring (#26) - Add key prop into the components of the split message - Add tests for TextMessageItemBody component - Add tests for FileMessageItemBody component - Add tests for UnknownMessageItemBody component - Add tests for ThumbnailMessageItemBody component - Add a function changeTypeToIconClassName for checking existence of icons * [UK-972] Get back the string set legacy (#27) * Add string set for hardcorded strings that are used in the selectring channel type modal (#34) * Use OpenChannel in the getOpenChannelDeleteMessage (#35) * [UK-975] Check condition before updating current user info (#36) * [UK-997] String set update (#39) * [UK-983] Channel instance check before reconnect (#37) * Add a condition to check if current group channel exists before reconnecting * Change interfaces naming to Dynamic and Static Params in the hook functions * [QU-309] Do not update last message if message id doesn't match (#47) * Hotfix: Add console for announcement of renderCustomMessage props (#54) * Add console for announcement of renderCustomMessage props * Deprecate unused prop readStatus Co-authored-by: Sravan S <sravan@sendbird.com> * [2.4.3] (Nov 1 2021) (#55) - Bugfix * Use OpenChannel in the getOpenChannelDeleteMessage * Do not try to reconnect when current channel is not selected * Do not update user info when nickname or profil url are empty string * Update latest message value on channelListItem only if the latest message is edited * Add string set for hardcorded strings that are used in the selecting channel type modal * String set update * 2.4.3 * [UK-1013] Fix file view error and add debouncing (#57) * Add debouncing logic to the MessageSearch component * Add optional chaining for isResendable of message * Add optional chaining for emojiCategories of message * Apply order to message search as 'ts' * Release v2.4.4 (#58) Add change log of v2.4.4 release * 2.4.4 * [UK-932]Integrate message threading (#56) * [Bugfix] Final QA of message threading (#59) - Lift restriction of replyType props of App and Channel components - [QU-361] Disable message delete submit button on modal when the message has replies - [QU-382] Do not allow the message grouping to pending and failed messages - [QU-385] Disable the delete button on FileViewer when the message has replies - Clear message input value and quoted message when the current channel is changed - Affect UI components to apply the on thread info updated event - Check if the left user is me * [Release] Add a CHANGELOG for an alpha release (#60) * Add a changelog for an alpha release * 2.5.0-alpha * [2.5.0] (Nov 23 2021) (#61) - Features * Support MessageThreading * <App /> and <Channel /> can enable or disable message threading feature using prop: `replyType` * `replyType="QUOTE_REPLY"` enable message threading * `replyType="NONE"` disable message threading, and this is a default option - Bugfix * Change the message status component location from the bottom of the message to the side of the message content * [2.5.0] (Nov 23 2021) including package.json (#62) - Features * Support MessageThreading * <App /> and <Channel /> can enable or disable message threading feature using prop: `replyType` * `replyType="QUOTE_REPLY"` enable message threading * `replyType="NONE"` disable message threading, and this is a default option - Bugfix * Change the message status component location from the bottom of the message to the side of the message content * [UK-943]Add open and group samples (#63) Add samples to show how real world project might look like Todo - Read values from .env Co-authored-by: Sravan S <sravan@sendbird.com> * [QU-390] Sequel patch for message threading (#64) - Move the location of message status and timestamp into the message content - Use paragraph tag in the Text message and OG message contents and set their word-break property to break-word - Add type definition with replyType to the App and Channel components props * Add optional chaining and change OR operation to AND in condition (#66) * [SBISSUE-7442]Add quote message to onBeforeSendFileMessage params (#67) Co-authored-by: Sravan S <sravan@sendbird.com> * Implement experimentalMessageLimit for openChannel (#68) Open channel has load issues. Because we dont have time to implement virtualLists we are implementing a hard limit for maximum messages that can be stored in OpenChannel Co-authored-by: Sravan S <sravan@sendbird.com> * Release/v2.5.1 (#69) * Add optional chaining for sender * Add changelog and version up sendbird sdk * Add changelog and use sdk version 3.1.4 * 2.5.1 * [CHANGELOG]Release 2.5.2.alpha.0 (#70) Features: * Implement experimentalMessageLimit for openChannel This feature limits the no.of messages that are stored in OpenChannel. This is intended for live streaming, where multiple thousands of messages are expected to flow Recommend a limit higher than 150 and less than 500 Usage: ``` <OpenChannel experimentalMessageLimit={number} /> ``` Fixes: * Fix time stamp position on message threading * Add quote message to onBeforeSendFileMessage params Co-authored-by: Sravan S <sravan@sendbird.com> * 2.5.2-0 * Fix scroll to bottom issue (#71) - Fix scroll to bottom issue - Add type definition for quotedMessage in Channel component props * Release v2.5.2 (#72) - Add changelog and fix CSS for highlighted message bg color * Modify type definition (#73) * 2.5.2 * Do not call updateUserInfo when nickname and profileUrl are empty string (#75) [UIKIT-1453] Do not call updateUserInfo when nickname and profileUrl are empty string * Modify React dependencies to devide to peer and dev (#74) * Check if nickname and profileUrl are null or empty string (#76) * Change PropTypes value of renderChatItem from element to func in ConversationScroll comp (#77) * v2.5.3-alpha * 2.5.3-0 * Release v2.5.3 (#79) * 2.5.3 * Fix: Add sortChannelList props to the ChannelListProps (#82) * Add sortChannelList props to the ChannelListProps UIKIT-1502 * Fix: Appear message status icon in safari (#83) * Set height and width value of every SVG icon * Remove meanless div tag from message status component * Reduce margin-top of message status text UIKIT-1490 * [UIKIT-576]Setup date localization (#78) [UIKIT-576](https://sendbird.atlassian.net/browse/UIKIT-576) Date can be localized using date-fns/locale Example: ``` import kr from 'date-fns/locale/ko'; import {App} from 'sendbird-uikit'; <App appId="" userId="" dateLocale={kr}/> ``` * Fix: Compilation issue Element not defined (#81) Thanks @aburgel * Fix: Event leakage issues (#80) * Block scrolling of body tag when pop-up components appear * Prevent unexpected scrolling when fetching messages * Add sample case for when chat app is smaller than the page size [UIKIT-1461](https://sendbird.atlassian.net/browse/UIKIT-1461) [UIKIT-1467](https://sendbird.atlassian.net/browse/UIKIT-1467) * Release: v2.6.0 (#84) * 2.6.0 * Fix/v2/UIKIT-1533_Add progressHandler into the GetSendFileMessage hook (#88) * Add progressHandler into the GetSendFileMessage hook [UIKIT-1533](https://sendbird.atlassian.net/browse/UIKIT-1533) * fix: Type definition OpenChanel.renderUserProfile (#95) https://sendbird.atlassian.net/browse/UIKIT-1537 https://sendbird.atlassian.net/browse/SBISSUE-7754 * fix: localization parameter for some format calls (#94) localization parameter was not passed correctly to some date-fn calls. Which caused some strings to be still in English Refs: * https://sendbird.atlassian.net/browse/UIKIT-1536 * https://sendbird.atlassian.net/browse/SBISSUE-7849 * Feature: [v2] Provide an auto select flag in the channel list (sendbird#99) * Add an ableAutoSelectChannelItem props to the App and ChannelList component * Modify setting current channel logic by ableAutoSelectChannelItem flag * Call onChannelSelect event handler only when the props is true [UIKit-1503](https://sendbird.atlassian.net/browse/UIKit-1503) * Fix: [v2] Exclude the optional param when locale is undefined in the dateFns utils (sendbird#103) * Exclude the optional param when locale is undefined in the dateFns utils * Fix: [v2] Appear MessageStatus component in Safari (sendbird#108) * Fix the issue that inline-flex causes disappearing component in Safari * Fix: Jest expects commonjs module by default(sendbird#98) - Use commonjs module as default - Bundle into dist, removes the need of cp-css script To do - * Revert exports: 'named' * Hotfix - donot use exports: 'named' (sendbird#112) This change was added during the rollup script This is to reduce scope of the change * Fix: [v2] Update message receipts on real time basis (sendbird#117) * Calculate message status in the message content component, not from outside of the component * Apply onUnreadMemberCountUpdated and onUndeliveredMemberCountUpdated channel handlers into the Conversation component [UIKIT-1620](https://sendbird.atlassian.net/browse/UIKIT-1620) * Fix: Suppress NO ACK error(sendbird#119) Call markAsRead inside try/catch block This error occurs in codesandbox Especially when multiple users are running same sandbox Error is command no ACK error that comes from markAsRead called in quick succession This is a stop gap solution Need to find proper fix. Fixes: sendbird.atlassian.net/browse/UIKIT-1619 Co-authored-by: Sravan S <sravan@sendbird.com> * Ready to v2.7.0 * 2.7.0 * Rever to release/dist * Update snapshot * Formatting * Revert react version * Update dependencies * Revert changes Co-authored-by: Sravan S <sravans2011@gmail.com> Co-authored-by: HoonBaek <hoon@sendbird.com> Co-authored-by: Sravan S <sravan@sendbird.com> Co-authored-by: Chris Chabot <chabotc@gmail.com> Co-authored-by: Alex Burgel <aburgel@gmail.com>
I'm running into two issues with a create react app v5 app and sendbird-uikit. I was able to fix them and clean up a few other parts of the build process.
The first issue occurs when running jest tests. Jest seems to expect
node_modules
to already be transpiled (or whatever it's called), but your package.json points it's main entrypoint at the esm variant, even though there is a commonjs variant produced.This is what the error looks like. The fix is to update
main
in package.json to point to the commonjs index.js.The second issue is it that the index.css sourcemap produces an error. TBH, I'm not sure why this is happening, but I was able to fix it.