-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[serialize]: Convert to Typescript #2543
[serialize]: Convert to Typescript #2543
Conversation
🦋 Changeset detectedLatest commit: 62719e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Note: This isn't finished just yet, some tests are still breaking and it's missing the changeset |
`\`keyframes\` output got interpolated into plain string, please wrap it with \`css\`. | ||
|
||
Instead of doing this: | ||
|
||
${[...matched, `\`${replaced}\``].join('\n')} | ||
|
||
You should wrap it with \`css\` like this: | ||
|
||
css\`${replaced}\`` |
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 pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 62719e2:
|
Hi @Andarist, I've updated the PR with the requested changes. I made sure no runtime code changes were made. However, some tests are now breaking. Apparently Perhaps something in the old Flow build output is now different, causing this unexpected bug. Either way, the code seems to not expect a Should we apply a patch on the main branch before migrating to TS? |
packages/serialize/src/index.ts
Outdated
@@ -370,6 +453,7 @@ export const serializeStyles = function ( | |||
styles, | |||
map: sourceMap, | |||
next: cursor, | |||
// @ts-ignore: SerializedStyles does not have toString method, and we don't want to add it |
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 used the same comment from the original Flow code
Codecov Report
|
@danilofuchs the code looks OK (i've pushed some additional, minor, changes but they were mostly nits) but some type tests are failing. I've looked briefly into failing tests for The problem is that we need this syntax because we compile stuff with I recall that I've tried to upgrade dtslint like a year ago or something and I've bumped into some problems, didn't have enough time to dig into this back then but I guess I might have to do that after all. |
What:
Migrates the
serialize
package to Typescript. This was not that simple as the internal functions deal with a large variety of possible types for each argument (Interpolation
), and some were undocumented.Why:
Part of #2358
How:
Checklist: