Skip to content

Commit 0dcd2fb

Browse files
authored
build: tweaks (#372)
* build: tweaks * build: downgrade eslint * refactor: use createRoot * test: update snapshot * build: add lock file
1 parent 5471a12 commit 0dcd2fb

File tree

7 files changed

+23923
-14
lines changed

7 files changed

+23923
-14
lines changed

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
enable-pre-post-scripts=true
21
package-lock=false
32
save-prefix=~
43
save=false

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@ksmithut/prettier-standard": "latest",
3636
"@lerna-lite/cli": "latest",
3737
"@lerna-lite/publish": "latest",
38-
"eslint": "latest",
38+
"eslint": "8",
3939
"eslint-config-next": "latest",
4040
"finepack": "latest",
4141
"git-authors-cli": "latest",
@@ -66,7 +66,12 @@
6666
"commitlint": {
6767
"extends": [
6868
"@commitlint/config-conventional"
69-
]
69+
],
70+
"rules": {
71+
"body-max-line-length": [
72+
0
73+
]
74+
}
7075
},
7176
"eslintConfig": {
7277
"extends": "eslint-config-next",

packages/hover-vanilla/src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import MicrolinkHover from '@microlink/hover-react'
22
import localhostUrl from 'localhost-url-regex'
3+
import { createRoot } from 'react-dom'
34
import styled from 'styled-components'
4-
import ReactDOM from 'react-dom'
55
import React from 'react'
66

77
function toArray (input) {
@@ -36,7 +36,7 @@ function parseObject (obj) {
3636

3737
function microlink (selector, opts, rootNode) {
3838
return toArray(selector).forEach(function (el) {
39-
ReactDOM.render(
39+
createRoot(rootNode || el).render(
4040
React.createElement(
4141
MicrolinkHover.withHover,
4242
Object.assign(
@@ -49,8 +49,7 @@ function microlink (selector, opts, rootNode) {
4949
opts,
5050
parseObject(el.dataset)
5151
)
52-
),
53-
rootNode || el
52+
)
5453
)
5554
})
5655
}

packages/react/test/snapshots/build.mjs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Generated by [AVA](https://avajs.dev).
5151
size: 'normal'␊
5252
}␊
5353
},␊
54-
fetchFromApi: [AsyncFunction: u],␊
54+
fetchFromApi: [AsyncFunction: fetchFromApi],␊
5555
getApiUrl: [Function: getApiUrl],␊
5656
imageProxy: [Function: imageProxy]␊
5757
}`
2 Bytes
Binary file not shown.

packages/vanilla/src/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom'
31
import Microlink from '@microlink/react'
2+
import { createRoot } from 'react-dom'
3+
import React from 'react'
44

55
function parseJSON (value) {
66
try {
@@ -28,8 +28,7 @@ function toArray (input) {
2828
function microlink (selector, opts, rootNode) {
2929
return toArray(selector).forEach(function (el) {
3030
el.classList.add('microlink_vanilla')
31-
32-
ReactDOM.render(
31+
createRoot(rootNode || el).render(
3332
React.createElement(
3433
Microlink,
3534
Object.assign(
@@ -40,8 +39,7 @@ function microlink (selector, opts, rootNode) {
4039
opts,
4140
parseObject(el.dataset)
4241
)
43-
),
44-
rootNode || el
42+
)
4543
)
4644
})
4745
}

0 commit comments

Comments
 (0)