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

Should RE used in the crate? #6

Open
4 of 5 tasks
HerringtonDarkholme opened this issue Sep 9, 2021 · 0 comments
Open
4 of 5 tasks

Should RE used in the crate? #6

HerringtonDarkholme opened this issue Sep 9, 2021 · 0 comments

Comments

@HerringtonDarkholme
Copy link
Owner

HerringtonDarkholme commented Sep 9, 2021

Hard to migrate but possible

  • compiler-core/src/transforms/vFor.ts|304 col 15| const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/
  • compiler-core/src/transforms/vFor.ts|307 col 18| const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
  • compiler-core/src/transforms/vOn.ts|19 col 12| const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/
  • compiler-core/src/utils.ts|79 col 17| const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g
  • shared/src/normalizeProp.ts|30 col 20| const listDelimiterRE = /;(?![^(]*\))/g // ; followed by no single )

Easy to migrate

compiler-core/src/parse.ts|60 col 13| const decodeRE = /&(gt|lt|amp|apos|quot);/g
compiler-core/src/transforms/vFor.ts|308 col 18| const stripParensRE = /^\(|\)$/g
compiler-core/src/utils.ts|66 col 20| const nonIdentifierRE = /^\d|[^\$\w]/
compiler-core/src/utils.ts|77 col 26| const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/
compiler-core/src/utils.ts|78 col 21| const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/
shared/src/normalizeProp.ts|31 col 24| const propertyDelimiterRE = /:(.+)/
shared/src/escapeHtml.ts|1 col 13| const escapeRE = /["'&<>]/
compiler-dom/src/transforms/stringifyStatic.ts|142 col 15| const dataAriaRE = /^(data|aria)-/

use RE in SFC crates

compiler-sfc/src/parse.ts|333 col 12| const splitRE = /\r?\n/g
compiler-sfc/src/parse.ts|334 col 12| const emptyRE = /^(?:\/\/)?\s*$/
compiler-sfc/src/parse.ts|335 col 14| const replaceRE = /./g
compiler-sfc/src/rewriteDefault.ts|4 col 20| const defaultExportRE = /((?:^|\n|;)\s*)export(\s*)default/
compiler-sfc/src/rewriteDefault.ts|5 col 25| const namedDefaultExportRE = /((?:^|\n|;)\s*)export(.+)as(\s*)default/s
compiler-sfc/src/rewriteDefault.ts|6 col 25| const exportDefaultClassRE =
compiler-sfc/src/stylePluginScoped.ts|5 col 20| const animationNameRE = /^(-\w+-)?animation-name$/
compiler-sfc/src/stylePluginScoped.ts|6 col 16| const animationRE = /^(-\w+-)?animation$/
compiler-sfc/src/cssVars.ts|15 col 20| export const cssVarRE = /\bv-bind\(\s*(?:'([^']+)'|"([^"]+)"|([^'"][^)]*))\s*\)/g
ref-transform/src/refTransform.ts|28 col 21| const transformCheckRE = /[^\w]\$(?:\$|ref|computed|shallowRef)?\s*(\(|\<)/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant