mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-10 04:19:54 +00:00
fix: bundler errors in React and Vue adapters should now be resolved (#447)
* fix: bundler errors in React and Vue adapters should now be resolved * chore: replace use-isomorphic-layout-effect with dep for RN support
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/vue-form": "workspace:*",
|
||||
"@tanstack/vue-form": "^0.2.0",
|
||||
"vue": "^3.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useForm } from '@tanstack/vue-form'
|
||||
import FieldInfo from './FieldInfo.vue'
|
||||
import { provideFormContext } from '@tanstack/vue-form/src'
|
||||
|
||||
const form = useForm({
|
||||
defaultValues: {
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
|
||||
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "tsup.config.js"]
|
||||
}
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
"dependencies": {
|
||||
"@tanstack/form-core": "workspace:*",
|
||||
"@tanstack/react-store": "0.1.3",
|
||||
"@tanstack/store": "0.1.3"
|
||||
"@tanstack/store": "0.1.3",
|
||||
"use-isomorphic-layout-effect": "^1.1.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^17.0.0 || ^18.0.0",
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
} from '@tanstack/form-core'
|
||||
import { FieldApi, functionalUpdate } from '@tanstack/form-core'
|
||||
import { useFormContext, formContext } from './formContext'
|
||||
import { useIsomorphicLayoutEffect } from './utils/useIsomorphicLayoutEffect'
|
||||
import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect'
|
||||
import type { UseFieldOptions } from './types'
|
||||
|
||||
declare module '@tanstack/form-core' {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useStore } from '@tanstack/react-store'
|
||||
import React, { type ReactNode, useState } from 'react'
|
||||
import { type UseField, type FieldComponent, Field, useField } from './useField'
|
||||
import { formContext } from './formContext'
|
||||
import { useIsomorphicLayoutEffect } from './utils/useIsomorphicLayoutEffect'
|
||||
import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect'
|
||||
|
||||
declare module '@tanstack/form-core' {
|
||||
// eslint-disable-next-line no-shadow
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
/* c8 ignore start */
|
||||
export const isBrowser = typeof window !== 'undefined'
|
||||
/* c8 ignore end */
|
||||
@@ -1,6 +0,0 @@
|
||||
/* c8 ignore start */
|
||||
import { useEffect, useLayoutEffect } from 'react'
|
||||
import { isBrowser } from './isBrowser'
|
||||
|
||||
export const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect
|
||||
/* c8 ignore end */
|
||||
@@ -3,5 +3,5 @@
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
|
||||
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "tsup.config.js"]
|
||||
}
|
||||
|
||||
13
packages/vue-form/tsconfig.eslint.json
Normal file
13
packages/vue-form/tsconfig.eslint.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".eslintrc.cjs",
|
||||
"test-setup.ts",
|
||||
"tsup.config.js"
|
||||
]
|
||||
}
|
||||
@@ -4,6 +4,6 @@ import { defineConfig } from 'tsup'
|
||||
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'
|
||||
|
||||
export default defineConfig([
|
||||
modernConfig({ entry: ['src/*.ts'] }),
|
||||
legacyConfig({ entry: ['src/*.ts'] }),
|
||||
modernConfig({ entry: ['src/*.ts', 'src/*.tsx'] }),
|
||||
legacyConfig({ entry: ['src/*.ts', 'src/*.tsx'] }),
|
||||
])
|
||||
|
||||
2498
pnpm-lock.yaml
generated
2498
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user