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

feat(pluginutils): support bigint and symbol in dataToEsm #1047

Merged
merged 12 commits into from Mar 7, 2022
Merged

feat(pluginutils): support bigint and symbol in dataToEsm #1047

merged 12 commits into from Mar 7, 2022

Conversation

LongTengDao
Copy link
Contributor

@LongTengDao LongTengDao commented Nov 21, 2021

Rollup Plugin Name: pluginutils

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

data oldEsm newEsm
bigint undefined bigint
Symbol.for() undefined Symbol.for()

@LongTengDao LongTengDao changed the title deal bigint symbol function in dataToEsm support bigint symbol in dataToEsm Nov 21, 2021
@@ -2,6 +2,13 @@ import test from 'ava';

import { dataToEsm } from '../';

test('support bigint and symbol', (t) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please split these into separate tests. (that may seem pedantic, but this PR essentially adds two features in support for two different entities)

@@ -2,6 +2,13 @@ import test from 'ava';

import { dataToEsm } from '../';

test('support bigint and symbol', (t) => {
t.is(
dataToEsm({ bigint: 0, symbol: Symbol.for('') }),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like to see a few different values (within the same t test func) tried here for sanity check

@@ -4,8 +4,8 @@ import makeLegalIdentifier from './makeLegalIdentifier';

export type Indent = string | null | undefined;

function stringify(obj: unknown): string {
return (JSON.stringify(obj) || 'undefined').replace(
function stringify(val: boolean | number | string): string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this change necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because rest types (undefined object symbol bigint) already and should be handled in serialize, I think this will make the code more strong.

if it's not necessary, this change could be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted this change for CI undue error.

@shellscape shellscape changed the title support bigint symbol in dataToEsm feat(pluginutils): support bigint and symbol in dataToEsm Dec 13, 2021
@shellscape
Copy link
Collaborator

Looks like there are some failures caused by these changes in CI. Please have a look

@shellscape shellscape changed the title feat(pluginutils): support bigint and symbol in dataToEsm feat(pluginutils): support bigint and symbol in dataToEsm bump Feb 22, 2022
@shellscape shellscape changed the title feat(pluginutils): support bigint and symbol in dataToEsm bump feat(pluginutils): support bigint and symbol in dataToEsm Feb 22, 2022
@shellscape
Copy link
Collaborator

Closing as abandoned. The error is visible here: https://github.com/rollup/plugins/runs/5281573593?check_suite_focus=true#step:7:241. If you get around to cleaning that up, please update your fork and give us a ping.

@LongTengDao
Copy link
Contributor Author

@shellscape Oh, sorry, I missed. The typo error has been corrected.

@shellscape shellscape reopened this Feb 26, 2022
@shellscape
Copy link
Collaborator

Thanks for updating it!

@shellscape
Copy link
Collaborator

Looks like there is a failing test to take a look at.

@LongTengDao
Copy link
Contributor Author

@shellscape Thanks for your careful guidance

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.

None yet

2 participants