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

build: tweaks #372

Merged
merged 5 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading