# Issue Helper ## Before You Start... The issue list is reserved exclusively for bug reports and feature requests. That means we do not accept usage questions. If you open an issue that does not conform to the requirements, it will be closed immediately. For usage questions, please use the following resources: - Read the introduce and components documentation - Make sure you have search your question in FAQ and changelog - Look for / ask questions on [Discussions](https://github.com/alibaba/formily/discussions) Also try to search for your issue it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue. ```tsx import React from 'react' import { createForm, onFieldMount, onFieldReact } from '@formily/core' import { Field, VoidField } from '@formily/react' import { Form, Input, Select, Radio, FormItem, FormButtonGroup, Submit, } from '@formily/antd' import semver from 'semver' import ReactMde from 'react-mde' import * as Showdown from 'showdown' import 'react-mde/lib/styles/css/react-mde-all.css' const converter = new Showdown.Converter({ tables: true, simplifiedAutoLink: true, strikethrough: true, tasklists: true, }) const MdInput = ({ value, onChange }) => { const [selectedTab, setSelectedTab] = React.useState('write') return (
Promise.resolve( `
${ converter.makeHtml(markdown) || '' }
` ) } />
) } const form = createForm({ validateFirst: true, effects() { onFieldMount('version', async (field) => { const { versions: unsort } = await fetch( 'https://registry.npmmirror.com/@formily/core' ).then((res) => res.json()) const versions = Object.keys(unsort).sort((v1, v2) => semver.gte(v1, v2) ? -1 : 1 ) field.dataSource = versions.map((version) => ({ label: version, value: version, })) }) onFieldMount('package', async (field) => { const packages = await fetch( 'https://formilyjs.org/.netlify/functions/npm-search?q=@formily' ).then((res) => res.json()) field.dataSource = packages.map(({ name }) => { return { label: name, value: name, } }) }) onFieldReact('bug-desc', (field) => { field.visible = field.query('type').value() === 'Bug Report' }) onFieldReact('feature-desc', (field) => { field.visible = field.query('type').value() === 'Feature Request' }) }, }) const createIssueURL = ({ type, title, version, package: pkg, reproduceLink, reproduceStep, expected, actually, comment, feature, api, }) => { const url = new URL('https://github.com/alibaba/formily/issues/new') const bugInfo = ` - [ ] I have searched the [issues](https://github.com/alibaba/formily/issues) of this repository and believe that this is not a duplicate. ### Reproduction link [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](${ reproduceLink || '' }) ### Steps to reproduce ${reproduceStep || ''} ### What is expected? ${expected || ''} ### What is actually happening? ${actually || ''} ### Package ${pkg}@${version} --- ${comment || ''} ` const prInfo = ` - [ ] I have searched the [issues](https://github.com/alibaba/formily/issues) of this repository and believe that this is not a duplicate. ### What problem does this feature solve? ${feature || ''} ### What does the proposed API look like? ${api || ''} ` url.searchParams.set('title', `[${type}] ${title}`) url.searchParams.set('body', type === 'Bug Report' ? bugInfo : prInfo) return url.href } export default () => { return (
{ return /\/\/(codesandbox\.io|github)/.test(value) ? '' : 'Must Be Codesandbox Link or Github Repo' }, ]} description={
This is Codesandbox templates.If you are:
} />

Explain your use case, context, and rationale behind this feature request. More importantly, what is the end user experience you are trying to build that led to the need for this feature?

An important design goal of Formily is keeping the API surface small and straightforward. In general, we only consider adding new features that solve a problem that cannot be easily dealt with using existing APIs (i.e. not just an alternative way of doing things that can already be done). The problem should also be common enough to justify the addition.

} name="feature" required decorator={[FormItem]} component={[MdInput]} />
{ window.open(createIssueURL(values)) }} > Submit ) } ```