Skip to content

Commit

Permalink
build: tweaks (#372)
Browse files Browse the repository at this point in the history
* build: tweaks

* build: downgrade eslint

* refactor: use createRoot

* test: update snapshot

* build: add lock file
  • Loading branch information
Kikobeats authored May 8, 2024
1 parent 5471a12 commit 0dcd2fb
Show file tree
Hide file tree
Showing 7 changed files with 23,923 additions and 14 deletions.
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
enable-pre-post-scripts=true
package-lock=false
save-prefix=~
save=false
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@ksmithut/prettier-standard": "latest",
"@lerna-lite/cli": "latest",
"@lerna-lite/publish": "latest",
"eslint": "latest",
"eslint": "8",
"eslint-config-next": "latest",
"finepack": "latest",
"git-authors-cli": "latest",
Expand Down Expand Up @@ -66,7 +66,12 @@
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
],
"rules": {
"body-max-line-length": [
0
]
}
},
"eslintConfig": {
"extends": "eslint-config-next",
Expand Down
7 changes: 3 additions & 4 deletions packages/hover-vanilla/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MicrolinkHover from '@microlink/hover-react'
import localhostUrl from 'localhost-url-regex'
import { createRoot } from 'react-dom'
import styled from 'styled-components'
import ReactDOM from 'react-dom'
import React from 'react'

function toArray (input) {
Expand Down Expand Up @@ -36,7 +36,7 @@ function parseObject (obj) {

function microlink (selector, opts, rootNode) {
return toArray(selector).forEach(function (el) {
ReactDOM.render(
createRoot(rootNode || el).render(
React.createElement(
MicrolinkHover.withHover,
Object.assign(
Expand All @@ -49,8 +49,7 @@ function microlink (selector, opts, rootNode) {
opts,
parseObject(el.dataset)
)
),
rootNode || el
)
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/test/snapshots/build.mjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Generated by [AVA](https://avajs.dev).
size: 'normal'␊
}␊
},␊
fetchFromApi: [AsyncFunction: u],␊
fetchFromApi: [AsyncFunction: fetchFromApi],␊
getApiUrl: [Function: getApiUrl],␊
imageProxy: [Function: imageProxy]␊
}`
Binary file modified packages/react/test/snapshots/build.mjs.snap
Binary file not shown.
10 changes: 4 additions & 6 deletions packages/vanilla/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import Microlink from '@microlink/react'
import { createRoot } from 'react-dom'
import React from 'react'

function parseJSON (value) {
try {
Expand Down Expand Up @@ -28,8 +28,7 @@ function toArray (input) {
function microlink (selector, opts, rootNode) {
return toArray(selector).forEach(function (el) {
el.classList.add('microlink_vanilla')

ReactDOM.render(
createRoot(rootNode || el).render(
React.createElement(
Microlink,
Object.assign(
Expand All @@ -40,8 +39,7 @@ function microlink (selector, opts, rootNode) {
opts,
parseObject(el.dataset)
)
),
rootNode || el
)
)
})
}
Expand Down
Loading

0 comments on commit 0dcd2fb

Please sign in to comment.