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

Migrate to TypeScript #1000

Closed
ssi02014 opened this issue Aug 7, 2023 · 8 comments · Fixed by #1123 or #1124
Closed

Migrate to TypeScript #1000

ssi02014 opened this issue Aug 7, 2023 · 8 comments · Fixed by #1123 or #1124
Assignees

Comments

@ssi02014
Copy link
Contributor

ssi02014 commented Aug 7, 2023

Hello, 👏 @remarkablemark
I'm looking at the code inside "lib" and it looks like you're still using "var" to declare most variables.

Do you have any plans to migrate to "let" or "const"?
If there is a plan, I'd like to work on it, but what do you think?

@ssi02014 ssi02014 added the question Further information is requested label Aug 7, 2023
@remarkablemark
Copy link
Owner

Thanks for opening this issue @ssi02014! I do plan to eventually migrate to TypeScript but that will be a breaking change this for library.

@ssi02014
Copy link
Contributor Author

ssi02014 commented Aug 7, 2023

@remarkablemark 👍
Thanks for the review!
So, am I correct in understanding that you don't need to do the "let/const" migration beforehand?

as-is

// attributes-to-props.js
var reactProperty = require('react-property');
var utilities = require('./utilities');

// https://reactjs.org/docs/uncontrolled-components.html
// https://developer.mozilla.org/docs/Web/HTML/Attributes
var UNCONTROLLED_COMPONENT_ATTRIBUTES = ['checked', 'value'];
var UNCONTROLLED_COMPONENT_NAMES = ['input', 'select', 'textarea'];

var VALUE_ONLY_INPUTS = {
  reset: true,
  submit: true
};

// ...

to-be

// attributes-to-props.js
const reactProperty = require('react-property');
const utilities = require('./utilities');

// https://reactjs.org/docs/uncontrolled-components.html
// https://developer.mozilla.org/docs/Web/HTML/Attributes
const UNCONTROLLED_COMPONENT_ATTRIBUTES = ['checked', 'value'];
const UNCONTROLLED_COMPONENT_NAMES = ['input', 'select', 'textarea'];

const VALUE_ONLY_INPUTS = {
  reset: true,
  submit: true
};

// ...

@remarkablemark
Copy link
Owner

@ssi02014 Yes if we're using TypeScript, then we'll be using ES6 syntax.

@remarkablemark remarkablemark changed the title migration let/const Migrate to TypeScript Aug 7, 2023
@remarkablemark remarkablemark pinned this issue Aug 7, 2023
@ssi02014
Copy link
Contributor Author

ssi02014 commented Aug 7, 2023

@remarkablemark
Thanks! 👍👍👍

@remarkablemark remarkablemark removed the question Further information is requested label Aug 11, 2023
@kasperaamodt
Copy link

kasperaamodt commented Oct 11, 2023

@remarkablemark any updates on the progress here?

@remarkablemark
Copy link
Owner

@kasperaamodt No update at the moment. I've been pretty busy so I haven't had a chance to work on this.

remarkablemark added a commit that referenced this issue Oct 29, 2023
BREAKING CHANGE: CommonJS imports require the `.default` key

Closes #1000
remarkablemark added a commit that referenced this issue Oct 29, 2023
BREAKING CHANGE: CommonJS imports require the `.default` key

Closes #1000
remarkablemark added a commit that referenced this issue Oct 29, 2023
BREAKING CHANGE: CommonJS imports require the `.default` key

Closes #1000
remarkablemark added a commit that referenced this issue Oct 29, 2023
BREAKING CHANGE: CommonJS imports require the `.default` key

Closes #1000
@remarkablemark
Copy link
Owner

Release:

@remarkablemark remarkablemark unpinned this issue Oct 30, 2023
@ssi02014
Copy link
Contributor Author

🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants