diff --git a/internal/ast/utilities.go b/internal/ast/utilities.go index b828fa6a1a..d3667f3598 100644 --- a/internal/ast/utilities.go +++ b/internal/ast/utilities.go @@ -3609,3 +3609,16 @@ func (h *hasFileNameImpl) FileName() string { func (h *hasFileNameImpl) Path() tspath.Path { return h.path } + +func GetSemanticJsxChildren(children []*JsxChild) []*JsxChild { + return core.Filter(children, func(i *JsxChild) bool { + switch i.Kind { + case KindJsxExpression: + return i.Expression() != nil + case KindJsxText: + return !i.AsJsxText().ContainsOnlyTriviaWhiteSpaces + default: + return true + } + }) +} diff --git a/internal/checker/emitresolver.go b/internal/checker/emitresolver.go index a3767a4ac6..0939def9d7 100644 --- a/internal/checker/emitresolver.go +++ b/internal/checker/emitresolver.go @@ -16,6 +16,11 @@ import ( var _ printer.EmitResolver = &emitResolver{} +// Links for jsx +type JSXLinks struct { + importRef *ast.Node +} + // Links for declarations type DeclarationLinks struct { @@ -31,10 +36,23 @@ type emitResolver struct { checkerMu sync.Mutex isValueAliasDeclaration func(node *ast.Node) bool referenceResolver binder.ReferenceResolver + jsxLinks core.LinkStore[*ast.Node, JSXLinks] declarationLinks core.LinkStore[*ast.Node, DeclarationLinks] declarationFileLinks core.LinkStore[*ast.Node, DeclarationFileLinks] } +func (r *emitResolver) GetJsxFactoryEntity(location *ast.Node) *ast.Node { + r.checkerMu.Lock() + defer r.checkerMu.Unlock() + return r.checker.getJsxFactoryEntity(location) +} + +func (r *emitResolver) GetJsxFragmentFactoryEntity(location *ast.Node) *ast.Node { + r.checkerMu.Lock() + defer r.checkerMu.Unlock() + return r.checker.getJsxFragmentFactoryEntity(location) +} + func (r *emitResolver) IsOptionalParameter(node *ast.Node) bool { r.checkerMu.Lock() defer r.checkerMu.Unlock() @@ -786,13 +804,18 @@ func (r *emitResolver) GetReferencedExportContainer(node *ast.IdentifierNode, pr return r.getReferenceResolver().GetReferencedExportContainer(node, prefixLocals) } -func (r *emitResolver) GetReferencedImportDeclaration(node *ast.IdentifierNode) *ast.Declaration { - if !ast.IsParseTreeNode(node) { - return nil - } +func (r *emitResolver) SetReferencedImportDeclaration(node *ast.IdentifierNode, ref *ast.Declaration) { + r.checkerMu.Lock() + defer r.checkerMu.Unlock() + r.jsxLinks.Get(node).importRef = ref +} +func (r *emitResolver) GetReferencedImportDeclaration(node *ast.IdentifierNode) *ast.Declaration { r.checkerMu.Lock() defer r.checkerMu.Unlock() + if !ast.IsParseTreeNode(node) { + return r.jsxLinks.Get(node).importRef + } return r.getReferenceResolver().GetReferencedImportDeclaration(node) } diff --git a/internal/checker/grammarchecks.go b/internal/checker/grammarchecks.go index 1092c3e136..d7deeef5ee 100644 --- a/internal/checker/grammarchecks.go +++ b/internal/checker/grammarchecks.go @@ -1195,7 +1195,7 @@ func (c *Checker) checkGrammarJsxName(node *ast.JsxTagNameExpression) bool { return c.grammarErrorOnNode(node.Expression(), diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names) } - if ast.IsJsxNamespacedName(node) && c.compilerOptions.GetJSXTransformEnabled() && !IsIntrinsicJsxName(node.AsJsxNamespacedName().Namespace.Text()) { + if ast.IsJsxNamespacedName(node) && c.compilerOptions.GetJSXTransformEnabled() && !scanner.IsIntrinsicJsxName(node.AsJsxNamespacedName().Namespace.Text()) { return c.grammarErrorOnNode(node, diagnostics.React_components_cannot_include_JSX_namespace_names) } diff --git a/internal/checker/jsx.go b/internal/checker/jsx.go index 18666b1c6f..4b38947726 100644 --- a/internal/checker/jsx.go +++ b/internal/checker/jsx.go @@ -243,7 +243,7 @@ func (c *Checker) getContextualTypeForChildJsxExpression(node *ast.Node, child * if !(attributesType != nil && !IsTypeAny(attributesType) && jsxChildrenPropertyName != ast.InternalSymbolNameMissing && jsxChildrenPropertyName != "") { return nil } - realChildren := getSemanticJsxChildren(node.Children().Nodes) + realChildren := ast.GetSemanticJsxChildren(node.Children().Nodes) childIndex := slices.Index(realChildren, child) childFieldType := c.getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) if childFieldType == nil { @@ -279,7 +279,7 @@ func (c *Checker) discriminateContextualTypeByJSXAttributes(node *ast.Node, cont return false } element := node.Parent.Parent - if s.Name == jsxChildrenPropertyName && ast.IsJsxElement(element) && len(getSemanticJsxChildren(element.Children().Nodes)) != 0 { + if s.Name == jsxChildrenPropertyName && ast.IsJsxElement(element) && len(ast.GetSemanticJsxChildren(element.Children().Nodes)) != 0 { return false } return node.Symbol().Members[s.Name] == nil && c.isDiscriminantProperty(contextualType, s.Name) @@ -308,7 +308,7 @@ func (c *Checker) elaborateJsxComponents(node *ast.Node, source *Type, target *T } childrenNameType := c.getStringLiteralType(childrenPropName) childrenTargetType := c.getIndexedAccessType(target, childrenNameType) - validChildren := getSemanticJsxChildren(containingElement.Children().Nodes) + validChildren := ast.GetSemanticJsxChildren(containingElement.Children().Nodes) if len(validChildren) == 0 { return reportedError } @@ -803,7 +803,7 @@ func (c *Checker) createJsxAttributesTypeFromAttributesProperty(openingLikeEleme children = parent.AsJsxFragment().Children.Nodes } } - return len(getSemanticJsxChildren(children)) != 0 + return len(ast.GetSemanticJsxChildren(children)) != 0 } if parentHasSemanticJsxChildren(openingLikeElement) { var childTypes []*Type = c.checkJsxChildren(openingLikeElement.Parent, checkMode) @@ -855,19 +855,6 @@ func (c *Checker) createJsxAttributesTypeFromAttributesProperty(openingLikeEleme return spread } -func getSemanticJsxChildren(children []*ast.JsxChild) []*ast.JsxChild { - return core.Filter(children, func(i *ast.JsxChild) bool { - switch i.Kind { - case ast.KindJsxExpression: - return i.Expression() != nil - case ast.KindJsxText: - return !i.AsJsxText().ContainsOnlyTriviaWhiteSpaces - default: - return true - } - }) -} - func (c *Checker) checkJsxAttribute(node *ast.Node, checkMode CheckMode) *Type { if node.Initializer() != nil { return c.checkExpressionForMutableLocation(node.Initializer(), checkMode) diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 3ccb0687b3..08b7ab1300 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -35,10 +35,6 @@ func NewDiagnosticChainForNode(chain *ast.Diagnostic, node *ast.Node, message *d return NewDiagnosticForNode(node, message, args...) } -func IsIntrinsicJsxName(name string) bool { - return len(name) != 0 && (name[0] >= 'a' && name[0] <= 'z' || strings.ContainsRune(name, '-')) -} - func findInMap[K comparable, V any](m map[K]V, predicate func(V) bool) V { for _, value := range m { if predicate(value) { @@ -1337,7 +1333,7 @@ func isInRightSideOfImportOrExportAssignment(node *ast.EntityName) bool { } func isJsxIntrinsicTagName(tagName *ast.Node) bool { - return ast.IsIdentifier(tagName) && IsIntrinsicJsxName(tagName.Text()) || ast.IsJsxNamespacedName(tagName) + return ast.IsIdentifier(tagName) && scanner.IsIntrinsicJsxName(tagName.Text()) || ast.IsJsxNamespacedName(tagName) } func getContainingObjectLiteral(f *ast.SignatureDeclaration) *ast.Node { diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 373509023d..de189f3d19 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -412,7 +412,7 @@ func walkTreeForJSXTags(node *ast.Node) *ast.Node { return true } if node.SubtreeFacts()&ast.SubtreeContainsJsx == 0 { - return true + return false } if ast.IsJsxOpeningElement(node) || ast.IsJsxFragment(node) { found = node diff --git a/internal/printer/emitresolver.go b/internal/printer/emitresolver.go index 0e68552594..f8a1f6c842 100644 --- a/internal/printer/emitresolver.go +++ b/internal/printer/emitresolver.go @@ -35,6 +35,11 @@ type EmitResolver interface { GetEffectiveDeclarationFlags(node *ast.Node, flags ast.ModifierFlags) ast.ModifierFlags GetResolutionModeOverride(node *ast.Node) core.ResolutionMode + // JSX Emit + GetJsxFactoryEntity(location *ast.Node) *ast.Node + GetJsxFragmentFactoryEntity(location *ast.Node) *ast.Node + SetReferencedImportDeclaration(node *ast.IdentifierNode, ref *ast.Declaration) // for overriding the reference resolver behavior for generated identifiers + // declaration emit checker functionality projections PrecalculateDeclarationEmitVisibility(file *ast.SourceFile) IsSymbolAccessible(symbol *ast.Symbol, enclosingDeclaration *ast.Node, meaning ast.SymbolFlags, shouldComputeAliasToMarkVisible bool) SymbolAccessibilityResult diff --git a/internal/printer/factory.go b/internal/printer/factory.go index 30316454f5..62afce5019 100644 --- a/internal/printer/factory.go +++ b/internal/printer/factory.go @@ -492,6 +492,21 @@ func (f *NodeFactory) NewDisposeResourcesHelper(envBinding *ast.Expression) *ast // !!! Class Fields Helpers // !!! ES2018 Helpers +// Chains a sequence of expressions using the __assign helper or Object.assign if available in the target +func (f *NodeFactory) NewAssignHelper(attributesSegments []*ast.Expression, scriptTarget core.ScriptTarget) *ast.Expression { + if scriptTarget >= core.ScriptTargetES2015 { + return f.NewCallExpression(f.NewPropertyAccessExpression(f.NewIdentifier("Object"), nil, f.NewIdentifier("assign"), ast.NodeFlagsNone), nil, nil, f.NewNodeList(attributesSegments), ast.NodeFlagsNone) + } + f.emitContext.RequestEmitHelper(assignHelper) + return f.NewCallExpression( + f.NewUnscopedHelperName("__assign"), + nil, + nil, + f.NewNodeList(attributesSegments), + ast.NodeFlagsNone, + ) +} + // !!! ES2018 Destructuring Helpers // !!! ES2017 Helpers diff --git a/internal/printer/helpers.go b/internal/printer/helpers.go index 6cfaae485c..dc659e2867 100644 --- a/internal/printer/helpers.go +++ b/internal/printer/helpers.go @@ -100,6 +100,24 @@ var disposeResourcesHelper = &EmitHelper{ // !!! Class Fields Helpers // !!! ES2018 Helpers +var assignHelper = &EmitHelper{ + Name: "typescript:assign", + ImportName: "__assign", + Scoped: false, + Priority: &Priority{1}, + Text: `var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +};`, +} + // !!! ES2018 Destructuring Helpers // !!! ES2017 Helpers diff --git a/internal/scanner/utilities.go b/internal/scanner/utilities.go index 4c48305bbe..bcf178e6c7 100644 --- a/internal/scanner/utilities.go +++ b/internal/scanner/utilities.go @@ -1,6 +1,7 @@ package scanner import ( + "strings" "unicode/utf8" "github.com/microsoft/typescript-go/internal/ast" @@ -60,3 +61,7 @@ func IsIdentifierText(name string, languageVersion core.ScriptTarget, languageVa } return true } + +func IsIntrinsicJsxName(name string) bool { + return len(name) != 0 && (name[0] >= 'a' && name[0] <= 'z' || strings.ContainsRune(name, '-')) +} diff --git a/internal/testutil/tsbaseline/type_symbol_baseline.go b/internal/testutil/tsbaseline/type_symbol_baseline.go index 20ae35c4af..bd12c1a235 100644 --- a/internal/testutil/tsbaseline/type_symbol_baseline.go +++ b/internal/testutil/tsbaseline/type_symbol_baseline.go @@ -481,5 +481,5 @@ func isIntrinsicJsxTag(node *ast.Node, sourceFile *ast.SourceFile) bool { return false } text := scanner.GetSourceTextOfNodeFromSourceFile(sourceFile, node, false /*includeTrivia*/) - return checker.IsIntrinsicJsxName(text) + return scanner.IsIntrinsicJsxName(text) } diff --git a/internal/transformers/jsx.go b/internal/transformers/jsx.go new file mode 100644 index 0000000000..9f55368e53 --- /dev/null +++ b/internal/transformers/jsx.go @@ -0,0 +1,1130 @@ +package transformers + +import ( + "maps" + "slices" + "strconv" + "strings" + "unicode/utf8" + + "github.com/dlclark/regexp2" + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/printer" + "github.com/microsoft/typescript-go/internal/scanner" + "github.com/microsoft/typescript-go/internal/stringutil" +) + +type JSXTransformer struct { + Transformer + compilerOptions *core.CompilerOptions + emitResolver printer.EmitResolver + + importSpecifier string + filenameDeclaration *ast.Node + utilizedImplicitRuntimeImports map[string]map[string]*ast.Node + inJsxChild bool + + currentSourceFile *ast.SourceFile +} + +func NewJSXTransformer(emitContext *printer.EmitContext, compilerOptions *core.CompilerOptions, emitResolver printer.EmitResolver) *Transformer { + tx := &JSXTransformer{ + compilerOptions: compilerOptions, + emitResolver: emitResolver, + } + return tx.NewTransformer(tx.visit, emitContext) +} + +func (tx *JSXTransformer) getCurrentFileNameExpression() *ast.Node { + if tx.filenameDeclaration != nil { + return tx.filenameDeclaration.AsVariableDeclaration().Name() + } + d := tx.factory.NewVariableDeclaration( + tx.factory.NewUniqueNameEx("_jsxFileName", printer.AutoGenerateOptions{ + Flags: printer.GeneratedIdentifierFlagsOptimistic | printer.GeneratedIdentifierFlagsFileLevel, + }), + nil, + nil, + tx.factory.NewStringLiteral(tx.currentSourceFile.OriginalFileName()), + ) + tx.filenameDeclaration = d + return d.AsVariableDeclaration().Name() +} + +func (tx *JSXTransformer) getJsxFactoryCalleePrimitive(isStaticChildren bool) string { + if tx.compilerOptions.Jsx == core.JsxEmitReactJSXDev { + return "jsxDEV" + } + if isStaticChildren { + return "jsxs" + } + return "jsx" +} + +func (tx *JSXTransformer) getJsxFactoryCallee(isStaticChildren bool) *ast.Node { + t := tx.getJsxFactoryCalleePrimitive(isStaticChildren) + return tx.getImplicitImportForName(t) +} + +func (tx *JSXTransformer) getImplicitJsxFragmentReference() *ast.Node { + return tx.getImplicitImportForName("Fragment") +} + +func (tx *JSXTransformer) getImplicitImportForName(name string) *ast.Node { + importSource := tx.importSpecifier + if name != "createElement" { + importSource = ast.GetJSXRuntimeImport(importSource, tx.compilerOptions) + } + existing, ok := tx.utilizedImplicitRuntimeImports[importSource] + if ok { + elem, ok := existing[name] + if ok { + return elem.AsImportSpecifier().Name() + } + } else { + tx.utilizedImplicitRuntimeImports[importSource] = make(map[string]*ast.Node) + } + + generatedName := tx.factory.NewUniqueNameEx("_"+name, printer.AutoGenerateOptions{ + Flags: printer.GeneratedIdentifierFlagsOptimistic | printer.GeneratedIdentifierFlagsFileLevel | printer.GeneratedIdentifierFlagsAllowNameSubstitution, + }) + specifier := tx.factory.NewImportSpecifier(false, tx.factory.NewIdentifier(name), generatedName) + tx.emitResolver.SetReferencedImportDeclaration(generatedName, specifier) + tx.utilizedImplicitRuntimeImports[importSource][name] = specifier + return specifier.Name() +} + +func (tx *JSXTransformer) setInChild(v bool) { + tx.inJsxChild = v +} + +func (tx *JSXTransformer) visit(node *ast.Node) *ast.Node { + if node == nil { + return nil + } + if node.SubtreeFacts()&ast.SubtreeContainsJsx == 0 { + return node + } + switch node.Kind { + case ast.KindSourceFile: + tx.setInChild(false) + return tx.visitSourceFile(node.AsSourceFile()) + case ast.KindJsxElement: + return tx.visitJsxElement(node.AsJsxElement()) + case ast.KindJsxSelfClosingElement: + return tx.visitJsxSelfClosingElement(node.AsJsxSelfClosingElement()) + case ast.KindJsxFragment: + return tx.visitJsxFragment(node.AsJsxFragment()) + case ast.KindJsxOpeningElement: + panic("JsxOpeningElement should not be visited, handled in visitJsxElement") + case ast.KindJsxOpeningFragment: + panic("JsxOpeningFragment should not be visited, handled in visitJsxFragment") + case ast.KindJsxText: + tx.setInChild(false) + return tx.visitJsxText(node.AsJsxText()) + case ast.KindJsxExpression: + tx.setInChild(false) + return tx.visitJsxExpression(node.AsJsxExpression()) + } + tx.setInChild(false) + return tx.visitor.VisitEachChild(node) // by default, do nothing +} + +/** + * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread + */ +func hasKeyAfterPropsSpread(node *ast.Node) bool { + spread := false + opener := node + if node.Kind == ast.KindJsxElement { + opener = node.AsJsxElement().OpeningElement + } // otherwise self-closing + for _, elem := range opener.Attributes().Properties() { + if ast.IsJsxSpreadAttribute(elem) && (!ast.IsObjectLiteralExpression(elem.Expression()) || core.Some(elem.Expression().Properties(), ast.IsSpreadAssignment)) { + spread = true + } else if spread && ast.IsJsxAttribute(elem) && ast.IsIdentifier(elem.Name()) && elem.Name().AsIdentifier().Text == "key" { + return true + } + } + return false +} + +func (tx *JSXTransformer) shouldUseCreateElement(node *ast.Node) bool { + return len(tx.importSpecifier) == 0 || hasKeyAfterPropsSpread(node) +} + +func insertStatementAfterPrologue[T any](to []*ast.Node, statement *ast.Node, isPrologueDirective func(callee T, node *ast.Node) bool, callee T) []*ast.Node { + if statement == nil { + return to + } + statementIdx := 0 + // skip all prologue directives to insert at the correct position + for ; statementIdx < len(to); statementIdx++ { + if !isPrologueDirective(callee, to[statementIdx]) { + break + } + } + return slices.Insert(to, statementIdx, statement) +} + +func (tx *JSXTransformer) isAnyPrologueDirective(node *ast.Node) bool { + return ast.IsPrologueDirective(node) || (tx.emitContext.EmitFlags(node)&printer.EFCustomPrologue != 0) +} + +func (tx *JSXTransformer) insertStatementAfterCustomPrologue(to []*ast.Node, statement *ast.Node) []*ast.Node { + return insertStatementAfterPrologue(to, statement, (*JSXTransformer).isAnyPrologueDirective, tx) +} + +func sortByImportDeclarationSource(a *ast.Node, b *ast.Node) int { + return stringutil.CompareStringsCaseSensitive(a.AsImportDeclaration().ModuleSpecifier.AsStringLiteral().Text, b.AsImportDeclaration().ModuleSpecifier.AsStringLiteral().Text) +} + +func getSpecifierOfRequireCall(s *ast.Node) string { + return s.AsVariableStatement().DeclarationList.AsVariableDeclarationList().Declarations.Nodes[0].AsVariableDeclaration().Initializer.AsCallExpression().Arguments.Nodes[0].AsStringLiteral().Text +} + +func sortByRequireSource(a *ast.Node, b *ast.Node) int { + return stringutil.CompareStringsCaseSensitive(getSpecifierOfRequireCall(a), getSpecifierOfRequireCall(b)) +} + +func sortImportSpecifiers(a *ast.Node, b *ast.Node) int { + res := stringutil.CompareStringsCaseSensitive(a.AsImportSpecifier().PropertyName.Text(), b.AsImportSpecifier().PropertyName.Text()) + if res != 0 { + return res + } + return stringutil.CompareStringsCaseSensitive(a.AsImportSpecifier().Name().AsIdentifier().Text, b.AsImportSpecifier().Name().AsIdentifier().Text) +} + +func getSortedSpecifiers(m map[string]*ast.Node) []*ast.Node { + res := slices.Collect(maps.Values(m)) + slices.SortFunc(res, sortImportSpecifiers) + return res +} + +func (tx *JSXTransformer) visitSourceFile(file *ast.SourceFile) *ast.Node { + if file.IsDeclarationFile { + return file.AsNode() + } + + tx.currentSourceFile = file + tx.importSpecifier = ast.GetJSXImplicitImportBase(tx.compilerOptions, file) + tx.filenameDeclaration = nil + tx.utilizedImplicitRuntimeImports = make(map[string]map[string]*ast.Node) + + visited := tx.visitor.VisitEachChild(file.AsNode()) + tx.emitContext.AddEmitHelper(visited.AsNode(), tx.emitContext.ReadEmitHelpers()...) + statements := visited.Statements() + statementsUpdated := false + if tx.filenameDeclaration != nil { + statements = tx.insertStatementAfterCustomPrologue(statements, tx.factory.NewVariableStatement(nil, tx.factory.NewVariableDeclarationList( + ast.NodeFlagsConst, + tx.factory.NewNodeList([]*ast.Node{tx.filenameDeclaration}), + ))) + statementsUpdated = true + } + + if len(tx.utilizedImplicitRuntimeImports) > 0 { + // A key difference from strada is that these imports are sorted in corsa, rather than appearing in a use-defined order + if ast.IsExternalModule(file) { + statementsUpdated = true + newStatements := make([]*ast.Node, 0, len(tx.utilizedImplicitRuntimeImports)) + for importSource, importSpecifiersMap := range tx.utilizedImplicitRuntimeImports { + s := tx.factory.NewImportDeclaration( + nil, + tx.factory.NewImportClause(false, nil, tx.factory.NewNamedImports(tx.factory.NewNodeList(getSortedSpecifiers(importSpecifiersMap)))), + tx.factory.NewStringLiteral(importSource), + nil, + ) + ast.SetParentInChildren(s) + newStatements = append(newStatements, s) + + } + slices.SortFunc(newStatements, sortByImportDeclarationSource) + for _, e := range newStatements { + statements = tx.insertStatementAfterCustomPrologue(statements, e) + } + } else if ast.IsExternalOrCommonJSModule(file) { + statementsUpdated = true + newStatements := make([]*ast.Node, 0, len(tx.utilizedImplicitRuntimeImports)) + for importSource, importSpecifiersMap := range tx.utilizedImplicitRuntimeImports { + sorted := getSortedSpecifiers(importSpecifiersMap) + asBindingElems := make([]*ast.Node, 0, len(sorted)) + for _, elem := range sorted { + asBindingElems = append(asBindingElems, tx.factory.NewBindingElement(nil, elem.AsImportSpecifier().PropertyName, elem.AsImportSpecifier().Name(), nil)) + } + s := tx.factory.NewVariableStatement(nil, tx.factory.NewVariableDeclarationList(ast.NodeFlagsConst, tx.factory.NewNodeList([]*ast.Node{tx.factory.NewVariableDeclaration( + tx.factory.NewBindingPattern(ast.KindObjectBindingPattern, tx.factory.NewNodeList(asBindingElems)), + nil, + nil, + tx.factory.NewCallExpression(tx.factory.NewIdentifier("require"), nil, nil, tx.factory.NewNodeList([]*ast.Node{tx.factory.NewStringLiteral(importSource)}), ast.NodeFlagsNone), + )}))) + ast.SetParentInChildren(s) + newStatements = append(newStatements, s) + } + slices.SortFunc(newStatements, sortByRequireSource) + for _, e := range newStatements { + statements = tx.insertStatementAfterCustomPrologue(statements, e) + } + } else { + // Do nothing (script file) - consider an error in the checker? + } + } + + if statementsUpdated { + visited = tx.factory.UpdateSourceFile(file, tx.factory.NewNodeList(statements)) + } + + tx.currentSourceFile = nil + tx.importSpecifier = "" + tx.filenameDeclaration = nil + tx.utilizedImplicitRuntimeImports = nil + + return visited +} + +func (tx *JSXTransformer) visitJsxElement(element *ast.JsxElement) *ast.Node { + tagTransform := (*JSXTransformer).visitJsxOpeningLikeElementJSX + if tx.shouldUseCreateElement(element.AsNode()) { + tagTransform = (*JSXTransformer).visitJsxOpeningLikeElementCreateElement + } + return tagTransform(tx, element.OpeningElement, element.Children, element.AsNode()) +} + +func (tx *JSXTransformer) visitJsxSelfClosingElement(element *ast.JsxSelfClosingElement) *ast.Node { + tagTransform := (*JSXTransformer).visitJsxOpeningLikeElementJSX + if tx.shouldUseCreateElement(element.AsNode()) { + tagTransform = (*JSXTransformer).visitJsxOpeningLikeElementCreateElement + } + return tagTransform(tx, element.AsNode(), nil, element.AsNode()) +} + +func (tx *JSXTransformer) visitJsxFragment(fragment *ast.JsxFragment) *ast.Node { + tagTransform := (*JSXTransformer).visitJsxOpeningFragmentJSX + if len(tx.importSpecifier) == 0 { + tagTransform = (*JSXTransformer).visitJsxOpeningFragmentCreateElement + } + return tagTransform(tx, fragment.OpeningFragment.AsJsxOpeningFragment(), fragment.Children, fragment.AsNode()) +} + +func (tx *JSXTransformer) convertJsxChildrenToChildrenPropObject(children []*ast.JsxChild) *ast.Node { + prop := tx.convertJsxChildrenToChildrenPropAssignment(children) + if prop == nil { + return nil + } + return tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList([]*ast.Node{prop}), false) +} + +func (tx *JSXTransformer) transformJsxChildToExpression(node *ast.Node) *ast.Node { + tx.setInChild(true) + defer tx.setInChild(false) + return tx.visitor.Visit(node) +} + +func (tx *JSXTransformer) convertJsxChildrenToChildrenPropAssignment(children []*ast.JsxChild) *ast.Node { + nonWhitespceChildren := ast.GetSemanticJsxChildren(children) + if len(nonWhitespceChildren) == 1 && (nonWhitespceChildren[0].Kind != ast.KindJsxExpression || nonWhitespceChildren[0].AsJsxExpression().DotDotDotToken == nil) { + result := tx.transformJsxChildToExpression(nonWhitespceChildren[0]) + if result == nil { + return nil + } + return tx.factory.NewPropertyAssignment(nil, tx.factory.NewIdentifier("children"), nil, nil, result) + } + results := make([]*ast.Node, 0, len(nonWhitespceChildren)) + for _, child := range nonWhitespceChildren { + res := tx.transformJsxChildToExpression(child) + if res == nil { + continue + } + results = append(results, res) + } + if len(results) == 0 { + return nil + } + return tx.factory.NewPropertyAssignment(nil, tx.factory.NewIdentifier("children"), nil, nil, tx.factory.NewArrayLiteralExpression(tx.factory.NewNodeList(results), false)) +} + +func (tx *JSXTransformer) getTagName(node *ast.Node) *ast.Node { + if node.Kind == ast.KindJsxElement { + return tx.getTagName(node.AsJsxElement().OpeningElement) + } else if ast.IsJsxOpeningLikeElement(node) { + tagName := node.TagName() + if ast.IsIdentifier(tagName) && scanner.IsIntrinsicJsxName(tagName.Text()) { + return tx.factory.NewStringLiteral(tagName.Text()) + } else if ast.IsJsxNamespacedName(tagName) { + return tx.factory.NewStringLiteral(tagName.AsJsxNamespacedName().Namespace.Text() + ":" + tagName.AsJsxNamespacedName().Name().Text()) + } else { + return createExpressionFromEntityName(tx.factory, tagName) + } + } else { + panic("unhandled node kind passed to getTagName: " + node.Kind.String()) + } +} + +func (tx *JSXTransformer) visitJsxOpeningLikeElementJSX(element *ast.Node, children *ast.NodeList, location *ast.Node) *ast.Node { + tagName := tx.getTagName(element) + var childrenProp *ast.Node + if children != nil && len(children.Nodes) > 0 { + childrenProp = tx.convertJsxChildrenToChildrenPropAssignment(children.Nodes) + } + var keyAttr *ast.Node + attrs := element.Attributes().AsJsxAttributes().Properties.Nodes + for i, p := range attrs { + if p.Kind == ast.KindJsxAttribute && p.AsJsxAttribute().Name() != nil && ast.IsIdentifier(p.AsJsxAttribute().Name()) && p.AsJsxAttribute().Name().AsIdentifier().Text == "key" { + keyAttr = p + attrs = slices.Clone(attrs) + attrs = slices.Delete(attrs, i, i+1) + break + } + } + var object *ast.Node + if len(attrs) > 0 { + object = tx.transformJsxAttributesToObjectProps(attrs, childrenProp) + } else { + objectChildren := []*ast.Node{} + if childrenProp != nil { + objectChildren = append(objectChildren, childrenProp) + } + object = tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList(objectChildren), false) // When there are no attributes, React wants {} + } + return tx.visitJsxOpeningLikeElementOrFragmentJSX( + tagName, + object, + keyAttr, + children, + location, + ) +} + +func (tx *JSXTransformer) transformJsxAttributesToObjectProps(attrs []*ast.Node, childrenProp *ast.Node) *ast.Node { + target := tx.compilerOptions.GetEmitScriptTarget() + if target != core.ScriptTargetNone && target >= core.ScriptTargetES2018 { + // target has object spreads, can keep as-is + return tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList(tx.transformJsxAttributesToProps(attrs, childrenProp)), false) + } + return tx.transformJsxAttributesToExpression(attrs, childrenProp) +} + +func (tx *JSXTransformer) transformJsxAttributesToExpression(attrs []*ast.Node, childrenProp *ast.Node) *ast.Node { + expressions := make([]*ast.Expression, 0, 2) + properties := make([]*ast.ObjectLiteralElement, 0, len(attrs)) + + for _, attr := range attrs { + if ast.IsJsxSpreadAttribute(attr) { + // as an optimization we try to flatten the first level of spread inline object + // as if its props would be passed as JSX attributes + if ast.IsObjectLiteralExpression(attr.Expression()) && !hasProto(attr.Expression().AsObjectLiteralExpression()) { + for _, prop := range attr.Expression().Properties() { + if ast.IsSpreadAssignment(prop) { + expressions, properties = tx.combinePropertiesIntoNewExpression(expressions, properties) + expressions = append(expressions, tx.visitor.Visit(prop.Expression())) + continue + } + properties = append(properties, tx.visitor.Visit(prop)) + } + continue + } + expressions, properties = tx.combinePropertiesIntoNewExpression(expressions, properties) + expressions = append(expressions, tx.visitor.Visit(attr.Expression())) + continue + } + properties = append(properties, tx.transformJsxAttributeToObjectLiteralElement(attr.AsJsxAttribute())) + } + + if childrenProp != nil { + properties = append(properties, childrenProp) + } + + expressions, _ = tx.combinePropertiesIntoNewExpression(expressions, properties) + + if len(expressions) > 0 && !ast.IsObjectLiteralExpression(expressions[0]) { + // We must always emit at least one object literal before a spread attribute + // as the JSX always factory expects a fresh object, so we need to make a copy here + // we also avoid mutating an external reference by doing this (first expression is used as assign's target) + expressions = append([]*ast.Expression{tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList([]*ast.Node{}), false)}, expressions...) + } + + if len(expressions) == 1 { + return expressions[0] + } + return tx.factory.NewAssignHelper(expressions, tx.compilerOptions.GetEmitScriptTarget()) +} + +func (tx *JSXTransformer) combinePropertiesIntoNewExpression(expressions []*ast.Expression, props []*ast.ObjectLiteralElement) ([]*ast.Expression, []*ast.ObjectLiteralElement) { + if len(props) == 0 { + return expressions, props + } + newObj := tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList(props), false) + expressions = append(expressions, newObj) + return expressions, nil +} + +func (tx *JSXTransformer) transformJsxAttributesToProps(attrs []*ast.Node, childrenProp *ast.Node) []*ast.Node { + props := make([]*ast.Node, 0, len(attrs)) + for _, attr := range attrs { + if attr.Kind == ast.KindJsxSpreadAttribute { + res := tx.transformJsxSpreadAttributesToProps(attr.AsJsxSpreadAttribute()) + props = append(props, res...) + } else { + props = append(props, tx.transformJsxAttributeToObjectLiteralElement(attr.AsJsxAttribute())) + } + } + if childrenProp != nil { + props = append(props, childrenProp) + } + return props +} + +func hasProto(obj *ast.ObjectLiteralExpression) bool { + for _, p := range obj.Properties.Nodes { + if ast.IsPropertyAssignment(p) && (ast.IsStringLiteral(p.Name()) || ast.IsIdentifier(p.Name())) && p.Name().Text() == "__proto__" { + return true + } + } + return false +} + +func (tx *JSXTransformer) transformJsxSpreadAttributesToProps(node *ast.JsxSpreadAttribute) []*ast.Node { + if ast.IsObjectLiteralExpression(node.Expression) && !hasProto(node.Expression.AsObjectLiteralExpression()) { + res, _ := tx.visitor.VisitSlice(node.Expression.Properties()) + return res + } + return []*ast.Node{tx.factory.NewSpreadAssignment(tx.visitor.Visit(node.Expression))} +} + +func (tx *JSXTransformer) transformJsxAttributeToObjectLiteralElement(node *ast.JsxAttribute) *ast.Node { + name := tx.getAttributeName(node) + expression := tx.transformJsxAttributeInitializer(node.Initializer) + return tx.factory.NewPropertyAssignment(nil, name, nil, nil, expression) +} + +/** +* Emit an attribute name, which is quoted if it needs to be quoted. Because +* these emit into an object literal property name, we don't need to be worried +* about keywords, just non-identifier characters + */ +func (tx *JSXTransformer) getAttributeName(node *ast.JsxAttribute) *ast.Node { + name := node.Name() + if ast.IsIdentifier(name) { + text := name.Text() + if scanner.IsIdentifierText(text, tx.compilerOptions.GetEmitScriptTarget(), core.LanguageVariantStandard) { + return name + } + return tx.factory.NewStringLiteral(text) + } + // must be jsx namespace + return tx.factory.NewStringLiteral(name.AsJsxNamespacedName().Namespace.Text() + ":" + name.AsJsxNamespacedName().Name().Text()) +} + +func (tx *JSXTransformer) transformJsxAttributeInitializer(node *ast.Node) *ast.Node { + if node == nil { + return tx.factory.NewTrueExpression() + } + if node.Kind == ast.KindStringLiteral { + // Always recreate the literal to escape any escape sequences or newlines which may be in the original jsx string and which + // Need to be escaped to be handled correctly in a normal string + res := tx.factory.NewStringLiteral(decodeEntities(node.Text())) + res.Loc = node.Loc + return res + } + if node.Kind == ast.KindJsxExpression { + if node.AsJsxExpression().Expression == nil { + return tx.factory.NewTrueExpression() + } + return tx.visitor.Visit(node.AsJsxExpression().Expression) + } + if ast.IsJsxElement(node) || ast.IsJsxSelfClosingElement(node) || ast.IsJsxFragment(node) { + tx.setInChild(false) + return tx.visitor.Visit(node) + } + panic("Unhandled node kind found in jsx initializer: " + node.Kind.String()) +} + +func (tx *JSXTransformer) visitJsxOpeningLikeElementOrFragmentJSX( + tagName *ast.Expression, + object *ast.Expression, + keyAttr *ast.Node, + children *ast.NodeList, + location *ast.Node, +) *ast.Node { + var nonWhitespaceChildren []*ast.Node + if children != nil { + nonWhitespaceChildren = ast.GetSemanticJsxChildren(children.Nodes) + } + isStaticChildren := len(nonWhitespaceChildren) > 1 || (len(nonWhitespaceChildren) == 1 && ast.IsJsxExpression(nonWhitespaceChildren[0]) && nonWhitespaceChildren[0].AsJsxExpression().DotDotDotToken != nil) + args := make([]*ast.Node, 0, 3) + args = append(args, tagName, object) + // function jsx(type, config, maybeKey) {} + // "maybeKey" is optional. It is acceptable to use "_jsx" without a third argument + if keyAttr != nil { + args = append(args, tx.transformJsxAttributeInitializer(keyAttr.Initializer())) + } + + if tx.compilerOptions.Jsx == core.JsxEmitReactJSXDev { + originalFile := tx.emitContext.Original(tx.currentSourceFile.AsNode()) + if originalFile != nil && ast.IsSourceFile(originalFile) { + // "maybeKey" has to be replaced with "void 0" to not break the jsxDEV signature + if keyAttr == nil { + args = append(args, tx.factory.NewVoidZeroExpression()) + } + // isStaticChildren development flag + if isStaticChildren { + args = append(args, tx.factory.NewTrueExpression()) + } else { + args = append(args, tx.factory.NewFalseExpression()) + } + // __source development flag + line, col := scanner.GetLineAndCharacterOfPosition(originalFile.AsSourceFile(), location.Pos()) + args = append(args, tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList([]*ast.Node{ + tx.factory.NewPropertyAssignment(nil, tx.factory.NewIdentifier("fileName"), nil, nil, tx.getCurrentFileNameExpression()), + tx.factory.NewPropertyAssignment(nil, tx.factory.NewIdentifier("lineNumber"), nil, nil, tx.factory.NewNumericLiteral(strconv.FormatInt(int64(line+1), 10))), + tx.factory.NewPropertyAssignment(nil, tx.factory.NewIdentifier("columnNumber"), nil, nil, tx.factory.NewNumericLiteral(strconv.FormatInt(int64(col+1), 10))), + }), false)) + // __self development flag + args = append(args, tx.factory.NewThisExpression()) + } + } + + element := tx.factory.NewCallExpression(tx.getJsxFactoryCallee(isStaticChildren), nil, nil, tx.factory.NewNodeList(args), ast.NodeFlagsNone) + element.Loc = location.Loc + + if tx.inJsxChild { + tx.emitContext.AddEmitFlags(element, printer.EFStartOnNewLine) + } + + return element +} + +func (tx *JSXTransformer) visitJsxOpeningFragmentJSX(fragment *ast.JsxOpeningFragment, children *ast.NodeList, location *ast.Node) *ast.Node { + var childrenProps *ast.Expression + if children != nil && len(children.Nodes) > 0 { + result := tx.convertJsxChildrenToChildrenPropObject(children.Nodes) + if result != nil { + childrenProps = result + } + } + if childrenProps == nil { + childrenProps = tx.factory.NewObjectLiteralExpression(tx.factory.NewNodeList([]*ast.Node{}), false) + } + return tx.visitJsxOpeningLikeElementOrFragmentJSX( + tx.getImplicitJsxFragmentReference(), + childrenProps, + nil, + children, + location, + ) +} + +func (tx *JSXTransformer) createReactNamespace(reactNamespace string, parent *ast.Node) *ast.Node { + // To ensure the emit resolver can properly resolve the namespace, we need to + // treat this identifier as if it were a source tree node by clearing the `Synthesized` + // flag and setting a parent node. TODO: Is this still true? The emit resolver is supposed to be + // hardened aginast this, so long as the node retains original node pointers back to a parsed node + if len(reactNamespace) == 0 { + reactNamespace = "React" + } + react := tx.factory.NewIdentifier(reactNamespace) + react.Flags &= ^ast.NodeFlagsSynthesized + + // Set the parent that is in parse tree + // this makes sure that parent chain is intact for checker to traverse complete scope tree + react.Parent = tx.emitContext.ParseNode(parent) + return react +} + +func (tx *JSXTransformer) createJsxFactoryExpressionFromEntityName(e *ast.Node, parent *ast.Node) *ast.Node { + if ast.IsQualifiedName(e) { + left := tx.createJsxFactoryExpressionFromEntityName(e.AsQualifiedName().Left, parent) + right := tx.factory.NewIdentifier(e.AsQualifiedName().Right.Text()) + return tx.factory.NewPropertyAccessExpression(left, nil, right, ast.NodeFlagsNone) + } + return tx.createReactNamespace(e.AsIdentifier().Text, parent) +} + +func (tx *JSXTransformer) createJsxPsuedoFactoryExpression(parent *ast.Node, e *ast.Node, target string) *ast.Node { + if e != nil { + return tx.createJsxFactoryExpressionFromEntityName(e, parent) + } + return tx.factory.NewPropertyAccessExpression( + tx.createReactNamespace(tx.compilerOptions.ReactNamespace, parent), + nil, + tx.factory.NewIdentifier(target), + ast.NodeFlagsNone, + ) +} + +func (tx *JSXTransformer) createJsxFactoryExpression(parent *ast.Node) *ast.Node { + e := tx.emitResolver.GetJsxFactoryEntity(tx.currentSourceFile.AsNode()) + return tx.createJsxPsuedoFactoryExpression(parent, e, "createElement") +} + +func (tx *JSXTransformer) createJsxFragmentFactoryExpression(parent *ast.Node) *ast.Node { + e := tx.emitResolver.GetJsxFragmentFactoryEntity(tx.currentSourceFile.AsNode()) + return tx.createJsxPsuedoFactoryExpression(parent, e, "Fragment") +} + +func (tx *JSXTransformer) visitJsxOpeningLikeElementCreateElement(element *ast.Node, children *ast.NodeList, location *ast.Node) *ast.Node { + tagName := tx.getTagName(element) + attrs := element.Attributes().Properties() + var objectProperties *ast.Expression + if len(attrs) > 0 { + objectProperties = tx.transformJsxAttributesToObjectProps(attrs, nil) + } else { + objectProperties = tx.factory.NewKeywordExpression(ast.KindNullKeyword) // When there are no attributes, React wants "null" + } + + var callee *ast.Expression + if len(tx.importSpecifier) == 0 { + callee = tx.createJsxFactoryExpression(element) + } else { + callee = tx.getImplicitImportForName("createElement") + } + + var newChildren []*ast.Node + if children != nil && len(children.Nodes) > 0 { + for _, c := range children.Nodes { + res := tx.transformJsxChildToExpression(c) + if res != nil { + if len(children.Nodes) > 1 { + tx.emitContext.AddEmitFlags(res, printer.EFStartOnNewLine) + } + newChildren = append(newChildren, res) + } + } + } + + args := make([]*ast.Expression, 0, len(newChildren)+2) + args = append(args, tagName) + args = append(args, objectProperties) + args = append(args, newChildren...) + + result := tx.factory.NewCallExpression( + callee, + nil, + nil, + tx.factory.NewNodeList(args), + ast.NodeFlagsNone, + ) + result.Loc = location.Loc + + if tx.inJsxChild { + tx.emitContext.AddEmitFlags(result, printer.EFStartOnNewLine) + } + return result +} + +func (tx *JSXTransformer) visitJsxOpeningFragmentCreateElement(fragment *ast.JsxOpeningFragment, children *ast.NodeList, location *ast.Node) *ast.Node { + tagName := tx.createJsxFragmentFactoryExpression(fragment.AsNode()) + callee := tx.createJsxFactoryExpression(fragment.AsNode()) + + var newChildren []*ast.Node + if children != nil && len(children.Nodes) > 0 { + for _, c := range children.Nodes { + res := tx.transformJsxChildToExpression(c) + if res != nil { + if len(children.Nodes) > 1 { + tx.emitContext.AddEmitFlags(res, printer.EFStartOnNewLine) + } + newChildren = append(newChildren, res) + } + } + } + + args := make([]*ast.Expression, 0, len(newChildren)+2) + args = append(args, tagName) + args = append(args, tx.factory.NewKeywordExpression(ast.KindNullKeyword)) + args = append(args, newChildren...) + + result := tx.factory.NewCallExpression( + callee, + nil, + nil, + tx.factory.NewNodeList(args), + ast.NodeFlagsNone, + ) + result.Loc = location.Loc + + if tx.inJsxChild { + tx.emitContext.AddEmitFlags(result, printer.EFStartOnNewLine) + } + return result +} + +func (tx *JSXTransformer) visitJsxText(text *ast.JsxText) *ast.Node { + fixed := fixupWhitespaceAndDecodeEntities(text.Text) + if len(fixed) == 0 { + return nil + } + return tx.factory.NewStringLiteral(fixed) +} + +func addLineOfJsxText(b *strings.Builder, trimmedLine string, isInitial bool) { + // We do not escape the string here as that is handled by the printer + // when it emits the literal. We do, however, need to decode JSX entities. + decoded := decodeEntities(trimmedLine) + if !isInitial { + b.WriteString(" ") + } + b.WriteString(decoded) +} + +/** +* JSX trims whitespace at the end and beginning of lines, except that the +* start/end of a tag is considered a start/end of a line only if that line is +* on the same line as the closing tag. See examples in +* tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx +* See also https://www.w3.org/TR/html4/struct/text.html#h-9.1 and https://www.w3.org/TR/CSS2/text.html#white-space-model +* +* An equivalent algorithm would be: +* - If there is only one line, return it. +* - If there is only whitespace (but multiple lines), return `undefined`. +* - Split the text into lines. +* - 'trimRight' the first line, 'trimLeft' the last line, 'trim' middle lines. +* - Decode entities on each line (individually). +* - Remove empty lines and join the rest with " ". + */ +func fixupWhitespaceAndDecodeEntities(text string) string { + acc := &strings.Builder{} + initial := true + // First non-whitespace character on this line. + firstNonWhitespace := 0 + // Last non-whitespace character on this line. + lastNonWhitespace := -1 + // These initial values are special because the first line is: + // firstNonWhitespace = 0 to indicate that we want leading whitsepace, + // but lastNonWhitespace = -1 as a special flag to indicate that we *don't* include the line if it's all whitespace. + for i := 0; i < len(text); i++ { + c, size := utf8.DecodeRuneInString(text[i:]) + if stringutil.IsLineBreak(c) { + // If we've seen any non-whitespace characters on this line, add the 'trim' of the line. + // (lastNonWhitespace === -1 is a special flag to detect whether the first line is all whitespace.) + if firstNonWhitespace != -1 && lastNonWhitespace != -1 { + addLineOfJsxText(acc, text[firstNonWhitespace:lastNonWhitespace], initial) + initial = false + } + + // Reset firstNonWhitespace for the next line. + // Don't bother to reset lastNonWhitespace because we ignore it if firstNonWhitespace = -1. + firstNonWhitespace = -1 + } else if !stringutil.IsWhiteSpaceSingleLine(c) { + lastNonWhitespace = i + if firstNonWhitespace == -1 { + firstNonWhitespace = i + } + } + + if size > 1 { + i += (size - 1) + } + } + + if firstNonWhitespace != -1 { + // Last line had a non-whitespace character. Emit the 'trimLeft', meaning keep trailing whitespace. + addLineOfJsxText(acc, text[firstNonWhitespace:], initial) + } + return acc.String() +} + +func (tx *JSXTransformer) visitJsxExpression(expression *ast.JsxExpression) *ast.Node { + e := tx.visitor.Visit(expression.Expression) + if expression.DotDotDotToken != nil { + return tx.factory.NewSpreadElement(e) + } + return e +} + +var htmlEntityMatcher = regexp2.MustCompile(`&((#((\d+)|x([\da-fA-F]+)))|(\w+));`, regexp2.ECMAScript) + +func htmlEntityReplacer(m regexp2.Match) string { + decimal := m.GroupByNumber(3) + if decimal != nil { + parsed, err := strconv.ParseInt(decimal.Capture.String(), 10, 32) + if err == nil { + return string(rune(parsed)) + } + } + hex := m.GroupByNumber(4) + if hex != nil { + parsed, err := strconv.ParseInt(hex.Capture.String(), 16, 32) + if err == nil { + return string(rune(parsed)) + } + } + word := m.GroupByNumber(5) + if word != nil { + // If this is not a valid entity, then just use `match` (replace it with itself, i.e. don't replace) + res, ok := entities[word.Capture.String()] + if ok { + return string(res) + } + } + return m.String() +} + +/** +* Replace entities like " ", "{", and "�" with the characters they encode. +* See https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references + */ +func decodeEntities(text string) string { + res, err := htmlEntityMatcher.ReplaceFunc(text, htmlEntityReplacer, -1, -1) + if err != nil { + panic(err.Error()) + } + return res +} + +var entities = map[string]rune{ + "quot": 0x0022, + "amp": 0x0026, + "apos": 0x0027, + "lt": 0x003C, + "gt": 0x003E, + "nbsp": 0x00A0, + "iexcl": 0x00A1, + "cent": 0x00A2, + "pound": 0x00A3, + "curren": 0x00A4, + "yen": 0x00A5, + "brvbar": 0x00A6, + "sect": 0x00A7, + "uml": 0x00A8, + "copy": 0x00A9, + "ordf": 0x00AA, + "laquo": 0x00AB, + "not": 0x00AC, + "shy": 0x00AD, + "reg": 0x00AE, + "macr": 0x00AF, + "deg": 0x00B0, + "plusmn": 0x00B1, + "sup2": 0x00B2, + "sup3": 0x00B3, + "acute": 0x00B4, + "micro": 0x00B5, + "para": 0x00B6, + "middot": 0x00B7, + "cedil": 0x00B8, + "sup1": 0x00B9, + "ordm": 0x00BA, + "raquo": 0x00BB, + "frac14": 0x00BC, + "frac12": 0x00BD, + "frac34": 0x00BE, + "iquest": 0x00BF, + "Agrave": 0x00C0, + "Aacute": 0x00C1, + "Acirc": 0x00C2, + "Atilde": 0x00C3, + "Auml": 0x00C4, + "Aring": 0x00C5, + "AElig": 0x00C6, + "Ccedil": 0x00C7, + "Egrave": 0x00C8, + "Eacute": 0x00C9, + "Ecirc": 0x00CA, + "Euml": 0x00CB, + "Igrave": 0x00CC, + "Iacute": 0x00CD, + "Icirc": 0x00CE, + "Iuml": 0x00CF, + "ETH": 0x00D0, + "Ntilde": 0x00D1, + "Ograve": 0x00D2, + "Oacute": 0x00D3, + "Ocirc": 0x00D4, + "Otilde": 0x00D5, + "Ouml": 0x00D6, + "times": 0x00D7, + "Oslash": 0x00D8, + "Ugrave": 0x00D9, + "Uacute": 0x00DA, + "Ucirc": 0x00DB, + "Uuml": 0x00DC, + "Yacute": 0x00DD, + "THORN": 0x00DE, + "szlig": 0x00DF, + "agrave": 0x00E0, + "aacute": 0x00E1, + "acirc": 0x00E2, + "atilde": 0x00E3, + "auml": 0x00E4, + "aring": 0x00E5, + "aelig": 0x00E6, + "ccedil": 0x00E7, + "egrave": 0x00E8, + "eacute": 0x00E9, + "ecirc": 0x00EA, + "euml": 0x00EB, + "igrave": 0x00EC, + "iacute": 0x00ED, + "icirc": 0x00EE, + "iuml": 0x00EF, + "eth": 0x00F0, + "ntilde": 0x00F1, + "ograve": 0x00F2, + "oacute": 0x00F3, + "ocirc": 0x00F4, + "otilde": 0x00F5, + "ouml": 0x00F6, + "divide": 0x00F7, + "oslash": 0x00F8, + "ugrave": 0x00F9, + "uacute": 0x00FA, + "ucirc": 0x00FB, + "uuml": 0x00FC, + "yacute": 0x00FD, + "thorn": 0x00FE, + "yuml": 0x00FF, + "OElig": 0x0152, + "oelig": 0x0153, + "Scaron": 0x0160, + "scaron": 0x0161, + "Yuml": 0x0178, + "fnof": 0x0192, + "circ": 0x02C6, + "tilde": 0x02DC, + "Alpha": 0x0391, + "Beta": 0x0392, + "Gamma": 0x0393, + "Delta": 0x0394, + "Epsilon": 0x0395, + "Zeta": 0x0396, + "Eta": 0x0397, + "Theta": 0x0398, + "Iota": 0x0399, + "Kappa": 0x039A, + "Lambda": 0x039B, + "Mu": 0x039C, + "Nu": 0x039D, + "Xi": 0x039E, + "Omicron": 0x039F, + "Pi": 0x03A0, + "Rho": 0x03A1, + "Sigma": 0x03A3, + "Tau": 0x03A4, + "Upsilon": 0x03A5, + "Phi": 0x03A6, + "Chi": 0x03A7, + "Psi": 0x03A8, + "Omega": 0x03A9, + "alpha": 0x03B1, + "beta": 0x03B2, + "gamma": 0x03B3, + "delta": 0x03B4, + "epsilon": 0x03B5, + "zeta": 0x03B6, + "eta": 0x03B7, + "theta": 0x03B8, + "iota": 0x03B9, + "kappa": 0x03BA, + "lambda": 0x03BB, + "mu": 0x03BC, + "nu": 0x03BD, + "xi": 0x03BE, + "omicron": 0x03BF, + "pi": 0x03C0, + "rho": 0x03C1, + "sigmaf": 0x03C2, + "sigma": 0x03C3, + "tau": 0x03C4, + "upsilon": 0x03C5, + "phi": 0x03C6, + "chi": 0x03C7, + "psi": 0x03C8, + "omega": 0x03C9, + "thetasym": 0x03D1, + "upsih": 0x03D2, + "piv": 0x03D6, + "ensp": 0x2002, + "emsp": 0x2003, + "thinsp": 0x2009, + "zwnj": 0x200C, + "zwj": 0x200D, + "lrm": 0x200E, + "rlm": 0x200F, + "ndash": 0x2013, + "mdash": 0x2014, + "lsquo": 0x2018, + "rsquo": 0x2019, + "sbquo": 0x201A, + "ldquo": 0x201C, + "rdquo": 0x201D, + "bdquo": 0x201E, + "dagger": 0x2020, + "Dagger": 0x2021, + "bull": 0x2022, + "hellip": 0x2026, + "permil": 0x2030, + "prime": 0x2032, + "Prime": 0x2033, + "lsaquo": 0x2039, + "rsaquo": 0x203A, + "oline": 0x203E, + "frasl": 0x2044, + "euro": 0x20AC, + "image": 0x2111, + "weierp": 0x2118, + "real": 0x211C, + "trade": 0x2122, + "alefsym": 0x2135, + "larr": 0x2190, + "uarr": 0x2191, + "rarr": 0x2192, + "darr": 0x2193, + "harr": 0x2194, + "crarr": 0x21B5, + "lArr": 0x21D0, + "uArr": 0x21D1, + "rArr": 0x21D2, + "dArr": 0x21D3, + "hArr": 0x21D4, + "forall": 0x2200, + "part": 0x2202, + "exist": 0x2203, + "empty": 0x2205, + "nabla": 0x2207, + "isin": 0x2208, + "notin": 0x2209, + "ni": 0x220B, + "prod": 0x220F, + "sum": 0x2211, + "minus": 0x2212, + "lowast": 0x2217, + "radic": 0x221A, + "prop": 0x221D, + "infin": 0x221E, + "ang": 0x2220, + "and": 0x2227, + "or": 0x2228, + "cap": 0x2229, + "cup": 0x222A, + "int": 0x222B, + "there4": 0x2234, + "sim": 0x223C, + "cong": 0x2245, + "asymp": 0x2248, + "ne": 0x2260, + "equiv": 0x2261, + "le": 0x2264, + "ge": 0x2265, + "sub": 0x2282, + "sup": 0x2283, + "nsub": 0x2284, + "sube": 0x2286, + "supe": 0x2287, + "oplus": 0x2295, + "otimes": 0x2297, + "perp": 0x22A5, + "sdot": 0x22C5, + "lceil": 0x2308, + "rceil": 0x2309, + "lfloor": 0x230A, + "rfloor": 0x230B, + "lang": 0x2329, + "rang": 0x232A, + "loz": 0x25CA, + "spades": 0x2660, + "clubs": 0x2663, + "hearts": 0x2665, + "diams": 0x2666, +} diff --git a/internal/transformers/transformer.go b/internal/transformers/transformer.go index 1bb1924a5b..55a571cf45 100644 --- a/internal/transformers/transformer.go +++ b/internal/transformers/transformer.go @@ -72,7 +72,7 @@ func GetScriptTransformers(emitContext *printer.EmitContext, host printer.EmitHo var emitResolver printer.EmitResolver var referenceResolver binder.ReferenceResolver - if importElisionEnabled { + if importElisionEnabled || options.GetJSXTransformEnabled() { emitResolver = host.GetEmitResolver(sourceFile, false /*skipDiagnostics*/) // !!! conditionally skip diagnostics emitResolver.MarkLinkedReferencesRecursively(sourceFile) referenceResolver = emitResolver @@ -95,7 +95,9 @@ func GetScriptTransformers(emitContext *printer.EmitContext, host printer.EmitHo } // !!! transform legacy decorator syntax - // !!! transform JSX syntax + if options.GetJSXTransformEnabled() { + tx = append(tx, NewJSXTransformer(emitContext, options, emitResolver)) + } if languageVersion < core.ScriptTargetESNext { tx = append(tx, NewESNextTransformer(emitContext)) diff --git a/internal/transformers/utilities.go b/internal/transformers/utilities.go index 9114ae674f..1313095408 100644 --- a/internal/transformers/utilities.go +++ b/internal/transformers/utilities.go @@ -409,3 +409,20 @@ func convertClassDeclarationToClassExpression(emitContext *printer.EmitContext, updated.Loc = node.Loc return updated } + +func createExpressionFromEntityName(factory ast.NodeFactoryCoercible, node *ast.Node) *ast.Expression { + if ast.IsQualifiedName(node) { + left := createExpressionFromEntityName(factory, node.AsQualifiedName().Left) + // TODO(rbuckton): Does this need to be parented? + right := node.AsQualifiedName().Right.Clone(factory.AsNodeFactory()) + right.Loc = node.AsQualifiedName().Right.Loc + right.Parent = node.AsQualifiedName().Right.Parent + return factory.AsNodeFactory().NewPropertyAccessExpression(left, nil, right, ast.NodeFlagsNone) + } else { + // TODO(rbuckton): Does this need to be parented? + res := node.Clone(factory.AsNodeFactory()) + res.Loc = node.Loc + res.Parent = node.Parent + return res + } +} diff --git a/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js b/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js index 4564821995..d0a152e5cb 100644 --- a/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js +++ b/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js @@ -154,16 +154,16 @@ function test5() { // Pair of non-like intrinsics function render(url) { const Tag = url ? 'a' : 'button'; - return test; + return react_1.default.createElement(Tag, null, "test"); } // Union of all intrinsics and components of `any` function App(props) { const Comp = props.component; - return (); + return (react_1.default.createElement(Comp, null)); } // custom components with non-subset props function render2() { var C = null; - const a = ; + const a = react_1.default.createElement(C, { p: true }); } } diff --git a/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js.diff b/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js.diff index 0b43e5ed98..3eb4daa268 100644 --- a/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js.diff +++ b/testdata/baselines/reference/submodule/compiler/callsOnComplexSignatures.js.diff @@ -38,21 +38,19 @@ // Pair of non-like intrinsics function render(url) { - var Tag = url ? 'a' : 'button'; -- return react_1.default.createElement(Tag, null, "test"); + const Tag = url ? 'a' : 'button'; -+ return test; + return react_1.default.createElement(Tag, null, "test"); } // Union of all intrinsics and components of `any` function App(props) { - var Comp = props.component; -- return (react_1.default.createElement(Comp, null)); + const Comp = props.component; -+ return (); + return (react_1.default.createElement(Comp, null)); } // custom components with non-subset props function render2() { var C = null; - var a = react_1.default.createElement(C, { p: true }); -+ const a = ; ++ const a = react_1.default.createElement(C, { p: true }); } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js index 98c57bcd03..173d9cd34d 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js @@ -25,13 +25,6 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return React.createElement("div", null, null /* preserved */); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js.diff index 2d09badf46..46473a897c 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js.diff @@ -6,20 +6,13 @@ //// [commentsOnJSXExpressionsArePreserved.js] -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return React.createElement("div", null, null /* preserved */); + return React.createElement("div", null, null /* preserved */); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js index 14f18f1f54..dd3eb6dedd 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js @@ -27,13 +27,6 @@ class Component { Object.defineProperty(exports, "__esModule", { value: true }); class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return React.createElement("div", null, null /* preserved */); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js.diff index 7d1293717a..5f9cb645d3 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).js.diff @@ -6,20 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return React.createElement("div", null, null /* preserved */); + return React.createElement("div", null, null /* preserved */); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js index 98c57bcd03..173d9cd34d 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js @@ -25,13 +25,6 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return React.createElement("div", null, null /* preserved */); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js.diff index 895b07ceac..dd1d68c55a 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js.diff @@ -6,20 +6,13 @@ //// [commentsOnJSXExpressionsArePreserved.js] -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return React.createElement("div", null, null /* preserved */); + return React.createElement("div", null, null /* preserved */); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js index 98c57bcd03..173d9cd34d 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js @@ -25,13 +25,6 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return React.createElement("div", null, null /* preserved */); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js.diff index 00abcba48b..a546e376bc 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js.diff @@ -6,20 +6,13 @@ //// [commentsOnJSXExpressionsArePreserved.js] -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return React.createElement("div", null, null /* preserved */); + return React.createElement("div", null, null /* preserved */); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js index 14f18f1f54..dd3eb6dedd 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js @@ -27,13 +27,6 @@ class Component { Object.defineProperty(exports, "__esModule", { value: true }); class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return React.createElement("div", null, null /* preserved */); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js.diff index 46c4d0a87f..ef5f1f7fac 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).js.diff @@ -26,13 +26,6 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return React.createElement("div", null, null /* preserved */); + } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js index 98c57bcd03..173d9cd34d 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js @@ -25,13 +25,6 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return React.createElement("div", null, null /* preserved */); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js.diff index 71a5a7819e..a18f6be720 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js.diff @@ -6,20 +6,13 @@ //// [commentsOnJSXExpressionsArePreserved.js] -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return React.createElement("div", null, null /* preserved */); + return React.createElement("div", null, null /* preserved */); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt new file mode 100644 index 0000000000..f62e9505b4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt @@ -0,0 +1,39 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + + +==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ + {/* missing */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + {null/* preserved */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 1 + ~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { // ??? 2 + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + {// ??? 3 + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 4 + ~~~~~~~~~~~~~~~~~~~~~~~~ + /* ??? 5 */} + ~~~~~~~~~~~~~~~~~~~~~~~~ +
; + ~~~~~~~~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt.diff deleted file mode 100644 index 4012f72b82..0000000000 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- old.commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt -+++ new.commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt -@@= skipped -0, +0 lines =@@ --commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -- -- --==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== -- // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs -- namespace JSX {} -- class Component { -- render() { -- return
-- ~~~~~ -- {/* missing */} -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- {null/* preserved */} -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- { -- ~~~~~~~~~~~~~ -- // ??? 1 -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- { // ??? 2 -- ~~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- {// ??? 3 -- ~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- { -- ~~~~~~~~~~~~~ -- // ??? 4 -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- /* ??? 5 */} -- ~~~~~~~~~~~~~~~~~~~~~~~~ --
; -- ~~~~~~~~~~~~~~ --!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -- } -- } -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js index 98c57bcd03..70e62c9029 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js @@ -23,15 +23,11 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js.diff index 523a044f8c..9fc95fbd66 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js.diff @@ -1,24 +1,16 @@ --- old.commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js +++ new.commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).js -@@= skipped -22, +22 lines =@@ - } - +@@= skipped -24, +24 lines =@@ //// [commentsOnJSXExpressionsArePreserved.js] --"use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_runtime_1 = require("react/jsx-runtime"); -var Component = /** @class */ (function () { - function Component() { ++const jsx_runtime_1 = require("react/jsx-runtime"); +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); } - Component.prototype.render = function () { - return (0, jsx_runtime_1.jsx)("div", { children: null /* preserved */ }); diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js index 14f18f1f54..70e62c9029 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js @@ -25,15 +25,9 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js.diff index 7564bc1505..a78b744b3c 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).js.diff @@ -7,16 +7,10 @@ -var jsx_runtime_1 = require("react/jsx-runtime"); -var Component = /** @class */ (function () { - function Component() { ++const jsx_runtime_1 = require("react/jsx-runtime"); +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); } - Component.prototype.render = function () { - return (0, jsx_runtime_1.jsx)("div", { children: null /* preserved */ }); diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js index 98c57bcd03..398425b877 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js @@ -25,13 +25,6 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return _jsx("div", { children: null /* preserved */ }); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js.diff index 3ab8fb5e55..9e6d4c0db0 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js.diff @@ -8,14 +8,7 @@ - function Component() { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return _jsx("div", { children: null /* preserved */ }); } - Component.prototype.render = function () { - return (0, _a.jsx)("div", { children: null /* preserved */ }); diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt new file mode 100644 index 0000000000..f62e9505b4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt @@ -0,0 +1,39 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + + +==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ + {/* missing */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + {null/* preserved */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 1 + ~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { // ??? 2 + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + {// ??? 3 + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 4 + ~~~~~~~~~~~~~~~~~~~~~~~~ + /* ??? 5 */} + ~~~~~~~~~~~~~~~~~~~~~~~~ +
; + ~~~~~~~~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js index 98c57bcd03..70e62c9029 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js @@ -23,15 +23,11 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js.diff index 58c362c247..ef3a5dba2b 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).js.diff @@ -26,15 +26,11 @@ - } - }; -}); ++"use strict"; ++Object.defineProperty(exports, "__esModule", { value: true }); ++const jsx_runtime_1 = require("react/jsx-runtime"); +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); + } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js index 14f18f1f54..70e62c9029 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js @@ -25,15 +25,9 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js.diff index 628aebcd57..4bcb859c6e 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).js.diff @@ -28,15 +28,9 @@ -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); ++const jsx_runtime_1 = require("react/jsx-runtime"); +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_runtime_1.jsx("div", { children: null /* preserved */ }); + } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js index 98c57bcd03..398425b877 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js @@ -25,13 +25,6 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return _jsx("div", { children: null /* preserved */ }); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js.diff index 96c573c872..8342b46435 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js.diff @@ -6,20 +6,13 @@ //// [commentsOnJSXExpressionsArePreserved.js] -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return _jsx("div", { children: null /* preserved */ }); + return _jsx("div", { children: null /* preserved */ }); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt new file mode 100644 index 0000000000..d417296efa --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt @@ -0,0 +1,39 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + + +==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ + {/* missing */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + {null/* preserved */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 1 + ~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { // ??? 2 + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + {// ??? 3 + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 4 + ~~~~~~~~~~~~~~~~~~~~~~~~ + /* ??? 5 */} + ~~~~~~~~~~~~~~~~~~~~~~~~ +
; + ~~~~~~~~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt.diff deleted file mode 100644 index 59e96a2561..0000000000 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- old.commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt -+++ new.commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt -@@= skipped -0, +0 lines =@@ --commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -- -- --==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== -- // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs -- namespace JSX {} -- class Component { -- render() { -- return
-- ~~~~~ -- {/* missing */} -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- {null/* preserved */} -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- { -- ~~~~~~~~~~~~~ -- // ??? 1 -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- { // ??? 2 -- ~~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- {// ??? 3 -- ~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- { -- ~~~~~~~~~~~~~ -- // ??? 4 -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- /* ??? 5 */} -- ~~~~~~~~~~~~~~~~~~~~~~~~ --
; -- ~~~~~~~~~~~~~~ --!!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -- } -- } -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js index 98c57bcd03..823cc2bea1 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js @@ -23,15 +23,12 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js.diff index f777fe9caf..c350c8d816 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js.diff @@ -1,25 +1,18 @@ --- old.commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js +++ new.commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).js -@@= skipped -22, +22 lines =@@ - } - +@@= skipped -24, +24 lines =@@ //// [commentsOnJSXExpressionsArePreserved.js] --"use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); -var _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; -var Component = /** @class */ (function () { - function Component() { ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); ++const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } - Component.prototype.render = function () { - return (0, jsx_dev_runtime_1.jsxDEV)("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js index 14f18f1f54..823cc2bea1 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js @@ -25,15 +25,10 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js.diff index 6f171edbee..a845746665 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).js.diff @@ -8,16 +8,11 @@ -var _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; -var Component = /** @class */ (function () { - function Component() { ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); ++const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } - Component.prototype.render = function () { - return (0, jsx_dev_runtime_1.jsxDEV)("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js index 98c57bcd03..8ff8ded1d7 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js @@ -23,15 +23,9 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return _jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js.diff index 026737e32b..2ecd951c71 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js.diff @@ -7,16 +7,10 @@ -var _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; -var Component = /** @class */ (function () { - function Component() { ++const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return _jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } - Component.prototype.render = function () { - return (0, _a.jsxDEV)("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt new file mode 100644 index 0000000000..d417296efa --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt @@ -0,0 +1,39 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + + +==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ + {/* missing */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + {null/* preserved */} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 1 + ~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { // ??? 2 + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + {// ??? 3 + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + { + ~~~~~~~~~~~~~ + // ??? 4 + ~~~~~~~~~~~~~~~~~~~~~~~~ + /* ??? 5 */} + ~~~~~~~~~~~~~~~~~~~~~~~~ +
; + ~~~~~~~~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js index 98c57bcd03..823cc2bea1 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js @@ -23,15 +23,12 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js.diff index f31e6769cd..ab3d3d7611 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).js.diff @@ -27,15 +27,12 @@ - } - }; -}); ++"use strict"; ++Object.defineProperty(exports, "__esModule", { value: true }); ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); ++const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); + } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js index 14f18f1f54..823cc2bea1 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js @@ -25,15 +25,10 @@ class Component { //// [commentsOnJSXExpressionsArePreserved.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js.diff index f6e1129e81..e7223ccee5 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).js.diff @@ -29,15 +29,10 @@ -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); ++const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; ++ return jsx_dev_runtime_1.jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); + } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js index 98c57bcd03..8ff8ded1d7 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js @@ -23,15 +23,9 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { - return
- - {null /* preserved */} - - - - -
; + return _jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); } } diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js.diff index 50cff5d6c0..938772963a 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js.diff +++ b/testdata/baselines/reference/submodule/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js.diff @@ -7,20 +7,14 @@ -var _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.render = function () { ++const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; +class Component { + render() { -+ return
-+ -+ {null /* preserved */} -+ -+ -+ -+ -+
; - } -- Component.prototype.render = function () { -- return _jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); + return _jsxDEV("div", { children: null /* preserved */ }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 15 }, this); - }; - return Component; -}()); ++ } +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js b/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js index 4a56ae8a33..216f86c6b2 100644 --- a/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js +++ b/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js @@ -15,4 +15,4 @@ export {} //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const thing = <__foot />; +const thing = __make(__foot, null); diff --git a/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js.diff b/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js.diff index 5ace597ada..ba6e31f118 100644 --- a/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js.diff +++ b/testdata/baselines/reference/submodule/compiler/doubleUnderscoreReactNamespace.js.diff @@ -5,4 +5,4 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var thing = __make(__foot, null); -+const thing = <__foot />; \ No newline at end of file ++const thing = __make(__foot, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js index 0c64c51ce1..386adf6430 100644 --- a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js +++ b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js @@ -18,6 +18,4 @@ let Foo = { Bar() { } }; let Baz = () => { }; -let x = Hello - -let y = Hello; +let x = React.createElement(Foo.Bar, null, "Hell let y = ", React.createElement(Baz, null, "Hello")); diff --git a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff index 74844d87e2..02b9c7a095 100644 --- a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff +++ b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff @@ -14,6 +14,4 @@ - "Hello let y = ", - React.createElement(Baz, null, "Hello")); +let Baz = () => { }; -+let x = Hello -+ -+let y = Hello; \ No newline at end of file ++let x = React.createElement(Foo.Bar, null, "Hell let y = ", React.createElement(Baz, null, "Hello")); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js index b54c6e52c7..b6e2180083 100644 --- a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js +++ b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js @@ -48,9 +48,6 @@ configureStore({ }); const Component = () => { const categories = ['Fruit', 'Vegetables']; - return (
    -
  • All
  • - {categories.map((category) => (
  • {category}
  • // Error about 'key' only - ))} -
); + return (React.createElement("ul", null, React.createElement("li", null, "All"), categories.map((category) => (React.createElement("li", { key: category }, category) // Error about 'key' only + )))); }; diff --git a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff index 2c1b5604d5..54f26d014b 100644 --- a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff +++ b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff @@ -25,9 +25,6 @@ - ); }))); +const Component = () => { + const categories = ['Fruit', 'Vegetables']; -+ return (
    -+
  • All
  • -+ {categories.map((category) => (
  • {category}
  • // Error about 'key' only -+ ))} -+
); ++ return (React.createElement("ul", null, React.createElement("li", null, "All"), categories.map((category) => (React.createElement("li", { key: category }, category) // Error about 'key' only ++ )))); }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js b/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js index 49b2cce60f..5dc0a47dea 100644 --- a/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js +++ b/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js @@ -26,6 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); // Repro from #50858 const react_1 = __importDefault(require("react")); function Component(props) { - return <>; + return react_1.default.createElement(react_1.default.Fragment, null); } -const v1 = e.preventDefault()}/>; +const v1 = react_1.default.createElement(Component, { onClick: e => e.preventDefault() }); diff --git a/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js.diff b/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js.diff index 8ee1f32ffd..c3913dfad3 100644 --- a/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js.diff +++ b/testdata/baselines/reference/submodule/compiler/genericInferenceDefaultTypeParameterJsxReact.js.diff @@ -14,8 +14,7 @@ -var react_1 = __importDefault(require("react")); +const react_1 = __importDefault(require("react")); function Component(props) { -- return react_1.default.createElement(react_1.default.Fragment, null); -+ return <>; + return react_1.default.createElement(react_1.default.Fragment, null); } -var v1 = react_1.default.createElement(Component, { onClick: function (e) { return e.preventDefault(); } }); -+const v1 = e.preventDefault()}/>; \ No newline at end of file ++const v1 = react_1.default.createElement(Component, { onClick: e => e.preventDefault() }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js b/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js index f6b7d1e13c..e4eea244b9 100644 --- a/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js +++ b/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js @@ -33,5 +33,5 @@ let props = { foo: "", "data-yadda": 42, // Error }; -let x1 = ; -let x2 = ; // Error +let x1 = React.createElement(Yadda, { foo: "hello", "data-yadda": 42 }); +let x2 = React.createElement(Yadda, { bar: "hello", "data-yadda": 42 }); // Error diff --git a/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js.diff b/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js.diff index 184d4f232c..58a0eb23ef 100644 --- a/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js.diff +++ b/testdata/baselines/reference/submodule/compiler/ignoredJsxAttributes.js.diff @@ -17,5 +17,5 @@ }; -var x1 = React.createElement(Yadda, { foo: "hello", "data-yadda": 42 }); -var x2 = React.createElement(Yadda, { bar: "hello", "data-yadda": 42 }); // Error -+let x1 = ; -+let x2 = ; // Error \ No newline at end of file ++let x1 = React.createElement(Yadda, { foo: "hello", "data-yadda": 42 }); ++let x2 = React.createElement(Yadda, { bar: "hello", "data-yadda": 42 }); // Error \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js b/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js index 7c5c833683..bb85abcce9 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js +++ b/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js @@ -23,6 +23,18 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; -exports.x = ; +const tslib_1 = require("tslib"); +exports.x = React.createElement("span", tslib_1.__assign({}, o)); //// [script.js] -const x = ; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +const x = React.createElement("span", __assign({}, o)); diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js.diff b/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js.diff index b4c41e12f0..2d4ed85a27 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js.diff +++ b/testdata/baselines/reference/submodule/compiler/importHelpersInTsx.js.diff @@ -5,19 +5,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; -var tslib_1 = require("tslib"); --exports.x = React.createElement("span", tslib_1.__assign({}, o)); -+exports.x = ; ++const tslib_1 = require("tslib"); + exports.x = React.createElement("span", tslib_1.__assign({}, o)); //// [script.js] --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { +@@= skipped -14, +14 lines =@@ + }; + return __assign.apply(this, arguments); + }; -var x = React.createElement("span", __assign({}, o)); -+const x = ; \ No newline at end of file ++const x = React.createElement("span", __assign({}, o)); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js index ede770dddc..7444e18d4a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js +++ b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js @@ -11,7 +11,4 @@ declare var React: any; //// [jsxAttributeWithoutExpressionReact.js] - - } dataSource={this.state.ds} renderRow=> - -; +React.createElement(View, null, React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); diff --git a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff index a3bfc32e95..d422561af4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff @@ -6,7 +6,4 @@ //// [jsxAttributeWithoutExpressionReact.js] -React.createElement(View, null, - React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); -+ -+ } dataSource={this.state.ds} renderRow=> -+ -+; \ No newline at end of file ++React.createElement(View, null, React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js b/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js index a3302be17b..089e12841d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js +++ b/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js @@ -22,7 +22,7 @@ exports.Hoc = void 0; /// const React = require("react"); const Hoc = (TagElement) => { - const Component = () => ; + const Component = () => React.createElement(TagElement, null); return Component; }; exports.Hoc = Hoc; diff --git a/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js.diff b/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js.diff index 511f3c1d7c..7fa41d9a13 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxCallElaborationCheckNoCrash1.js.diff @@ -13,7 +13,7 @@ +/// +const React = require("react"); +const Hoc = (TagElement) => { -+ const Component = () => ; ++ const Component = () => React.createElement(TagElement, null); return Component; }; exports.Hoc = Hoc; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js index 0815f0d72e..e98f1efae1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js @@ -15,7 +15,4 @@ const a = ( //// [index.js] /// /// -const a = (
- {(
)} - -
); +const a = (React.createElement("main", null, (React.createElement("div", null)), React.createElement("span", null))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff index a860c29a51..60fa1c536d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff @@ -10,7 +10,4 @@ -const a = (React.createElement("main", null, - (React.createElement("div", null)), - React.createElement("span", null))); -+const a = (
-+ {(
)} -+ -+
); \ No newline at end of file ++const a = (React.createElement("main", null, (React.createElement("div", null)), React.createElement("span", null))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js index 041c0cca80..3c3753387f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js @@ -20,7 +20,4 @@ const b = ( //// [index.js] /// /// -const b = ( - {
} - {"aa"} - ); +const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff index 1b46672d6f..f17c17a3b6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff @@ -10,7 +10,4 @@ -var b = (React.createElement(Foo, null, - React.createElement("div", null), - "aa")); -+const b = ( -+ {
} -+ {"aa"} -+ ); \ No newline at end of file ++const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js index a57d32d692..30ff56eb00 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js @@ -87,50 +87,29 @@ exports.Blah3 = Blah3; /// const React = require("react"); function Blah(props) { - return <>; + return React.createElement(React.Fragment, null); } // Incompatible child. -var a = - {x => x} -; +var a = React.createElement(Blah, null, x => x); // Blah components don't accept text as child elements -var a = - Hello unexpected text! -; +var a = React.createElement(Blah, null, "Hello unexpected text"); // Blah components don't accept multiple children. -var a = - {x => "" + x} - {x => "" + x} -; +var a = React.createElement(Blah, null, x => "" + x, x => "" + x); function Blah2(props) { - return <>; + return React.createElement(React.Fragment, null); } // Incompatible child. -var a = - {x => x} -; +var a = React.createElement(Blah2, null, x => x); // Blah2 components don't accept text as child elements -var a = - Hello unexpected text! -; +var a = React.createElement(Blah2, null, "Hello unexpected text"); // Blah2 components don't accept multiple children of the wrong type. -var a = - {x => x} - {x => x} -; +var a = React.createElement(Blah2, null, x => x, x => x); function Blah3(props) { - return <>; + return React.createElement(React.Fragment, null); } // Incompatible child. -var a = - {x => x} -; +var a = React.createElement(Blah3, null, x => x); // Blah3 components don't accept text as child elements -var a = - Hello unexpected text! -; +var a = React.createElement(Blah3, null, "Hello unexpected text"); // Blah3 components don't accept multiple children of the wrong type. -var a = - {x => x} - {x => x} -; +var a = React.createElement(Blah3, null, x => x, x => x); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff index f7f91ac281..605390a00d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff @@ -7,68 +7,44 @@ -var React = require("react"); +const React = require("react"); function Blah(props) { -- return React.createElement(React.Fragment, null); -+ return <>; + return React.createElement(React.Fragment, null); } // Incompatible child. -var a = React.createElement(Blah, null, function (x) { return x; }); -+var a = -+ {x => x} -+; ++var a = React.createElement(Blah, null, x => x); // Blah components don't accept text as child elements -var a = React.createElement(Blah, null, "Hello unexpected text!"); -+var a = -+ Hello unexpected text! -+; ++var a = React.createElement(Blah, null, "Hello unexpected text"); // Blah components don't accept multiple children. -var a = React.createElement(Blah, null, - function (x) { return "" + x; }, - function (x) { return "" + x; }); -+var a = -+ {x => "" + x} -+ {x => "" + x} -+; ++var a = React.createElement(Blah, null, x => "" + x, x => "" + x); function Blah2(props) { -- return React.createElement(React.Fragment, null); -+ return <>; + return React.createElement(React.Fragment, null); } // Incompatible child. -var a = React.createElement(Blah2, null, function (x) { return x; }); -+var a = -+ {x => x} -+; ++var a = React.createElement(Blah2, null, x => x); // Blah2 components don't accept text as child elements -var a = React.createElement(Blah2, null, "Hello unexpected text!"); -+var a = -+ Hello unexpected text! -+; ++var a = React.createElement(Blah2, null, "Hello unexpected text"); // Blah2 components don't accept multiple children of the wrong type. -var a = React.createElement(Blah2, null, - function (x) { return x; }, - function (x) { return x; }); -+var a = -+ {x => x} -+ {x => x} -+; ++var a = React.createElement(Blah2, null, x => x, x => x); function Blah3(props) { -- return React.createElement(React.Fragment, null); -+ return <>; + return React.createElement(React.Fragment, null); } // Incompatible child. -var a = React.createElement(Blah3, null, function (x) { return x; }); -+var a = -+ {x => x} -+; ++var a = React.createElement(Blah3, null, x => x); // Blah3 components don't accept text as child elements -var a = React.createElement(Blah3, null, "Hello unexpected text!"); -+var a = -+ Hello unexpected text! -+; ++var a = React.createElement(Blah3, null, "Hello unexpected text"); // Blah3 components don't accept multiple children of the wrong type. -var a = React.createElement(Blah3, null, - function (x) { return x; }, - function (x) { return x; }); -+var a = -+ {x => x} -+ {x => x} -+; \ No newline at end of file ++var a = React.createElement(Blah3, null, x => x, x => x); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js index 8f483f4150..354a537461 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js @@ -33,16 +33,14 @@ exports.App = void 0; /// const React = require("react"); function TabLayout(props) { - return
; + return React.createElement("div", null); } class App extends React.Component { render() { - return - {[ - ['Users',
], - ['Products',
] - ]} - ; + return React.createElement(TabLayout, null, [ + ['Users', React.createElement("div", null)], + ['Products', React.createElement("div", null)] + ]); } } exports.App = App; diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js.diff index 289365f568..f159f42c4e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenSingleChildConfusableWithMultipleChildrenNoError.js.diff @@ -26,29 +26,23 @@ +/// +const React = require("react"); function TabLayout(props) { -- return React.createElement("div", null); -+ return
; + return React.createElement("div", null); } -var App = /** @class */ (function (_super) { - __extends(App, _super); - function App() { - return _super !== null && _super.apply(this, arguments) || this; +- } +- App.prototype.render = function () { +class App extends React.Component { + render() { -+ return -+ {[ -+ ['Users',
], -+ ['Products',
] -+ ]} -+ ; - } -- App.prototype.render = function () { -- return React.createElement(TabLayout, null, [ -- ['Users', React.createElement("div", null)], -- ['Products', React.createElement("div", null)] -- ]); + return React.createElement(TabLayout, null, [ + ['Users', React.createElement("div", null)], + ['Products', React.createElement("div", null)] + ]); - }; - return App; -}(React.Component)); ++ } +} exports.App = App; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js index 0a29d2575b..a4dc7e7d0d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js @@ -19,7 +19,4 @@ const b = ( //// [other.js] /// /// -const b = ( - {
} - {"aa"} - ); +const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff index 0a6f64437b..a6b8208467 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff @@ -10,7 +10,4 @@ -const b = (React.createElement(Foo, null, - React.createElement("div", null), - "aa")); -+const b = ( -+ {
} -+ {"aa"} -+ ); \ No newline at end of file ++const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js index faa91763bc..0b71ffe9f6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js +++ b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js @@ -27,6 +27,7 @@ import './'; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; +const jsx_runtime_1 = require("react/jsx-runtime"); class App { } -exports.a = ; +exports.a = jsx_runtime_1.jsx(App, {}); diff --git a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js.diff b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js.diff index e388910f4b..008ea61514 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js.diff @@ -1,11 +1,8 @@ --- old.jsxClassAttributeResolution.js +++ new.jsxClassAttributeResolution.js -@@= skipped -26, +26 lines =@@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.a = void 0; --const jsx_runtime_1 = require("react/jsx-runtime"); +@@= skipped -29, +29 lines =@@ + const jsx_runtime_1 = require("react/jsx-runtime"); class App { } -exports.a = (0, jsx_runtime_1.jsx)(App, {}); -+exports.a = ; \ No newline at end of file ++exports.a = jsx_runtime_1.jsx(App, {}); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js b/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js index 6a0edaacf7..ee76f869af 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js +++ b/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js @@ -612,16 +612,27 @@ export interface ReactSelectProps extends React.Props const React = require("react"); function createReactSingleSelect(WrappedComponent) { return (props) => { - return ( { + return (React.createElement(ReactSelectClass, __assign({}, props, { multi: false, autosize: false, value: props.value, onChange: (value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } - }}/>); + } }))); }; } diff --git a/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js.diff b/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js.diff index dba5ed4a08..19874c82c5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxComplexSignatureHasApplicabilityError.js.diff @@ -5,17 +5,11 @@ //// [jsxComplexSignatureHasApplicabilityError.js] "use strict"; -/// --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -14, +13 lines =@@ + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createReactSingleSelect = createReactSingleSelect; -var React = require("react"); @@ -25,11 +19,7 @@ - return function (props) { - return (React.createElement(ReactSelectClass, __assign({}, props, { multi: false, autosize: false, value: props.value, onChange: function (value) { + return (props) => { -+ return ( { ++ return (React.createElement(ReactSelectClass, __assign({}, props, { multi: false, autosize: false, value: props.value, onChange: (value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); - } -- } }))); -+ }}/>); - }; - } \ No newline at end of file + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementType.js b/testdata/baselines/reference/submodule/compiler/jsxElementType.js index e2297f9aec..f1fc1a1f37 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxElementType.js @@ -120,32 +120,32 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); let Component; -const RenderElement = ({ title }) =>
{title}
; +const RenderElement = ({ title }) => React.createElement("div", null, title); Component = RenderElement; -; -; -; +React.createElement(RenderElement, null); +React.createElement(RenderElement, { title: "react" }); +React.createElement(RenderElement, { excessProp: true }); const RenderString = ({ title }) => title; Component = RenderString; -; -; -; +React.createElement(RenderString, null); +React.createElement(RenderString, { title: "react" }); +React.createElement(RenderString, { excessProp: true }); const RenderNumber = ({ title }) => title.length; Component = RenderNumber; -; -; -; +React.createElement(RenderNumber, null); +React.createElement(RenderNumber, { title: "react" }); +React.createElement(RenderNumber, { excessProp: true }); const RenderArray = ({ title }) => [title]; Component = RenderArray; -; -; -; +React.createElement(RenderArray, null); +React.createElement(RenderArray, { title: "react" }); +React.createElement(RenderArray, { excessProp: true }); // React Server Component const RenderPromise = async ({ title }) => "react"; Component = RenderPromise; -; -; -; +React.createElement(RenderPromise, null); +React.createElement(RenderPromise, { title: "react" }); +React.createElement(RenderPromise, { excessProp: true }); // Class components still work class RenderStringClass extends React.Component { render() { @@ -153,25 +153,25 @@ class RenderStringClass extends React.Component { } } Component = RenderStringClass; -; -; -; +React.createElement(RenderStringClass, null); +React.createElement(RenderStringClass, { title: "react" }); +React.createElement(RenderStringClass, { excessProp: true }); // Host element types still work -
; -; +React.createElement("div", null); +React.createElement("my-custom-element", null); // Undeclared host element types are still rejected -; -; +React.createElement("boop", null); +React.createElement("my-undeclared-custom-element", null); function ReactNativeFlatList(props, ref) { return null; } -; +React.createElement(ReactNativeFlatList, null); // testing higher-order component compat function f1(Component) { - return ; + return React.createElement(Component, null); } -; -; -; -; -; +React.createElement(Unresolved, null); +React.createElement(Unresolved, { foo: "abc" }); +React.createElement("a:b", { a: "accepted" }); +React.createElement("a:b", { b: "rejected" }); +React.createElement("a:b", { a: "accepted", b: "rejected" }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxElementType.js.diff index 70457df707..f9f3d9efc7 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxElementType.js.diff @@ -65,50 +65,38 @@ -}; +const React = require("react"); +let Component; -+const RenderElement = ({ title }) =>
{title}
; ++const RenderElement = ({ title }) => React.createElement("div", null, title); Component = RenderElement; --React.createElement(RenderElement, null); --React.createElement(RenderElement, { title: "react" }); --React.createElement(RenderElement, { excessProp: true }); + React.createElement(RenderElement, null); + React.createElement(RenderElement, { title: "react" }); + React.createElement(RenderElement, { excessProp: true }); -var RenderString = function (_a) { - var title = _a.title; - return title; -}; -+; -+; -+; +const RenderString = ({ title }) => title; Component = RenderString; --React.createElement(RenderString, null); --React.createElement(RenderString, { title: "react" }); --React.createElement(RenderString, { excessProp: true }); + React.createElement(RenderString, null); + React.createElement(RenderString, { title: "react" }); + React.createElement(RenderString, { excessProp: true }); -var RenderNumber = function (_a) { - var title = _a.title; - return title.length; -}; -+; -+; -+; +const RenderNumber = ({ title }) => title.length; Component = RenderNumber; --React.createElement(RenderNumber, null); --React.createElement(RenderNumber, { title: "react" }); --React.createElement(RenderNumber, { excessProp: true }); + React.createElement(RenderNumber, null); + React.createElement(RenderNumber, { title: "react" }); + React.createElement(RenderNumber, { excessProp: true }); -var RenderArray = function (_a) { - var title = _a.title; - return [title]; -}; -+; -+; -+; +const RenderArray = ({ title }) => [title]; Component = RenderArray; --React.createElement(RenderArray, null); --React.createElement(RenderArray, { title: "react" }); --React.createElement(RenderArray, { excessProp: true }); -+; -+; -+; + React.createElement(RenderArray, null); + React.createElement(RenderArray, { title: "react" }); + React.createElement(RenderArray, { excessProp: true }); // React Server Component -var RenderPromise = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) { - var title = _b.title; @@ -118,12 +106,9 @@ -}); }; +const RenderPromise = async ({ title }) => "react"; Component = RenderPromise; --React.createElement(RenderPromise, null); --React.createElement(RenderPromise, { title: "react" }); --React.createElement(RenderPromise, { excessProp: true }); -+; -+; -+; + React.createElement(RenderPromise, null); + React.createElement(RenderPromise, { title: "react" }); + React.createElement(RenderPromise, { excessProp: true }); // Class components still work -var RenderStringClass = /** @class */ (function (_super) { - __extends(RenderStringClass, _super); @@ -140,39 +125,5 @@ + } +} Component = RenderStringClass; --React.createElement(RenderStringClass, null); --React.createElement(RenderStringClass, { title: "react" }); --React.createElement(RenderStringClass, { excessProp: true }); -+; -+; -+; - // Host element types still work --React.createElement("div", null); --React.createElement("my-custom-element", null); -+
; -+; - // Undeclared host element types are still rejected --React.createElement("boop", null); --React.createElement("my-undeclared-custom-element", null); -+; -+; - function ReactNativeFlatList(props, ref) { - return null; - } --React.createElement(ReactNativeFlatList, null); -+; - // testing higher-order component compat - function f1(Component) { -- return React.createElement(Component, null); -+ return ; - } --React.createElement(Unresolved, null); --React.createElement(Unresolved, { foo: "abc" }); --React.createElement("a:b", { a: "accepted" }); --React.createElement("a:b", { b: "rejected" }); --React.createElement("a:b", { a: "accepted", b: "rejected" }); -+; -+; -+; -+; -+; \ No newline at end of file + React.createElement(RenderStringClass, null); + React.createElement(RenderStringClass, { title: "react" }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js index 60b6254c2c..8db5f67eed 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js +++ b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js @@ -29,9 +29,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); // should be fine - `ElementType` accepts `div` -let a =
; +let a = React.createElement("div", null); // should be an error - `ElementType` does not accept `span` -let b = ; +let b = React.createElement("span", null); // Should be an error. // `ruhroh` is in neither `IntrinsicElements` nor `ElementType` -let c = ; +let c = React.createElement("ruhroh", null); diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js.diff b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js.diff index 4046e0ffbc..9fe1e2f2bb 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteral.js.diff @@ -8,11 +8,11 @@ +const React = require("react"); // should be fine - `ElementType` accepts `div` -var a = React.createElement("div", null); -+let a =
; ++let a = React.createElement("div", null); // should be an error - `ElementType` does not accept `span` -var b = React.createElement("span", null); -+let b = ; ++let b = React.createElement("span", null); // Should be an error. // `ruhroh` is in neither `IntrinsicElements` nor `ElementType` -var c = React.createElement("ruhroh", null); -+let c = ; \ No newline at end of file ++let c = React.createElement("ruhroh", null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js index 624b6bfc24..4ac375ed69 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js +++ b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js @@ -30,7 +30,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); // should be fine - `ElementType` accepts `div` -let a =
; +let a = React.createElement("div", null); // Should be an error. // `ruhroh` is in neither `IntrinsicElements` nor `ElementType` -let c = ; +let c = React.createElement("ruhroh", null); diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js.diff b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js.diff index 6cbff86779..2602b02626 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxElementTypeLiteralWithGeneric.js.diff @@ -8,8 +8,8 @@ +const React = require("react"); // should be fine - `ElementType` accepts `div` -var a = React.createElement("div", null); -+let a =
; ++let a = React.createElement("div", null); // Should be an error. // `ruhroh` is in neither `IntrinsicElements` nor `ElementType` -var c = React.createElement("ruhroh", null); -+let c = ; \ No newline at end of file ++let c = React.createElement("ruhroh", null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js b/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js index 427cf4ea95..7c3ecfb686 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js +++ b/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js @@ -19,8 +19,8 @@ function B() { //// [a.js] function A() { - return ; + return React.createElement("package", null); } function B() { - return ; + return React.createElement("package", null); } diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js.diff b/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js.diff index 4d973d3150..8f8f318dd6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxElementsAsIdentifierNames.js.diff @@ -6,10 +6,5 @@ //// [a.js] -"use strict"; function A() { -- return React.createElement("package", null); -+ return ; - } - function B() { -- return React.createElement("package", null); -+ return ; + return React.createElement("package", null); } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js b/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js index af8bb27f7a..6d9344dd15 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js +++ b/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js @@ -76,8 +76,8 @@ let c; class A { view() { return [ - , - + Element_1.Element.createElement("meta", { content: "helloworld" }), + Element_1.Element.createElement("meta", { content: c.a.b }) ]; } } diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js.diff b/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js.diff deleted file mode 100644 index 7de2902238..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxEmitWithAttributes.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.jsxEmitWithAttributes.js -+++ new.jsxEmitWithAttributes.js -@@= skipped -75, +75 lines =@@ - class A { - view() { - return [ -- Element_1.Element.createElement("meta", { content: "helloworld" }), -- Element_1.Element.createElement("meta", { content: c.a.b }) -+ , -+ - ]; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js index d60756f37a..9961ba8b5a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js @@ -25,9 +25,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); function Wrapper(props) { - return
{props.children}
; + return React.createElement("div", null, props.children); } -const element = ( - -
Hello
-
); +const element = (React.createElement(Wrapper, null, React.createElement("div", null, "Hello"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff index 6bf83ae4ff..ec992273f0 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff @@ -7,12 +7,8 @@ -var React = require("react"); +const React = require("react"); function Wrapper(props) { -- return React.createElement("div", null, props.children); -+ return
{props.children}
; + return React.createElement("div", null, props.children); } -var element = (React.createElement(Wrapper, null, - React.createElement("div", null, "Hello"))); -+const element = ( -+ -+
Hello
-+
); \ No newline at end of file ++const element = (React.createElement(Wrapper, null, React.createElement("div", null, "Hello"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js index b5eab3ac43..92f891d77e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js @@ -22,10 +22,8 @@ const element = ( //// [jsxEmptyExpressionNotCountedAsChild.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); function Wrapper(props) { - return
{props.children}
; + return jsx_runtime_1.jsx("div", { children: props.children }); } -const element = ( - -
Hello
-
); +const element = (jsx_runtime_1.jsx(Wrapper, { children: jsx_runtime_1.jsx("div", { children: "Hello" }) })); diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js.diff index 862a1f45ea..3d91add4a1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsx).js.diff @@ -5,12 +5,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); function Wrapper(props) { - return (0, jsx_runtime_1.jsx)("div", { children: props.children }); -+ return
{props.children}
; ++ return jsx_runtime_1.jsx("div", { children: props.children }); } -var element = ((0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsx)("div", { children: "Hello" }) })); -+const element = ( -+ -+
Hello
-+
); \ No newline at end of file ++const element = (jsx_runtime_1.jsx(Wrapper, { children: jsx_runtime_1.jsx("div", { children: "Hello" }) })); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js index b5eab3ac43..ff4709d934 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js @@ -22,10 +22,9 @@ const element = ( //// [jsxEmptyExpressionNotCountedAsChild.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +const _jsxFileName = "jsxEmptyExpressionNotCountedAsChild.tsx"; function Wrapper(props) { - return
{props.children}
; + return jsx_dev_runtime_1.jsxDEV("div", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 9, columnNumber: 11 }, this); } -const element = ( - -
Hello
-
); +const element = (jsx_dev_runtime_1.jsxDEV(Wrapper, { children: jsx_dev_runtime_1.jsxDEV("div", { children: "Hello" }, void 0, false, { fileName: _jsxFileName, lineNumber: 15, columnNumber: 6 }, this) }, void 0, false, { fileName: _jsxFileName, lineNumber: 12, columnNumber: 18 }, this)); diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js.diff b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js.diff index e57fb7d93f..c93cd03406 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react-jsxdev).js.diff @@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); -var _jsxFileName = "jsxEmptyExpressionNotCountedAsChild.tsx"; ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); ++const _jsxFileName = "jsxEmptyExpressionNotCountedAsChild.tsx"; function Wrapper(props) { - return (0, jsx_dev_runtime_1.jsxDEV)("div", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 9, columnNumber: 11 }, this); -+ return
{props.children}
; ++ return jsx_dev_runtime_1.jsxDEV("div", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 9, columnNumber: 11 }, this); } -var element = ((0, jsx_dev_runtime_1.jsxDEV)(Wrapper, { children: (0, jsx_dev_runtime_1.jsxDEV)("div", { children: "Hello" }, void 0, false, { fileName: _jsxFileName, lineNumber: 15, columnNumber: 6 }, this) }, void 0, false, { fileName: _jsxFileName, lineNumber: 12, columnNumber: 18 }, this)); -+const element = ( -+ -+
Hello
-+
); \ No newline at end of file ++const element = (jsx_dev_runtime_1.jsxDEV(Wrapper, { children: jsx_dev_runtime_1.jsxDEV("div", { children: "Hello" }, void 0, false, { fileName: _jsxFileName, lineNumber: 15, columnNumber: 6 }, this) }, void 0, false, { fileName: _jsxFileName, lineNumber: 12, columnNumber: 18 }, this)); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js b/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js index ad7a7106d5..cbd2b8fb00 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js +++ b/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js @@ -20,12 +20,23 @@ const myHoc = ( //// [jsxExcessPropsAndAssignability.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); const myHoc = (ComposedComponent) => { const WrapperComponent = null; const props = null; - ; - ; + React.createElement(WrapperComponent, __assign({}, props, { myProp: '1000000' })); + React.createElement(WrapperComponent, __assign({}, props, { myProp: 1000000 })); }; diff --git a/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js.diff b/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js.diff index a4512f64e9..f9b0e6d9fe 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxExcessPropsAndAssignability.js.diff @@ -5,29 +5,22 @@ //// [jsxExcessPropsAndAssignability.js] "use strict"; -/// --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -13, +12 lines =@@ + return __assign.apply(this, arguments); + }; Object.defineProperty(exports, "__esModule", { value: true }); -var React = require("react"); -var myHoc = function (ComposedComponent) { - var WrapperComponent = null; - var props = null; -- React.createElement(WrapperComponent, __assign({}, props, { myProp: '1000000' })); -- React.createElement(WrapperComponent, __assign({}, props, { myProp: 1000000 })); +/// +const React = require("react"); +const myHoc = (ComposedComponent) => { + const WrapperComponent = null; + const props = null; -+ ; -+ ; + React.createElement(WrapperComponent, __assign({}, props, { myProp: '1000000' })); + React.createElement(WrapperComponent, __assign({}, props, { myProp: 1000000 })); }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js index 545bf4a487..faba591900 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js @@ -8,5 +8,5 @@ declare var Frag: any; <>1<>2.12.2; //// [jsxFactoryAndJsxFragmentFactory.js] -<>; -<>1<>2.12.2; +h(Frag, null); +h(Frag, null, h("span", null, "1"), h(Frag, null, h("span", null, "2.1"), h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff index e9bdb5be3c..7b47493d91 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff @@ -1,14 +1,12 @@ --- old.jsxFactoryAndJsxFragmentFactory.js +++ new.jsxFactoryAndJsxFragmentFactory.js -@@= skipped -7, +7 lines =@@ - <>1<>2.12.2; +@@= skipped -8, +8 lines =@@ //// [jsxFactoryAndJsxFragmentFactory.js] --h(Frag, null); + h(Frag, null); -h(Frag, null, - h("span", null, "1"), - h(Frag, null, - h("span", null, "2.1"), - h("span", null, "2.2"))); -+<>; -+<>1<>2.12.2; \ No newline at end of file ++h(Frag, null, h("span", null, "1"), h(Frag, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js index 20ffb4c17f..a724406b71 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js @@ -7,5 +7,5 @@ declare var h: any; <>1<>2.12.2; //// [jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js] -<>; -<>1<>2.12.2; +h(React.Fragment, null); +h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff index e8a49611e4..77b56ccfe3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff @@ -1,14 +1,12 @@ --- old.jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js +++ new.jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js -@@= skipped -6, +6 lines =@@ - <>1<>2.12.2; +@@= skipped -7, +7 lines =@@ //// [jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js] --h(React.Fragment, null); + h(React.Fragment, null); -h(React.Fragment, null, - h("span", null, "1"), - h(React.Fragment, null, - h("span", null, "2.1"), - h("span", null, "2.2"))); -+<>; -+<>1<>2.12.2; \ No newline at end of file ++h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js index b2f44816d7..a9d22fd0db 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js @@ -7,5 +7,5 @@ declare var h: any; <>1<>2.12.2; //// [jsxFactoryAndJsxFragmentFactoryNull.js] -<>; -<>1<>2.12.2; +h(null, null); +h(null, null, h("span", null, "1"), h(null, null, h("span", null, "2.1"), h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff index e28591f805..4069a9e30f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff @@ -1,14 +1,12 @@ --- old.jsxFactoryAndJsxFragmentFactoryNull.js +++ new.jsxFactoryAndJsxFragmentFactoryNull.js -@@= skipped -6, +6 lines =@@ - <>1<>2.12.2; +@@= skipped -7, +7 lines =@@ //// [jsxFactoryAndJsxFragmentFactoryNull.js] --h(null, null); + h(null, null); -h(null, null, - h("span", null, "1"), - h(null, null, - h("span", null, "2.1"), - h("span", null, "2.2"))); -+<>; -+<>1<>2.12.2; \ No newline at end of file ++h(null, null, h("span", null, "1"), h(null, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js index f852cc3e87..243700d76b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js @@ -76,8 +76,8 @@ let c; class A { view() { return [ - , - + Element_1.Element.createElement("meta", { content: "helloworld" }), + Element_1.Element.createElement("meta", { content: c.a.b }) ]; } } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js.diff deleted file mode 100644 index 88b5e7decc..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndReactNamespace.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.jsxFactoryAndReactNamespace.js -+++ new.jsxFactoryAndReactNamespace.js -@@= skipped -75, +75 lines =@@ - class A { - view() { - return [ -- Element_1.Element.createElement("meta", { content: "helloworld" }), -- Element_1.Element.createElement("meta", { content: c.a.b }) -+ , -+ - ]; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js index 59406a22fd..de9f387250 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js @@ -7,5 +7,5 @@ declare var h: any; <>1<>2.12.2; //// [jsxFactoryButNoJsxFragmentFactory.js] -<>; -<>1<>2.12.2; +h(React.Fragment, null); +h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff index e610a92c5a..4456fecc25 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff @@ -1,14 +1,12 @@ --- old.jsxFactoryButNoJsxFragmentFactory.js +++ new.jsxFactoryButNoJsxFragmentFactory.js -@@= skipped -6, +6 lines =@@ - <>1<>2.12.2; +@@= skipped -7, +7 lines =@@ //// [jsxFactoryButNoJsxFragmentFactory.js] --h(React.Fragment, null); + h(React.Fragment, null); -h(React.Fragment, null, - h("span", null, "1"), - h(React.Fragment, null, - h("span", null, "2.1"), - h("span", null, "2.2"))); -+<>; -+<>1<>2.12.2; \ No newline at end of file ++h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js index 19d5c4cca0..cb508fab4f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js @@ -79,8 +79,8 @@ let c; class A { view() { return [ - , - + createElement("meta", { content: "helloworld" }), + createElement("meta", { content: c.a.b }) ]; } } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.diff deleted file mode 100644 index af9cb7255b..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.jsxFactoryIdentifier.js -+++ new.jsxFactoryIdentifier.js -@@= skipped -78, +78 lines =@@ - class A { - view() { - return [ -- createElement("meta", { content: "helloworld" }), -- createElement("meta", { content: c.a.b }) -+ , -+ - ]; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map index 80aa276c7e..7993a03b7e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map @@ -3,5 +3,5 @@ //// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuY3JlYXRlRWxlbWVudCA9IGV4cG9ydHMuRWxlbWVudCA9IHZvaWQgMDsNCnZhciBFbGVtZW50Ow0KKGZ1bmN0aW9uIChFbGVtZW50KSB7DQogICAgZnVuY3Rpb24gaXNFbGVtZW50KGVsKSB7DQogICAgICAgIHJldHVybiBlbC5tYXJrQXNDaGlsZE9mUm9vdEVsZW1lbnQgIT09IHVuZGVmaW5lZDsNCiAgICB9DQogICAgRWxlbWVudC5pc0VsZW1lbnQgPSBpc0VsZW1lbnQ7DQogICAgZnVuY3Rpb24gY3JlYXRlRWxlbWVudChhcmdzKSB7DQogICAgICAgIHJldHVybiB7fTsNCiAgICB9DQogICAgRWxlbWVudC5jcmVhdGVFbGVtZW50ID0gY3JlYXRlRWxlbWVudDsNCn0pKEVsZW1lbnQgfHwgKGV4cG9ydHMuRWxlbWVudCA9IEVsZW1lbnQgPSB7fSkpOw0KZXhwb3J0cy5jcmVhdGVFbGVtZW50ID0gRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KZnVuY3Rpb24gdG9DYW1lbENhc2UodGV4dCkgew0KICAgIHJldHVybiB0ZXh0WzBdLnRvTG93ZXJDYXNlKCkgKyB0ZXh0LnN1YnN0cmluZygxKTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVsZW1lbnQuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRWxlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBWUEsSUFBaUIsT0FVaEI7QUFWRCxXQUFpQixPQUFPLEVBQUM7SUFDckIsU0FBZ0IsU0FBUyxDQUFDLEVBQU8sRUFBcUI7UUFDbEQsT0FBTyxFQUFFLENBQUMsd0JBQXdCLEtBQUssU0FBUyxDQUFDO0lBQUEsQ0FDcEQ7SUFGZSxRQUFBLFNBQVMsWUFFeEIsQ0FBQTtJQUVELFNBQWdCLGFBQWEsQ0FBQyxJQUFXLEVBQUU7UUFFdkMsT0FBTyxFQUNOLENBQUE7SUFBQSxDQUNKO0lBSmUsUUFBQSxhQUFhLGdCQUk1QixDQUFBO0FBQUEsQ0FDSixFQVZnQixPQUFPLGFBQVAsT0FBTyxHQUFQLE9BQU8sUUFVdkI7QUFFVSxRQUFBLGFBQWEsR0FBRyxPQUFPLENBQUMsYUFBYSxDQUFDO0FBRWpELFNBQVMsV0FBVyxDQUFDLElBQVksRUFBVTtJQUN2QyxPQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxXQUFXLEVBQUUsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQUEsQ0FDcEQifQ==,ZGVjbGFyZSBuYW1lc3BhY2UgSlNYIHsKICAgIGludGVyZmFjZSBFbGVtZW50IHsKICAgICAgICBuYW1lOiBzdHJpbmc7CiAgICAgICAgaXNJbnRyaW5zaWM6IGJvb2xlYW47CiAgICAgICAgaXNDdXN0b21FbGVtZW50OiBib29sZWFuOwogICAgICAgIHRvU3RyaW5nKHJlbmRlcklkPzogbnVtYmVyKTogc3RyaW5nOwogICAgICAgIGJpbmRET00ocmVuZGVySWQ/OiBudW1iZXIpOiBudW1iZXI7CiAgICAgICAgcmVzZXRDb21wb25lbnQoKTogdm9pZDsKICAgICAgICBpbnN0YW50aWF0ZUNvbXBvbmVudHMocmVuZGVySWQ/OiBudW1iZXIpOiBudW1iZXI7CiAgICAgICAgcHJvcHM6IGFueTsKICAgIH0KfQpleHBvcnQgbmFtZXNwYWNlIEVsZW1lbnQgewogICAgZXhwb3J0IGZ1bmN0aW9uIGlzRWxlbWVudChlbDogYW55KTogZWwgaXMgSlNYLkVsZW1lbnQgewogICAgICAgIHJldHVybiBlbC5tYXJrQXNDaGlsZE9mUm9vdEVsZW1lbnQgIT09IHVuZGVmaW5lZDsKICAgIH0KCiAgICBleHBvcnQgZnVuY3Rpb24gY3JlYXRlRWxlbWVudChhcmdzOiBhbnlbXSkgewoKICAgICAgICByZXR1cm4gewogICAgICAgIH0KICAgIH0KfQoKZXhwb3J0IGxldCBjcmVhdGVFbGVtZW50ID0gRWxlbWVudC5jcmVhdGVFbGVtZW50OwoKZnVuY3Rpb24gdG9DYW1lbENhc2UodGV4dDogc3RyaW5nKTogc3RyaW5nIHsKICAgIHJldHVybiB0ZXh0WzBdLnRvTG93ZXJDYXNlKCkgKyB0ZXh0LnN1YnN0cmluZygxKTsKfQo= //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;YAClC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;SAC9B,CAAC;IAAA,CACF;CACD"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50XzEuRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgPG1ldGEgY29udGVudD0iaGVsbG93b3JsZCI+PC9tZXRhPiwNCiAgICAgICAgICAgIDxtZXRhIGNvbnRlbnQ9e2MuYS5ifT48L21ldGE+DQogICAgICAgIF07DQogICAgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBQ25DLElBQUksYUFBYSxHQUFHLGlCQUFPLENBQUMsYUFBYSxDQUFDO0FBQzFDLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsRUFBRSxJQUFJLENBQUM7WUFDbEMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztTQUM5QixDQUFDO0lBQUEsQ0FDRjtDQUNEIn0=,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50LmNyZWF0ZUVsZW1lbnQ7CmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0K +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IAAA,CACF;CACD"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50XzEuRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogImhlbGxvd29ybGQiIH0pLA0KICAgICAgICAgICAgY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogYy5hLmIgfSkNCiAgICAgICAgXTsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBQ25DLElBQUksYUFBYSxHQUFHLGlCQUFPLENBQUMsYUFBYSxDQUFDO0FBQzFDLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLHdCQUFNLE9BQU8sRUFBQyxZQUFZLEdBQVE7WUFDbEMsd0JBQU0sT0FBTyxFQUFFLENBQUMsQ0FBQyxDQUFFLENBQUMsQ0FBQyxHQUFTO1NBQzlCLENBQUM7SUFBQSxDQUNGO0NBQ0QifQ==,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50LmNyZWF0ZUVsZW1lbnQ7CmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0K diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map.diff index da2444d8bb..6b082f0446 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map.diff @@ -10,5 +10,5 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI;QACH,OAAO;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50XzEuRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogImhlbGxvd29ybGQiIH0pLA0KICAgICAgICAgICAgY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogYy5hLmIgfSkNCiAgICAgICAgXTsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBQ25DLElBQUksYUFBYSxHQUFHLGlCQUFPLENBQUMsYUFBYSxDQUFDO0FBQzFDLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSTtRQUNILE9BQU87WUFDTix3QkFBTSxPQUFPLEVBQUMsWUFBWSxHQUFRO1lBQ2xDLHdCQUFNLE9BQU8sRUFBRSxDQUFDLENBQUMsQ0FBRSxDQUFDLENBQUMsR0FBUztTQUM5QixDQUFDO0lBQ0gsQ0FBQztDQUNEIn0=,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50LmNyZWF0ZUVsZW1lbnQ7CmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0K -+{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;YAClC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;SAC9B,CAAC;IAAA,CACF;CACD"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50XzEuRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgPG1ldGEgY29udGVudD0iaGVsbG93b3JsZCI+PC9tZXRhPiwNCiAgICAgICAgICAgIDxtZXRhIGNvbnRlbnQ9e2MuYS5ifT48L21ldGE+DQogICAgICAgIF07DQogICAgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBQ25DLElBQUksYUFBYSxHQUFHLGlCQUFPLENBQUMsYUFBYSxDQUFDO0FBQzFDLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsRUFBRSxJQUFJLENBQUM7WUFDbEMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztTQUM5QixDQUFDO0lBQUEsQ0FDRjtDQUNEIn0=,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50LmNyZWF0ZUVsZW1lbnQ7CmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0K \ No newline at end of file ++{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IAAA,CACF;CACD"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50XzEuRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogImhlbGxvd29ybGQiIH0pLA0KICAgICAgICAgICAgY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogYy5hLmIgfSkNCiAgICAgICAgXTsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBQ25DLElBQUksYUFBYSxHQUFHLGlCQUFPLENBQUMsYUFBYSxDQUFDO0FBQzFDLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLHdCQUFNLE9BQU8sRUFBQyxZQUFZLEdBQVE7WUFDbEMsd0JBQU0sT0FBTyxFQUFFLENBQUMsQ0FBQyxDQUFFLENBQUMsQ0FBQyxHQUFTO1NBQzlCLENBQUM7SUFBQSxDQUNGO0NBQ0QifQ==,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKbGV0IGNyZWF0ZUVsZW1lbnQgPSBFbGVtZW50LmNyZWF0ZUVsZW1lbnQ7CmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0K \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt index bc044d0d23..9eef1daf50 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt @@ -463,102 +463,66 @@ sourceFile:test.tsx >>> return [ 1->^^^^^^^^ 2 > ^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->{ > 2 > return 1->Emitted(8, 9) Source(11, 3) + SourceIndex(0) 2 >Emitted(8, 16) Source(11, 10) + SourceIndex(0) --- ->>> , +>>> createElement("meta", { content: "helloworld" }), 1->^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^ -6 > ^ -7 > ^^^^^^^^^^^^ -8 > ^ -9 > ^^ -10> ^^^^ -11> ^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^^ 1->[ > -2 > < -3 > meta -4 > -5 > content -6 > = -7 > "helloworld" -8 > > -9 > meta -11> > +2 > content +4 > = +5 > "helloworld" +6 > > 1->Emitted(9, 13) Source(12, 4) + SourceIndex(0) -2 >Emitted(9, 14) Source(12, 5) + SourceIndex(0) -3 >Emitted(9, 18) Source(12, 9) + SourceIndex(0) -4 >Emitted(9, 19) Source(12, 10) + SourceIndex(0) -5 >Emitted(9, 26) Source(12, 17) + SourceIndex(0) -6 >Emitted(9, 27) Source(12, 18) + SourceIndex(0) -7 >Emitted(9, 39) Source(12, 30) + SourceIndex(0) -8 >Emitted(9, 40) Source(12, 31) + SourceIndex(0) -9 >Emitted(9, 42) Source(12, 33) + SourceIndex(0) -10>Emitted(9, 46) Source(12, 37) + SourceIndex(0) -11>Emitted(9, 47) Source(12, 38) + SourceIndex(0) +2 >Emitted(9, 37) Source(12, 10) + SourceIndex(0) +3 >Emitted(9, 44) Source(12, 17) + SourceIndex(0) +4 >Emitted(9, 46) Source(12, 18) + SourceIndex(0) +5 >Emitted(9, 58) Source(12, 30) + SourceIndex(0) +6 >Emitted(9, 61) Source(12, 38) + SourceIndex(0) --- ->>> +>>> createElement("meta", { content: c.a.b }) 1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^ -6 > ^ -7 > ^ -8 > ^ -9 > ^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^^ -16> ^^^^ -17> ^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ 1 >, > -2 > < -3 > meta -4 > -5 > content -6 > = -7 > { -8 > c -9 > . -10> a! -11> . -12> b -13> } -14> > -15> meta -17> > +2 > content +4 > ={ +5 > c +6 > . +7 > a! +8 > . +9 > b +10> }> 1 >Emitted(10, 13) Source(13, 4) + SourceIndex(0) -2 >Emitted(10, 14) Source(13, 5) + SourceIndex(0) -3 >Emitted(10, 18) Source(13, 9) + SourceIndex(0) -4 >Emitted(10, 19) Source(13, 10) + SourceIndex(0) -5 >Emitted(10, 26) Source(13, 17) + SourceIndex(0) -6 >Emitted(10, 27) Source(13, 18) + SourceIndex(0) -7 >Emitted(10, 28) Source(13, 19) + SourceIndex(0) -8 >Emitted(10, 29) Source(13, 20) + SourceIndex(0) -9 >Emitted(10, 30) Source(13, 21) + SourceIndex(0) -10>Emitted(10, 31) Source(13, 23) + SourceIndex(0) -11>Emitted(10, 32) Source(13, 24) + SourceIndex(0) -12>Emitted(10, 33) Source(13, 25) + SourceIndex(0) -13>Emitted(10, 34) Source(13, 26) + SourceIndex(0) -14>Emitted(10, 35) Source(13, 27) + SourceIndex(0) -15>Emitted(10, 37) Source(13, 29) + SourceIndex(0) -16>Emitted(10, 41) Source(13, 33) + SourceIndex(0) -17>Emitted(10, 42) Source(13, 34) + SourceIndex(0) +2 >Emitted(10, 37) Source(13, 10) + SourceIndex(0) +3 >Emitted(10, 44) Source(13, 17) + SourceIndex(0) +4 >Emitted(10, 46) Source(13, 19) + SourceIndex(0) +5 >Emitted(10, 47) Source(13, 20) + SourceIndex(0) +6 >Emitted(10, 48) Source(13, 21) + SourceIndex(0) +7 >Emitted(10, 49) Source(13, 23) + SourceIndex(0) +8 >Emitted(10, 50) Source(13, 24) + SourceIndex(0) +9 >Emitted(10, 51) Source(13, 25) + SourceIndex(0) +10>Emitted(10, 54) Source(13, 34) + SourceIndex(0) --- >>> ]; 1 >^^^^^^^^^ diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt.diff index 965821389a..ba9303e65a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt.diff @@ -326,152 +326,13 @@ >>> return [ 1->^^^^^^^^ 2 > ^^^^^^^ --3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> + 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1->() { -+3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->{ > 2 > return 1->Emitted(8, 9) Source(11, 3) + SourceIndex(0) - 2 >Emitted(8, 16) Source(11, 10) + SourceIndex(0) - --- -->>> createElement("meta", { content: "helloworld" }), -+>>> , - 1->^^^^^^^^^^^^ --2 > ^^^^^^^^^^^^^^^^^^^^^^^^ --3 > ^^^^^^^ --4 > ^^ --5 > ^^^^^^^^^^^^ --6 > ^^^ -+2 > ^ -+3 > ^^^^ -+4 > ^ -+5 > ^^^^^^^ -+6 > ^ -+7 > ^^^^^^^^^^^^ -+8 > ^ -+9 > ^^ -+10> ^^^^ -+11> ^ - 1->[ - > --2 > content --4 > = --5 > "helloworld" --6 > > -+2 > < -+3 > meta -+4 > -+5 > content -+6 > = -+7 > "helloworld" -+8 > > -+9 > meta -+11> > - 1->Emitted(9, 13) Source(12, 4) + SourceIndex(0) --2 >Emitted(9, 37) Source(12, 10) + SourceIndex(0) --3 >Emitted(9, 44) Source(12, 17) + SourceIndex(0) --4 >Emitted(9, 46) Source(12, 18) + SourceIndex(0) --5 >Emitted(9, 58) Source(12, 30) + SourceIndex(0) --6 >Emitted(9, 61) Source(12, 38) + SourceIndex(0) -+2 >Emitted(9, 14) Source(12, 5) + SourceIndex(0) -+3 >Emitted(9, 18) Source(12, 9) + SourceIndex(0) -+4 >Emitted(9, 19) Source(12, 10) + SourceIndex(0) -+5 >Emitted(9, 26) Source(12, 17) + SourceIndex(0) -+6 >Emitted(9, 27) Source(12, 18) + SourceIndex(0) -+7 >Emitted(9, 39) Source(12, 30) + SourceIndex(0) -+8 >Emitted(9, 40) Source(12, 31) + SourceIndex(0) -+9 >Emitted(9, 42) Source(12, 33) + SourceIndex(0) -+10>Emitted(9, 46) Source(12, 37) + SourceIndex(0) -+11>Emitted(9, 47) Source(12, 38) + SourceIndex(0) - --- -->>> createElement("meta", { content: c.a.b }) -+>>> - 1 >^^^^^^^^^^^^ --2 > ^^^^^^^^^^^^^^^^^^^^^^^^ --3 > ^^^^^^^ --4 > ^^ --5 > ^ --6 > ^ --7 > ^ --8 > ^ --9 > ^ --10> ^^^ -+2 > ^ -+3 > ^^^^ -+4 > ^ -+5 > ^^^^^^^ -+6 > ^ -+7 > ^ -+8 > ^ -+9 > ^ -+10> ^ -+11> ^ -+12> ^ -+13> ^ -+14> ^ -+15> ^^ -+16> ^^^^ -+17> ^ - 1 >, - > --2 > content --4 > ={ --5 > c --6 > . --7 > a! --8 > . --9 > b --10> }> -+2 > < -+3 > meta -+4 > -+5 > content -+6 > = -+7 > { -+8 > c -+9 > . -+10> a! -+11> . -+12> b -+13> } -+14> > -+15> meta -+17> > - 1 >Emitted(10, 13) Source(13, 4) + SourceIndex(0) --2 >Emitted(10, 37) Source(13, 10) + SourceIndex(0) --3 >Emitted(10, 44) Source(13, 17) + SourceIndex(0) --4 >Emitted(10, 46) Source(13, 19) + SourceIndex(0) --5 >Emitted(10, 47) Source(13, 20) + SourceIndex(0) --6 >Emitted(10, 48) Source(13, 21) + SourceIndex(0) --7 >Emitted(10, 49) Source(13, 23) + SourceIndex(0) --8 >Emitted(10, 50) Source(13, 24) + SourceIndex(0) --9 >Emitted(10, 51) Source(13, 25) + SourceIndex(0) --10>Emitted(10, 54) Source(13, 34) + SourceIndex(0) -+2 >Emitted(10, 14) Source(13, 5) + SourceIndex(0) -+3 >Emitted(10, 18) Source(13, 9) + SourceIndex(0) -+4 >Emitted(10, 19) Source(13, 10) + SourceIndex(0) -+5 >Emitted(10, 26) Source(13, 17) + SourceIndex(0) -+6 >Emitted(10, 27) Source(13, 18) + SourceIndex(0) -+7 >Emitted(10, 28) Source(13, 19) + SourceIndex(0) -+8 >Emitted(10, 29) Source(13, 20) + SourceIndex(0) -+9 >Emitted(10, 30) Source(13, 21) + SourceIndex(0) -+10>Emitted(10, 31) Source(13, 23) + SourceIndex(0) -+11>Emitted(10, 32) Source(13, 24) + SourceIndex(0) -+12>Emitted(10, 33) Source(13, 25) + SourceIndex(0) -+13>Emitted(10, 34) Source(13, 26) + SourceIndex(0) -+14>Emitted(10, 35) Source(13, 27) + SourceIndex(0) -+15>Emitted(10, 37) Source(13, 29) + SourceIndex(0) -+16>Emitted(10, 41) Source(13, 33) + SourceIndex(0) -+17>Emitted(10, 42) Source(13, 34) + SourceIndex(0) - --- - >>> ]; - 1 >^^^^^^^^^ -@@= skipped -84, +123 lines =@@ +@@= skipped -84, +87 lines =@@ 1 >^^^^ 2 > ^ 1 > diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js index 623448cd3a..75a062bf6c 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js @@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppComponent = void 0; class AppComponent { render(createElement) { - return
; + return createElement("div", null); } } exports.AppComponent = AppComponent; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.diff deleted file mode 100644 index f621dfd831..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.jsxFactoryIdentifierAsParameter.js -+++ new.jsxFactoryIdentifierAsParameter.js -@@= skipped -19, +19 lines =@@ - exports.AppComponent = void 0; - class AppComponent { - render(createElement) { -- return createElement("div", null); -+ return
; - } - } - exports.AppComponent = AppComponent; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map index 31b4941584..908cb637e1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map @@ -1,3 +1,3 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,AAAD,EAAG,CAAC;IAAA,CAClB;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gPGRpdiAvPjsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLENBQUMsR0FBRyxDQUFDLEFBQUQsRUFBRyxDQUFDO0lBQUEsQ0FDbEI7Q0FDSiJ9,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9Cg== +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,0BAAO,CAAC;IAAA,CAClB;CACJ"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gY3JlYXRlRWxlbWVudCgiZGl2IiwgbnVsbCk7DQogICAgfQ0KfQ0KZXhwb3J0cy5BcHBDb21wb25lbnQgPSBBcHBDb21wb25lbnQ7DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLDBCQUFPLENBQUM7SUFBQSxDQUNsQjtDQUNKIn0=,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9Cg== diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map.diff index ee83af3831..20eebd306b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.js.map.diff @@ -4,5 +4,5 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA,MAAa,YAAY;IACrB,MAAM,CAAC,aAAa;QAChB,OAAO,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gY3JlYXRlRWxlbWVudCgiZGl2IiwgbnVsbCk7DQogICAgfQ0KfQ0KZXhwb3J0cy5BcHBDb21wb25lbnQgPSBBcHBDb21wb25lbnQ7DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BLE1BQWEsWUFBWTtJQUNyQixNQUFNLENBQUMsYUFBYTtRQUNoQixPQUFPLDBCQUFPLENBQUM7SUFDbkIsQ0FBQztDQUNKO0FBSkQsb0NBSUMifQ==,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9Cg== -+{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,AAAD,EAAG,CAAC;IAAA,CAClB;CACJ"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gPGRpdiAvPjsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLENBQUMsR0FBRyxDQUFDLEFBQUQsRUFBRyxDQUFDO0lBQUEsQ0FDbEI7Q0FDSiJ9,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9Cg== \ No newline at end of file ++{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,0BAAO,CAAC;IAAA,CAClB;CACJ"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gY3JlYXRlRWxlbWVudCgiZGl2IiwgbnVsbCk7DQogICAgfQ0KfQ0KZXhwb3J0cy5BcHBDb21wb25lbnQgPSBBcHBDb21wb25lbnQ7DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLDBCQUFPLENBQUM7SUFBQSxDQUNsQjtDQUNKIn0=,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9Cg== \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt index c7c0ff566c..1a2a18a05b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt @@ -29,6 +29,7 @@ sourceFile:test.tsx 3 > ^ 4 > ^^^^^^^^^^^^^ 5 > ^^ +6 > ^^^^^^^^^^^^^^^^^-> 1->export class AppComponent { > 2 > render @@ -41,32 +42,20 @@ sourceFile:test.tsx 4 >Emitted(5, 25) Source(8, 25) + SourceIndex(0) 5 >Emitted(5, 27) Source(8, 27) + SourceIndex(0) --- ->>> return
; -1 >^^^^^^^^ +>>> return createElement("div", null); +1->^^^^^^^^ 2 > ^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > -7 > ^^ -8 > ^ -1 >{ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ +1->{ > 2 > return -3 > < -4 > div -5 > -6 > -7 > /> -8 > ; -1 >Emitted(6, 9) Source(9, 9) + SourceIndex(0) +3 >
+4 > ; +1->Emitted(6, 9) Source(9, 9) + SourceIndex(0) 2 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) -3 >Emitted(6, 17) Source(9, 17) + SourceIndex(0) -4 >Emitted(6, 20) Source(9, 20) + SourceIndex(0) -5 >Emitted(6, 21) Source(9, 21) + SourceIndex(0) -6 >Emitted(6, 21) Source(9, 20) + SourceIndex(0) -7 >Emitted(6, 23) Source(9, 23) + SourceIndex(0) -8 >Emitted(6, 24) Source(9, 24) + SourceIndex(0) +3 >Emitted(6, 42) Source(9, 23) + SourceIndex(0) +4 >Emitted(6, 43) Source(9, 24) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt.diff index 3f967a1f64..cb1ecd68bb 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierAsParameter.sourcemap.txt.diff @@ -29,6 +29,7 @@ -5 > ^^^^^^^^^^^^^^^^^^^-> -1-> { +5 > ^^ ++6 > ^^^^^^^^^^^^^^^^^-> +1->export class AppComponent { > 2 > render @@ -41,44 +42,17 @@ 4 >Emitted(5, 25) Source(8, 25) + SourceIndex(0) +5 >Emitted(5, 27) Source(8, 27) + SourceIndex(0) --- -->>> return createElement("div", null); --1->^^^^^^^^ -+>>> return
; -+1 >^^^^^^^^ + >>> return createElement("div", null); + 1->^^^^^^^^ 2 > ^^^^^^^ --3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ --4 > ^ + 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ + 4 > ^ -1->) { -+3 > ^ -+4 > ^^^ -+5 > ^ -+6 > -+7 > ^^ -+8 > ^ -+1 >{ ++1->{ > 2 > return --3 >
--4 > ; --1->Emitted(6, 9) Source(9, 9) + SourceIndex(0) -+3 > < -+4 > div -+5 > -+6 > -+7 > /> -+8 > ; -+1 >Emitted(6, 9) Source(9, 9) + SourceIndex(0) - 2 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) --3 >Emitted(6, 42) Source(9, 23) + SourceIndex(0) --4 >Emitted(6, 43) Source(9, 24) + SourceIndex(0) -+3 >Emitted(6, 17) Source(9, 17) + SourceIndex(0) -+4 >Emitted(6, 20) Source(9, 20) + SourceIndex(0) -+5 >Emitted(6, 21) Source(9, 21) + SourceIndex(0) -+6 >Emitted(6, 21) Source(9, 20) + SourceIndex(0) -+7 >Emitted(6, 23) Source(9, 23) + SourceIndex(0) -+8 >Emitted(6, 24) Source(9, 24) + SourceIndex(0) - --- - >>> } + 3 >
+@@= skipped -41, +40 lines =@@ 1 >^^^^ 2 > ^ 1 > @@ -91,7 +65,7 @@ 2 >Emitted(7, 6) Source(10, 6) + SourceIndex(0) --- >>>} -@@= skipped -54, +64 lines =@@ +@@= skipped -13, +13 lines =@@ 1 >Emitted(8, 2) Source(11, 2) + SourceIndex(0) --- >>>exports.AppComponent = AppComponent; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js index e4588316e2..552ad4338a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js @@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppComponent = void 0; class AppComponent { render() { - return
; + return createElement("div", null); } } exports.AppComponent = AppComponent; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.diff deleted file mode 100644 index 5a0ad7d2e4..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.jsxFactoryIdentifierWithAbsentParameter.js -+++ new.jsxFactoryIdentifierWithAbsentParameter.js -@@= skipped -19, +19 lines =@@ - exports.AppComponent = void 0; - class AppComponent { - render() { -- return createElement("div", null); -+ return
; - } - } - exports.AppComponent = AppComponent; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map index 1e807814e2..0cd80cedfe 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map @@ -1,3 +1,3 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,GAAG;QACL,OAAO,CAAC,GAAG,CAAC,AAAD,EAAG,CAAC;IAAA,CAClB;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoKSB7DQogICAgICAgIHJldHVybiA8ZGl2IC8+Ow0KICAgIH0NCn0NCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gQXBwQ29tcG9uZW50Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxHQUFHO1FBQ0wsT0FBTyxDQUFDLEdBQUcsQ0FBQyxBQUFELEVBQUcsQ0FBQztJQUFBLENBQ2xCO0NBQ0oifQ==,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoKSB7CiAgICAgICAgcmV0dXJuIDxkaXYgLz47CiAgICB9Cn0K +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,GAAG;QACL,OAAO,0BAAO,CAAC;IAAA,CAClB;CACJ"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoKSB7DQogICAgICAgIHJldHVybiBjcmVhdGVFbGVtZW50KCJkaXYiLCBudWxsKTsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxHQUFHO1FBQ0wsT0FBTywwQkFBTyxDQUFDO0lBQUEsQ0FDbEI7Q0FDSiJ9,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoKSB7CiAgICAgICAgcmV0dXJuIDxkaXYgLz47CiAgICB9Cn0K diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map.diff index 006e58e192..5fd8ae847f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.js.map.diff @@ -4,5 +4,5 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA,MAAa,YAAY;IACrB,MAAM;QACF,OAAO,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoKSB7DQogICAgICAgIHJldHVybiBjcmVhdGVFbGVtZW50KCJkaXYiLCBudWxsKTsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BLE1BQWEsWUFBWTtJQUNyQixNQUFNO1FBQ0YsT0FBTywwQkFBTyxDQUFDO0lBQ25CLENBQUM7Q0FDSjtBQUpELG9DQUlDIn0=,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoKSB7CiAgICAgICAgcmV0dXJuIDxkaXYgLz47CiAgICB9Cn0K -+{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,GAAG;QACL,OAAO,CAAC,GAAG,CAAC,AAAD,EAAG,CAAC;IAAA,CAClB;CACJ"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoKSB7DQogICAgICAgIHJldHVybiA8ZGl2IC8+Ow0KICAgIH0NCn0NCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gQXBwQ29tcG9uZW50Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxHQUFHO1FBQ0wsT0FBTyxDQUFDLEdBQUcsQ0FBQyxBQUFELEVBQUcsQ0FBQztJQUFBLENBQ2xCO0NBQ0oifQ==,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoKSB7CiAgICAgICAgcmV0dXJuIDxkaXYgLz47CiAgICB9Cn0K \ No newline at end of file ++{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,GAAG;QACL,OAAO,0BAAO,CAAC;IAAA,CAClB;CACJ"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoKSB7DQogICAgICAgIHJldHVybiBjcmVhdGVFbGVtZW50KCJkaXYiLCBudWxsKTsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxHQUFHO1FBQ0wsT0FBTywwQkFBTyxDQUFDO0lBQUEsQ0FDbEI7Q0FDSiJ9,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoKSB7CiAgICAgICAgcmV0dXJuIDxkaXYgLz47CiAgICB9Cn0K \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt index 711f8b0d7d..9243a828d6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt @@ -27,7 +27,7 @@ sourceFile:test.tsx 1->^^^^ 2 > ^^^^^^ 3 > ^^^ -4 > ^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class AppComponent { > 2 > render @@ -36,32 +36,20 @@ sourceFile:test.tsx 2 >Emitted(5, 11) Source(8, 11) + SourceIndex(0) 3 >Emitted(5, 14) Source(8, 14) + SourceIndex(0) --- ->>> return
; +>>> return createElement("div", null); 1->^^^^^^^^ 2 > ^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > -7 > ^^ -8 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ 1->{ > 2 > return -3 > < -4 > div -5 > -6 > -7 > /> -8 > ; +3 >
+4 > ; 1->Emitted(6, 9) Source(9, 9) + SourceIndex(0) 2 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) -3 >Emitted(6, 17) Source(9, 17) + SourceIndex(0) -4 >Emitted(6, 20) Source(9, 20) + SourceIndex(0) -5 >Emitted(6, 21) Source(9, 21) + SourceIndex(0) -6 >Emitted(6, 21) Source(9, 20) + SourceIndex(0) -7 >Emitted(6, 23) Source(9, 23) + SourceIndex(0) -8 >Emitted(6, 24) Source(9, 24) + SourceIndex(0) +3 >Emitted(6, 42) Source(9, 23) + SourceIndex(0) +4 >Emitted(6, 43) Source(9, 24) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt.diff index 5c9306f662..cc0b06435d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt.diff @@ -27,7 +27,7 @@ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > { +3 > ^^^ -+4 > ^^^^^^^^^^^-> ++4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->export class AppComponent { > 2 > render @@ -37,42 +37,17 @@ 2 >Emitted(5, 11) Source(8, 11) + SourceIndex(0) +3 >Emitted(5, 14) Source(8, 14) + SourceIndex(0) --- -->>> return createElement("div", null); -+>>> return
; + >>> return createElement("div", null); 1->^^^^^^^^ 2 > ^^^^^^^ --3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ --4 > ^ + 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ + 4 > ^ -1->() { -+3 > ^ -+4 > ^^^ -+5 > ^ -+6 > -+7 > ^^ -+8 > ^ +1->{ > 2 > return --3 >
--4 > ; -+3 > < -+4 > div -+5 > -+6 > -+7 > /> -+8 > ; - 1->Emitted(6, 9) Source(9, 9) + SourceIndex(0) - 2 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) --3 >Emitted(6, 42) Source(9, 23) + SourceIndex(0) --4 >Emitted(6, 43) Source(9, 24) + SourceIndex(0) -+3 >Emitted(6, 17) Source(9, 17) + SourceIndex(0) -+4 >Emitted(6, 20) Source(9, 20) + SourceIndex(0) -+5 >Emitted(6, 21) Source(9, 21) + SourceIndex(0) -+6 >Emitted(6, 21) Source(9, 20) + SourceIndex(0) -+7 >Emitted(6, 23) Source(9, 23) + SourceIndex(0) -+8 >Emitted(6, 24) Source(9, 24) + SourceIndex(0) - --- - >>> } + 3 >
+@@= skipped -35, +34 lines =@@ 1 >^^^^ 2 > ^ 1 > @@ -85,7 +60,7 @@ 2 >Emitted(7, 6) Source(10, 6) + SourceIndex(0) --- >>>} -@@= skipped -48, +59 lines =@@ +@@= skipped -13, +13 lines =@@ 1 >Emitted(8, 2) Source(11, 2) + SourceIndex(0) --- >>>exports.AppComponent = AppComponent; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js index 876353220a..38dce2886a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js @@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.C = void 0; class C { factory() { - return
; + return factory.createElement("div", null); } } exports.C = C; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js.diff deleted file mode 100644 index 533d19e78b..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryMissingErrorInsideAClass.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.jsxFactoryMissingErrorInsideAClass.js -+++ new.jsxFactoryMissingErrorInsideAClass.js -@@= skipped -13, +13 lines =@@ - exports.C = void 0; - class C { - factory() { -- return factory.createElement("div", null); -+ return
; - } - } - exports.C = C; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js index 8733e44fba..4a8c53383b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js @@ -75,8 +75,8 @@ let c; class A { view() { return [ - , - + React.createElement("meta", { content: "helloworld" }), + React.createElement("meta", { content: c.a.b }) ]; } } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js.diff deleted file mode 100644 index 6978fdeb01..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.jsxFactoryNotIdentifierOrQualifiedName.js -+++ new.jsxFactoryNotIdentifierOrQualifiedName.js -@@= skipped -74, +74 lines =@@ - class A { - view() { - return [ -- React.createElement("meta", { content: "helloworld" }), -- React.createElement("meta", { content: c.a.b }) -+ , -+ - ]; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js index 770192ce1d..6d7e2781b8 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js @@ -75,8 +75,8 @@ let c; class A { view() { return [ - , - + React.createElement("meta", { content: "helloworld" }), + React.createElement("meta", { content: c.a.b }) ]; } } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js.diff deleted file mode 100644 index e4eaa28230..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryNotIdentifierOrQualifiedName2.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.jsxFactoryNotIdentifierOrQualifiedName2.js -+++ new.jsxFactoryNotIdentifierOrQualifiedName2.js -@@= skipped -74, +74 lines =@@ - class A { - view() { - return [ -- React.createElement("meta", { content: "helloworld" }), -- React.createElement("meta", { content: c.a.b }) -+ , -+ - ]; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js index eb6001ce91..a8248a7df1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js @@ -77,8 +77,8 @@ let c; class A { view() { return [ - , - + Element_1.Element.createElement("meta", { content: "helloworld" }), + Element_1.Element.createElement("meta", { content: c.a.b }) ]; } } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.diff deleted file mode 100644 index 88fa85cd3a..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.jsxFactoryQualifiedName.js -+++ new.jsxFactoryQualifiedName.js -@@= skipped -76, +76 lines =@@ - class A { - view() { - return [ -- Element_1.Element.createElement("meta", { content: "helloworld" }), -- Element_1.Element.createElement("meta", { content: c.a.b }) -+ , -+ - ]; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map index 367010ab84..c265dc473f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map @@ -3,5 +3,5 @@ //// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuY3JlYXRlRWxlbWVudCA9IGV4cG9ydHMuRWxlbWVudCA9IHZvaWQgMDsNCnZhciBFbGVtZW50Ow0KKGZ1bmN0aW9uIChFbGVtZW50KSB7DQogICAgZnVuY3Rpb24gaXNFbGVtZW50KGVsKSB7DQogICAgICAgIHJldHVybiBlbC5tYXJrQXNDaGlsZE9mUm9vdEVsZW1lbnQgIT09IHVuZGVmaW5lZDsNCiAgICB9DQogICAgRWxlbWVudC5pc0VsZW1lbnQgPSBpc0VsZW1lbnQ7DQogICAgZnVuY3Rpb24gY3JlYXRlRWxlbWVudChhcmdzKSB7DQogICAgICAgIHJldHVybiB7fTsNCiAgICB9DQogICAgRWxlbWVudC5jcmVhdGVFbGVtZW50ID0gY3JlYXRlRWxlbWVudDsNCn0pKEVsZW1lbnQgfHwgKGV4cG9ydHMuRWxlbWVudCA9IEVsZW1lbnQgPSB7fSkpOw0KZXhwb3J0cy5jcmVhdGVFbGVtZW50ID0gRWxlbWVudC5jcmVhdGVFbGVtZW50Ow0KZnVuY3Rpb24gdG9DYW1lbENhc2UodGV4dCkgew0KICAgIHJldHVybiB0ZXh0WzBdLnRvTG93ZXJDYXNlKCkgKyB0ZXh0LnN1YnN0cmluZygxKTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVsZW1lbnQuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRWxlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBWUEsSUFBaUIsT0FVaEI7QUFWRCxXQUFpQixPQUFPLEVBQUM7SUFDckIsU0FBZ0IsU0FBUyxDQUFDLEVBQU8sRUFBcUI7UUFDbEQsT0FBTyxFQUFFLENBQUMsd0JBQXdCLEtBQUssU0FBUyxDQUFDO0lBQUEsQ0FDcEQ7SUFGZSxRQUFBLFNBQVMsWUFFeEIsQ0FBQTtJQUVELFNBQWdCLGFBQWEsQ0FBQyxJQUFXLEVBQUU7UUFFdkMsT0FBTyxFQUNOLENBQUE7SUFBQSxDQUNKO0lBSmUsUUFBQSxhQUFhLGdCQUk1QixDQUFBO0FBQUEsQ0FDSixFQVZnQixPQUFPLGFBQVAsT0FBTyxHQUFQLE9BQU8sUUFVdkI7QUFFVSxRQUFBLGFBQWEsR0FBRyxPQUFPLENBQUMsYUFBYSxDQUFDO0FBRWpELFNBQVMsV0FBVyxDQUFDLElBQVksRUFBVTtJQUN2QyxPQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxXQUFXLEVBQUUsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQUEsQ0FDcEQifQ==,ZGVjbGFyZSBuYW1lc3BhY2UgSlNYIHsKICAgIGludGVyZmFjZSBFbGVtZW50IHsKICAgICAgICBuYW1lOiBzdHJpbmc7CiAgICAgICAgaXNJbnRyaW5zaWM6IGJvb2xlYW47CiAgICAgICAgaXNDdXN0b21FbGVtZW50OiBib29sZWFuOwogICAgICAgIHRvU3RyaW5nKHJlbmRlcklkPzogbnVtYmVyKTogc3RyaW5nOwogICAgICAgIGJpbmRET00ocmVuZGVySWQ/OiBudW1iZXIpOiBudW1iZXI7CiAgICAgICAgcmVzZXRDb21wb25lbnQoKTogdm9pZDsKICAgICAgICBpbnN0YW50aWF0ZUNvbXBvbmVudHMocmVuZGVySWQ/OiBudW1iZXIpOiBudW1iZXI7CiAgICAgICAgcHJvcHM6IGFueTsKICAgIH0KfQpleHBvcnQgbmFtZXNwYWNlIEVsZW1lbnQgewogICAgZXhwb3J0IGZ1bmN0aW9uIGlzRWxlbWVudChlbDogYW55KTogZWwgaXMgSlNYLkVsZW1lbnQgewogICAgICAgIHJldHVybiBlbC5tYXJrQXNDaGlsZE9mUm9vdEVsZW1lbnQgIT09IHVuZGVmaW5lZDsKICAgIH0KCiAgICBleHBvcnQgZnVuY3Rpb24gY3JlYXRlRWxlbWVudChhcmdzOiBhbnlbXSkgewoKICAgICAgICByZXR1cm4gewogICAgICAgIH0KICAgIH0KfQoKZXhwb3J0IGxldCBjcmVhdGVFbGVtZW50ID0gRWxlbWVudC5jcmVhdGVFbGVtZW50OwoKZnVuY3Rpb24gdG9DYW1lbENhc2UodGV4dDogc3RyaW5nKTogc3RyaW5nIHsKICAgIHJldHVybiB0ZXh0WzBdLnRvTG93ZXJDYXNlKCkgKyB0ZXh0LnN1YnN0cmluZygxKTsKfQo= //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;YAClC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;SAC9B,CAAC;IAAA,CACF;CACD"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgPG1ldGEgY29udGVudD0iaGVsbG93b3JsZCI+PC9tZXRhPiwNCiAgICAgICAgICAgIDxtZXRhIGNvbnRlbnQ9e2MuYS5ifT48L21ldGE+DQogICAgICAgIF07DQogICAgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBRW5DLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsRUFBRSxJQUFJLENBQUM7WUFDbEMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztTQUM5QixDQUFDO0lBQUEsQ0FDRjtDQUNEIn0=,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKCmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0= +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,0CAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,0CAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IAAA,CACF;CACD"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgRWxlbWVudF8xLkVsZW1lbnQuY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogImhlbGxvd29ybGQiIH0pLA0KICAgICAgICAgICAgRWxlbWVudF8xLkVsZW1lbnQuY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogYy5hLmIgfSkNCiAgICAgICAgXTsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBRW5DLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLDBDQUFNLE9BQU8sRUFBQyxZQUFZLEdBQVE7WUFDbEMsMENBQU0sT0FBTyxFQUFFLENBQUMsQ0FBQyxDQUFFLENBQUMsQ0FBQyxHQUFTO1NBQzlCLENBQUM7SUFBQSxDQUNGO0NBQ0QifQ==,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKCmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0= diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map.diff index 92168912ee..a1cc27bba3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map.diff @@ -10,5 +10,5 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI;QACH,OAAO;YACN,0CAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,0CAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgRWxlbWVudF8xLkVsZW1lbnQuY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogImhlbGxvd29ybGQiIH0pLA0KICAgICAgICAgICAgRWxlbWVudF8xLkVsZW1lbnQuY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogYy5hLmIgfSkNCiAgICAgICAgXTsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBRW5DLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSTtRQUNILE9BQU87WUFDTiwwQ0FBTSxPQUFPLEVBQUMsWUFBWSxHQUFRO1lBQ2xDLDBDQUFNLE9BQU8sRUFBRSxDQUFDLENBQUMsQ0FBRSxDQUFDLENBQUMsR0FBUztTQUM5QixDQUFDO0lBQ0gsQ0FBQztDQUNEIn0=,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKCmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0= -+{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;YAClC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;SAC9B,CAAC;IAAA,CACF;CACD"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgPG1ldGEgY29udGVudD0iaGVsbG93b3JsZCI+PC9tZXRhPiwNCiAgICAgICAgICAgIDxtZXRhIGNvbnRlbnQ9e2MuYS5ifT48L21ldGE+DQogICAgICAgIF07DQogICAgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBRW5DLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsRUFBRSxJQUFJLENBQUM7WUFDbEMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztTQUM5QixDQUFDO0lBQUEsQ0FDRjtDQUNEIn0=,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKCmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0= \ No newline at end of file ++{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF,MAAM,CAAC;IACN,IAAI,GAAG;QACN,OAAO;YACN,0CAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,0CAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IAAA,CACF;CACD"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmNvbnN0IEVsZW1lbnRfMSA9IHJlcXVpcmUoIi4vRWxlbWVudCIpOw0KbGV0IGM7DQpjbGFzcyBBIHsNCiAgICB2aWV3KCkgew0KICAgICAgICByZXR1cm4gWw0KICAgICAgICAgICAgRWxlbWVudF8xLkVsZW1lbnQuY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogImhlbGxvd29ybGQiIH0pLA0KICAgICAgICAgICAgRWxlbWVudF8xLkVsZW1lbnQuY3JlYXRlRWxlbWVudCgibWV0YSIsIHsgY29udGVudDogYy5hLmIgfSkNCiAgICAgICAgXTsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD10ZXN0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQW1DO0FBRW5DLElBQUksQ0FJSCxDQUFDO0FBRUYsTUFBTSxDQUFDO0lBQ04sSUFBSSxHQUFHO1FBQ04sT0FBTztZQUNOLDBDQUFNLE9BQU8sRUFBQyxZQUFZLEdBQVE7WUFDbEMsMENBQU0sT0FBTyxFQUFFLENBQUMsQ0FBQyxDQUFFLENBQUMsQ0FBQyxHQUFTO1NBQzlCLENBQUM7SUFBQSxDQUNGO0NBQ0QifQ==,aW1wb3J0IHsgRWxlbWVudH0gZnJvbSAnLi9FbGVtZW50JzsKCmxldCBjOiB7CglhPzogewoJCWI6IHN0cmluZwoJfQp9OwoKY2xhc3MgQSB7Cgl2aWV3KCkgewoJCXJldHVybiBbCgkJCTxtZXRhIGNvbnRlbnQ9ImhlbGxvd29ybGQiPjwvbWV0YT4sCgkJCTxtZXRhIGNvbnRlbnQ9e2MuYSEuYn0+PC9tZXRhPgoJCV07Cgl9Cn0= \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt index 08c8ce5124..f5ca127f3f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt @@ -436,102 +436,66 @@ sourceFile:test.tsx >>> return [ 1->^^^^^^^^ 2 > ^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->{ > 2 > return 1->Emitted(7, 9) Source(11, 3) + SourceIndex(0) 2 >Emitted(7, 16) Source(11, 10) + SourceIndex(0) --- ->>> , +>>> Element_1.Element.createElement("meta", { content: "helloworld" }), 1->^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^ -6 > ^ -7 > ^^^^^^^^^^^^ -8 > ^ -9 > ^^ -10> ^^^^ -11> ^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^^ 1->[ > -2 > < -3 > meta -4 > -5 > content -6 > = -7 > "helloworld" -8 > > -9 > meta -11> > +2 > content +4 > = +5 > "helloworld" +6 > > 1->Emitted(8, 13) Source(12, 4) + SourceIndex(0) -2 >Emitted(8, 14) Source(12, 5) + SourceIndex(0) -3 >Emitted(8, 18) Source(12, 9) + SourceIndex(0) -4 >Emitted(8, 19) Source(12, 10) + SourceIndex(0) -5 >Emitted(8, 26) Source(12, 17) + SourceIndex(0) -6 >Emitted(8, 27) Source(12, 18) + SourceIndex(0) -7 >Emitted(8, 39) Source(12, 30) + SourceIndex(0) -8 >Emitted(8, 40) Source(12, 31) + SourceIndex(0) -9 >Emitted(8, 42) Source(12, 33) + SourceIndex(0) -10>Emitted(8, 46) Source(12, 37) + SourceIndex(0) -11>Emitted(8, 47) Source(12, 38) + SourceIndex(0) +2 >Emitted(8, 55) Source(12, 10) + SourceIndex(0) +3 >Emitted(8, 62) Source(12, 17) + SourceIndex(0) +4 >Emitted(8, 64) Source(12, 18) + SourceIndex(0) +5 >Emitted(8, 76) Source(12, 30) + SourceIndex(0) +6 >Emitted(8, 79) Source(12, 38) + SourceIndex(0) --- ->>> +>>> Element_1.Element.createElement("meta", { content: c.a.b }) 1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^ -6 > ^ -7 > ^ -8 > ^ -9 > ^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^^ -16> ^^^^ -17> ^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ 1 >, > -2 > < -3 > meta -4 > -5 > content -6 > = -7 > { -8 > c -9 > . -10> a! -11> . -12> b -13> } -14> > -15> meta -17> > +2 > content +4 > ={ +5 > c +6 > . +7 > a! +8 > . +9 > b +10> }> 1 >Emitted(9, 13) Source(13, 4) + SourceIndex(0) -2 >Emitted(9, 14) Source(13, 5) + SourceIndex(0) -3 >Emitted(9, 18) Source(13, 9) + SourceIndex(0) -4 >Emitted(9, 19) Source(13, 10) + SourceIndex(0) -5 >Emitted(9, 26) Source(13, 17) + SourceIndex(0) -6 >Emitted(9, 27) Source(13, 18) + SourceIndex(0) -7 >Emitted(9, 28) Source(13, 19) + SourceIndex(0) -8 >Emitted(9, 29) Source(13, 20) + SourceIndex(0) -9 >Emitted(9, 30) Source(13, 21) + SourceIndex(0) -10>Emitted(9, 31) Source(13, 23) + SourceIndex(0) -11>Emitted(9, 32) Source(13, 24) + SourceIndex(0) -12>Emitted(9, 33) Source(13, 25) + SourceIndex(0) -13>Emitted(9, 34) Source(13, 26) + SourceIndex(0) -14>Emitted(9, 35) Source(13, 27) + SourceIndex(0) -15>Emitted(9, 37) Source(13, 29) + SourceIndex(0) -16>Emitted(9, 41) Source(13, 33) + SourceIndex(0) -17>Emitted(9, 42) Source(13, 34) + SourceIndex(0) +2 >Emitted(9, 55) Source(13, 10) + SourceIndex(0) +3 >Emitted(9, 62) Source(13, 17) + SourceIndex(0) +4 >Emitted(9, 64) Source(13, 19) + SourceIndex(0) +5 >Emitted(9, 65) Source(13, 20) + SourceIndex(0) +6 >Emitted(9, 66) Source(13, 21) + SourceIndex(0) +7 >Emitted(9, 67) Source(13, 23) + SourceIndex(0) +8 >Emitted(9, 68) Source(13, 24) + SourceIndex(0) +9 >Emitted(9, 69) Source(13, 25) + SourceIndex(0) +10>Emitted(9, 72) Source(13, 34) + SourceIndex(0) --- >>> ]; 1 >^^^^^^^^^ diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt.diff index f3dcf28e79..32d8d81db8 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt.diff @@ -326,152 +326,13 @@ >>> return [ 1->^^^^^^^^ 2 > ^^^^^^^ --3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> + 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1->() { -+3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->{ > 2 > return 1->Emitted(7, 9) Source(11, 3) + SourceIndex(0) - 2 >Emitted(7, 16) Source(11, 10) + SourceIndex(0) - --- -->>> Element_1.Element.createElement("meta", { content: "helloworld" }), -+>>> , - 1->^^^^^^^^^^^^ --2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --3 > ^^^^^^^ --4 > ^^ --5 > ^^^^^^^^^^^^ --6 > ^^^ -+2 > ^ -+3 > ^^^^ -+4 > ^ -+5 > ^^^^^^^ -+6 > ^ -+7 > ^^^^^^^^^^^^ -+8 > ^ -+9 > ^^ -+10> ^^^^ -+11> ^ - 1->[ - > --2 > content --4 > = --5 > "helloworld" --6 > > -+2 > < -+3 > meta -+4 > -+5 > content -+6 > = -+7 > "helloworld" -+8 > > -+9 > meta -+11> > - 1->Emitted(8, 13) Source(12, 4) + SourceIndex(0) --2 >Emitted(8, 55) Source(12, 10) + SourceIndex(0) --3 >Emitted(8, 62) Source(12, 17) + SourceIndex(0) --4 >Emitted(8, 64) Source(12, 18) + SourceIndex(0) --5 >Emitted(8, 76) Source(12, 30) + SourceIndex(0) --6 >Emitted(8, 79) Source(12, 38) + SourceIndex(0) -+2 >Emitted(8, 14) Source(12, 5) + SourceIndex(0) -+3 >Emitted(8, 18) Source(12, 9) + SourceIndex(0) -+4 >Emitted(8, 19) Source(12, 10) + SourceIndex(0) -+5 >Emitted(8, 26) Source(12, 17) + SourceIndex(0) -+6 >Emitted(8, 27) Source(12, 18) + SourceIndex(0) -+7 >Emitted(8, 39) Source(12, 30) + SourceIndex(0) -+8 >Emitted(8, 40) Source(12, 31) + SourceIndex(0) -+9 >Emitted(8, 42) Source(12, 33) + SourceIndex(0) -+10>Emitted(8, 46) Source(12, 37) + SourceIndex(0) -+11>Emitted(8, 47) Source(12, 38) + SourceIndex(0) - --- -->>> Element_1.Element.createElement("meta", { content: c.a.b }) -+>>> - 1 >^^^^^^^^^^^^ --2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --3 > ^^^^^^^ --4 > ^^ --5 > ^ --6 > ^ --7 > ^ --8 > ^ --9 > ^ --10> ^^^ -+2 > ^ -+3 > ^^^^ -+4 > ^ -+5 > ^^^^^^^ -+6 > ^ -+7 > ^ -+8 > ^ -+9 > ^ -+10> ^ -+11> ^ -+12> ^ -+13> ^ -+14> ^ -+15> ^^ -+16> ^^^^ -+17> ^ - 1 >, - > --2 > content --4 > ={ --5 > c --6 > . --7 > a! --8 > . --9 > b --10> }> -+2 > < -+3 > meta -+4 > -+5 > content -+6 > = -+7 > { -+8 > c -+9 > . -+10> a! -+11> . -+12> b -+13> } -+14> > -+15> meta -+17> > - 1 >Emitted(9, 13) Source(13, 4) + SourceIndex(0) --2 >Emitted(9, 55) Source(13, 10) + SourceIndex(0) --3 >Emitted(9, 62) Source(13, 17) + SourceIndex(0) --4 >Emitted(9, 64) Source(13, 19) + SourceIndex(0) --5 >Emitted(9, 65) Source(13, 20) + SourceIndex(0) --6 >Emitted(9, 66) Source(13, 21) + SourceIndex(0) --7 >Emitted(9, 67) Source(13, 23) + SourceIndex(0) --8 >Emitted(9, 68) Source(13, 24) + SourceIndex(0) --9 >Emitted(9, 69) Source(13, 25) + SourceIndex(0) --10>Emitted(9, 72) Source(13, 34) + SourceIndex(0) -+2 >Emitted(9, 14) Source(13, 5) + SourceIndex(0) -+3 >Emitted(9, 18) Source(13, 9) + SourceIndex(0) -+4 >Emitted(9, 19) Source(13, 10) + SourceIndex(0) -+5 >Emitted(9, 26) Source(13, 17) + SourceIndex(0) -+6 >Emitted(9, 27) Source(13, 18) + SourceIndex(0) -+7 >Emitted(9, 28) Source(13, 19) + SourceIndex(0) -+8 >Emitted(9, 29) Source(13, 20) + SourceIndex(0) -+9 >Emitted(9, 30) Source(13, 21) + SourceIndex(0) -+10>Emitted(9, 31) Source(13, 23) + SourceIndex(0) -+11>Emitted(9, 32) Source(13, 24) + SourceIndex(0) -+12>Emitted(9, 33) Source(13, 25) + SourceIndex(0) -+13>Emitted(9, 34) Source(13, 26) + SourceIndex(0) -+14>Emitted(9, 35) Source(13, 27) + SourceIndex(0) -+15>Emitted(9, 37) Source(13, 29) + SourceIndex(0) -+16>Emitted(9, 41) Source(13, 33) + SourceIndex(0) -+17>Emitted(9, 42) Source(13, 34) + SourceIndex(0) - --- - >>> ]; - 1 >^^^^^^^^^ -@@= skipped -84, +123 lines =@@ +@@= skipped -84, +87 lines =@@ 1 >^^^^ 2 > ^ 1 > diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js index 22c76264aa..262e29825d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js @@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppComponent = void 0; class AppComponent { render(createElement) { - return
; + return MyElement.createElement("div", null); } } exports.AppComponent = AppComponent; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.diff deleted file mode 100644 index 39e9d6b35d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.jsxFactoryQualifiedNameResolutionError.js -+++ new.jsxFactoryQualifiedNameResolutionError.js -@@= skipped -18, +18 lines =@@ - exports.AppComponent = void 0; - class AppComponent { - render(createElement) { -- return MyElement.createElement("div", null); -+ return
; - } - } - exports.AppComponent = AppComponent; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map index f42a30f213..36429acd7b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map @@ -1,3 +1,3 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,AAAD,EAAG,CAAC;IAAA,CAClB;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gPGRpdiAvPjsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLENBQUMsR0FBRyxDQUFDLEFBQUQsRUFBRyxDQUFDO0lBQUEsQ0FDbEI7Q0FDSiJ9,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9 +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,oCAAO,CAAC;IAAA,CAClB;CACJ"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gTXlFbGVtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIsIG51bGwpOw0KICAgIH0NCn0NCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gQXBwQ29tcG9uZW50Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLG9DQUFPLENBQUM7SUFBQSxDQUNsQjtDQUNKIn0=,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9 diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map.diff index fe15431e3e..65825cfb4f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.js.map.diff @@ -4,5 +4,5 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA,MAAa,YAAY;IACrB,MAAM,CAAC,aAAa;QAChB,OAAO,oCAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gTXlFbGVtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIsIG51bGwpOw0KICAgIH0NCn0NCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gQXBwQ29tcG9uZW50Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BLE1BQWEsWUFBWTtJQUNyQixNQUFNLENBQUMsYUFBYTtRQUNoQixPQUFPLG9DQUFPLENBQUM7SUFDbkIsQ0FBQztDQUNKO0FBSkQsb0NBSUMifQ==,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9 -+{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,AAAD,EAAG,CAAC;IAAA,CAClB;CACJ"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gPGRpdiAvPjsNCiAgICB9DQp9DQpleHBvcnRzLkFwcENvbXBvbmVudCA9IEFwcENvbXBvbmVudDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRlc3QuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLENBQUMsR0FBRyxDQUFDLEFBQUQsRUFBRyxDQUFDO0lBQUEsQ0FDbEI7Q0FDSiJ9,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9 \ No newline at end of file ++{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;;AAMA;IACI,MAAM,CAAC,aAAa,EAAE;QAClB,OAAO,oCAAO,CAAC;IAAA,CAClB;CACJ"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gdm9pZCAwOw0KY2xhc3MgQXBwQ29tcG9uZW50IHsNCiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgew0KICAgICAgICByZXR1cm4gTXlFbGVtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIsIG51bGwpOw0KICAgIH0NCn0NCmV4cG9ydHMuQXBwQ29tcG9uZW50ID0gQXBwQ29tcG9uZW50Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVzdC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BO0lBQ0ksTUFBTSxDQUFDLGFBQWEsRUFBRTtRQUNsQixPQUFPLG9DQUFPLENBQUM7SUFBQSxDQUNsQjtDQUNKIn0=,ZGVjbGFyZSBtb2R1bGUgSlNYIHsKICAgIGludGVyZmFjZSBJbnRyaW5zaWNFbGVtZW50cyB7CiAgICAgICAgW3M6IHN0cmluZ106IGFueTsKICAgIH0KfQoKZXhwb3J0IGNsYXNzIEFwcENvbXBvbmVudCB7CiAgICByZW5kZXIoY3JlYXRlRWxlbWVudCkgewogICAgICAgIHJldHVybiA8ZGl2IC8+OwogICAgfQp9 \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt index c7c0ff566c..4c750c57f6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt @@ -29,6 +29,7 @@ sourceFile:test.tsx 3 > ^ 4 > ^^^^^^^^^^^^^ 5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class AppComponent { > 2 > render @@ -41,32 +42,20 @@ sourceFile:test.tsx 4 >Emitted(5, 25) Source(8, 25) + SourceIndex(0) 5 >Emitted(5, 27) Source(8, 27) + SourceIndex(0) --- ->>> return
; -1 >^^^^^^^^ +>>> return MyElement.createElement("div", null); +1->^^^^^^^^ 2 > ^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > -7 > ^^ -8 > ^ -1 >{ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ +1->{ > 2 > return -3 > < -4 > div -5 > -6 > -7 > /> -8 > ; -1 >Emitted(6, 9) Source(9, 9) + SourceIndex(0) +3 >
+4 > ; +1->Emitted(6, 9) Source(9, 9) + SourceIndex(0) 2 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) -3 >Emitted(6, 17) Source(9, 17) + SourceIndex(0) -4 >Emitted(6, 20) Source(9, 20) + SourceIndex(0) -5 >Emitted(6, 21) Source(9, 21) + SourceIndex(0) -6 >Emitted(6, 21) Source(9, 20) + SourceIndex(0) -7 >Emitted(6, 23) Source(9, 23) + SourceIndex(0) -8 >Emitted(6, 24) Source(9, 24) + SourceIndex(0) +3 >Emitted(6, 52) Source(9, 23) + SourceIndex(0) +4 >Emitted(6, 53) Source(9, 24) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt.diff index c124b7b3aa..021bbed328 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameResolutionError.sourcemap.txt.diff @@ -29,6 +29,7 @@ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> { +5 > ^^ ++6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->export class AppComponent { > 2 > render @@ -41,44 +42,17 @@ 4 >Emitted(5, 25) Source(8, 25) + SourceIndex(0) +5 >Emitted(5, 27) Source(8, 27) + SourceIndex(0) --- -->>> return MyElement.createElement("div", null); --1->^^^^^^^^ -+>>> return
; -+1 >^^^^^^^^ + >>> return MyElement.createElement("div", null); + 1->^^^^^^^^ 2 > ^^^^^^^ --3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --4 > ^ + 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 4 > ^ -1->) { -+3 > ^ -+4 > ^^^ -+5 > ^ -+6 > -+7 > ^^ -+8 > ^ -+1 >{ ++1->{ > 2 > return --3 >
--4 > ; --1->Emitted(6, 9) Source(9, 9) + SourceIndex(0) -+3 > < -+4 > div -+5 > -+6 > -+7 > /> -+8 > ; -+1 >Emitted(6, 9) Source(9, 9) + SourceIndex(0) - 2 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) --3 >Emitted(6, 52) Source(9, 23) + SourceIndex(0) --4 >Emitted(6, 53) Source(9, 24) + SourceIndex(0) -+3 >Emitted(6, 17) Source(9, 17) + SourceIndex(0) -+4 >Emitted(6, 20) Source(9, 20) + SourceIndex(0) -+5 >Emitted(6, 21) Source(9, 21) + SourceIndex(0) -+6 >Emitted(6, 21) Source(9, 20) + SourceIndex(0) -+7 >Emitted(6, 23) Source(9, 23) + SourceIndex(0) -+8 >Emitted(6, 24) Source(9, 24) + SourceIndex(0) - --- - >>> } + 3 >
+@@= skipped -41, +40 lines =@@ 1 >^^^^ 2 > ^ 1 > @@ -91,7 +65,7 @@ 2 >Emitted(7, 6) Source(10, 6) + SourceIndex(0) --- >>>} -@@= skipped -54, +64 lines =@@ +@@= skipped -13, +13 lines =@@ 1 >Emitted(8, 2) Source(11, 2) + SourceIndex(0) --- >>>exports.AppComponent = AppComponent; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js index 6f18583e04..43ef39270d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js @@ -20,7 +20,7 @@ var skate; const React = { createElement: skate.h }; class Component { renderCallback() { - return
test
; + return skate.h("div", null, "test"); } } ; diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js.diff index a070519d97..5c934a406b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5.js.diff @@ -7,15 +7,15 @@ -var React = { createElement: skate.h }; -var Component = /** @class */ (function () { - function Component() { +- } +- Component.prototype.renderCallback = function () { +const React = { createElement: skate.h }; +class Component { + renderCallback() { -+ return
test
; - } -- Component.prototype.renderCallback = function () { -- return skate.h("div", null, "test"); + return skate.h("div", null, "test"); - }; - return Component; -}()); ++ } +} ; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js b/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js index 7c9734d929..fa61d85ede 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js @@ -22,4 +22,4 @@ function fragment() { } Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; const jsx_1 = require("./jsx"); -exports.a = <>fragment text; +exports.a = (0, jsx_1.element)(jsx_1.fragment, null, "fragment text"); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js.diff index cd574ffde7..931f70d63b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.js.diff @@ -5,6 +5,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; -var jsx_1 = require("./jsx"); --exports.a = (0, jsx_1.element)(jsx_1.fragment, null, "fragment text"); +const jsx_1 = require("./jsx"); -+exports.a = <>fragment text; \ No newline at end of file + exports.a = (0, jsx_1.element)(jsx_1.fragment, null, "fragment text"); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js index 3580704f9f..72870d3a61 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js @@ -24,8 +24,5 @@ exports.Counter = Counter; const react_1 = require("react"); function Counter({ count = 0 }) { const [cnt, setCnt] = null; - return <> -

{cnt}

- - ; + return (0, react_1.createElement)(react_1.Fragment, null, (0, react_1.createElement)("p", null, cnt), (0, react_1.createElement)("button", { onClick: () => setCnt((prev) => prev + 1), type: "button" }, "Update")); } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff index 44876c2ab7..8bf098d7f0 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff @@ -14,8 +14,5 @@ +const react_1 = require("react"); +function Counter({ count = 0 }) { + const [cnt, setCnt] = null; -+ return <> -+

{cnt}

-+ -+ ; ++ return (0, react_1.createElement)(react_1.Fragment, null, (0, react_1.createElement)("p", null, cnt), (0, react_1.createElement)("button", { onClick: () => setCnt((prev) => prev + 1), type: "button" }, "Update")); } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js index cf4e955547..05222697a5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js @@ -14,5 +14,5 @@ const jsxWithReactFragment = {test}; /// /// const test = () => "asd"; -const jsxWithJsxFragment = <>{test}; -const jsxWithReactFragment = {test}; +const jsxWithJsxFragment = React.createElement(React.Fragment, null, test); +const jsxWithReactFragment = React.createElement(React.Fragment, null, test); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js.diff index b2d29d3aa6..eb2d2a3bc6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.js.diff @@ -7,8 +7,4 @@ -"use strict"; /// /// - const test = () => "asd"; --const jsxWithJsxFragment = React.createElement(React.Fragment, null, test); --const jsxWithReactFragment = React.createElement(React.Fragment, null, test); -+const jsxWithJsxFragment = <>{test}; -+const jsxWithReactFragment = {test}; \ No newline at end of file + const test = () => "asd"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js b/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js index 3831f8ce84..3671dbff27 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js @@ -16,4 +16,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); class MyComponent extends React.Component { } -const m = ; +const m = React.createElement(MyComponent, { x: "a" }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js.diff index 0fd469ed68..cedfa57a1b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxHasLiteralType.js.diff @@ -32,4 +32,4 @@ +const React = require("react"); +class MyComponent extends React.Component { +} -+const m = ; \ No newline at end of file ++const m = React.createElement(MyComponent, { x: "a" }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js b/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js index 264ce8e47d..4b509a3ec5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js +++ b/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js @@ -15,4 +15,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); require("./App.css"); // doesn't actually exist -const tag =
; +const tag = React.createElement("div", null); diff --git a/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js.diff b/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js.diff index 80e36d3e71..e4ee135254 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.js.diff @@ -8,4 +8,4 @@ +const React = require("react"); require("./App.css"); // doesn't actually exist -var tag = React.createElement("div", null); -+const tag =
; \ No newline at end of file ++const tag = React.createElement("div", null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js b/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js index 50e6e1e8e3..785f3b5499 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js +++ b/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js @@ -16,7 +16,7 @@ class Foo extends createComponentClass(() => class extends React.Component<{}, { //// [jsxInExtendsClause.js] class Foo extends createComponentClass(() => class extends React.Component { render() { - return Hello, world!; + return React.createElement("span", null, "Hello, world!"); } }) { } diff --git a/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js.diff b/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js.diff index 62763276d4..d718a7c490 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxInExtendsClause.js.diff @@ -31,13 +31,12 @@ - return _super !== null && _super.apply(this, arguments) || this; - } - class_1.prototype.render = function () { -- return React.createElement("span", null, "Hello, world!"); ++class Foo extends createComponentClass(() => class extends React.Component { ++ render() { + return React.createElement("span", null, "Hello, world!"); - }; - return class_1; -}(React.Component)); }))); -+class Foo extends createComponentClass(() => class extends React.Component { -+ render() { -+ return Hello, world!; + } +}) { +} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js b/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js index bf09bfb652..04f8f1ecb2 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js +++ b/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js @@ -27,7 +27,7 @@ class TestObject { b = 1; c = () => { }; } -function Test(props) { return <>; } +function Test(props) { return React.createElement(React.Fragment, null); } const model = new TestObject(); -const el1 = ; -const el2 = ; +const el1 = React.createElement(Test, { model: model, foo: "c" }); +const el2 = React.createElement(Test, { model: model, foo: "c" }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js.diff b/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js.diff index 7e18b69ee1..7642ea36b6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxInferenceProducesLiteralAsExpected.js.diff @@ -13,17 +13,16 @@ - } - return TestObject; -}()); --function Test(props) { return React.createElement(React.Fragment, null); } --var model = new TestObject(); --var el1 = React.createElement(Test, { model: model, foo: "c" }); --var el2 = React.createElement(Test, { model: model, foo: "c" }); +const React = require("react"); +class TestObject { + a = ''; + b = 1; + c = () => { }; +} -+function Test(props) { return <>; } + function Test(props) { return React.createElement(React.Fragment, null); } +-var model = new TestObject(); +-var el1 = React.createElement(Test, { model: model, foo: "c" }); +-var el2 = React.createElement(Test, { model: model, foo: "c" }); +const model = new TestObject(); -+const el1 = ; -+const el2 = ; \ No newline at end of file ++const el1 = React.createElement(Test, { model: model, foo: "c" }); ++const el2 = React.createElement(Test, { model: model, foo: "c" }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js index d16cfa4eb2..3d7a2b3284 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js +++ b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js @@ -19,8 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); function SomeComponent(props) { // Just so the return value is RectElement, the rendered element doesnt matter - return
; + return React.createElement("div", null); } function Test(el) { - return ; + return React.createElement(SomeComponent, { element: el }); } diff --git a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js.diff b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js.diff index 3e3a11d6d5..f7b3bea966 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsCompatability.js.diff @@ -8,10 +8,4 @@ +const React = require("react"); function SomeComponent(props) { // Just so the return value is RectElement, the rendered element doesnt matter -- return React.createElement("div", null); -+ return
; - } - function Test(el) { -- return React.createElement(SomeComponent, { element: el }); -+ return ; - } \ No newline at end of file + return React.createElement("div", null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js index 3bece68100..6b3db37414 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js +++ b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js @@ -37,16 +37,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); // opening + closing -const a =
; // empty type args -const b =
; // trailing comma type args -const c =
; // nonexistant type args -const d =
; // nested missing type args -const e =
; // existing but incorrect nested type args -const f =
; // existing type argument with no internal issues +const a = React.createElement("div", null); // empty type args +const b = React.createElement("div", null); // trailing comma type args +const c = React.createElement("div", null); // nonexistant type args +const d = React.createElement("div", null); // nested missing type args +const e = React.createElement("div", null); // existing but incorrect nested type args +const f = React.createElement("div", null); // existing type argument with no internal issues // self-closing -const g =
; // empty type args -const h =
; // trailing comma type args -const i =
; // nonexistant type args -const j =
; // nested missing type args -const k =
; // existing but incorrect nested type args -const l =
; // existing type argument with no internal issues +const g = React.createElement("div", null); // empty type args +const h = React.createElement("div", null); // trailing comma type args +const i = React.createElement("div", null); // nonexistant type args +const j = React.createElement("div", null); // nested missing type args +const k = React.createElement("div", null); // existing but incorrect nested type args +const l = React.createElement("div", null); // existing type argument with no internal issues diff --git a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js.diff b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js.diff index 5845a91d80..7f363350a6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicElementsTypeArgumentErrors.js.diff @@ -13,12 +13,12 @@ -var d = React.createElement("div", null); // nested missing type args -var e = React.createElement("div", null); // existing but incorrect nested type args -var f = React.createElement("div", null); // existing type argument with no internal issues -+const a =
; // empty type args -+const b =
; // trailing comma type args -+const c =
; // nonexistant type args -+const d =
; // nested missing type args -+const e =
; // existing but incorrect nested type args -+const f =
; // existing type argument with no internal issues ++const a = React.createElement("div", null); // empty type args ++const b = React.createElement("div", null); // trailing comma type args ++const c = React.createElement("div", null); // nonexistant type args ++const d = React.createElement("div", null); // nested missing type args ++const e = React.createElement("div", null); // existing but incorrect nested type args ++const f = React.createElement("div", null); // existing type argument with no internal issues // self-closing -var g = React.createElement("div", null); // empty type args -var h = React.createElement("div", null); // trailing comma type args @@ -26,9 +26,9 @@ -var j = React.createElement("div", null); // nested missing type args -var k = React.createElement("div", null); // existing but incorrect nested type args -var l = React.createElement("div", null); // existing type argument with no internal issues -+const g =
; // empty type args -+const h =
; // trailing comma type args -+const i =
; // nonexistant type args -+const j =
; // nested missing type args -+const k =
; // existing but incorrect nested type args -+const l =
; // existing type argument with no internal issues \ No newline at end of file ++const g = React.createElement("div", null); // empty type args ++const h = React.createElement("div", null); // trailing comma type args ++const i = React.createElement("div", null); // nonexistant type args ++const j = React.createElement("div", null); // nested missing type args ++const k = React.createElement("div", null); // existing but incorrect nested type args ++const l = React.createElement("div", null); // existing type argument with no internal issues \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js index b9e00522f9..912b0e85c5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js +++ b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js @@ -16,4 +16,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); const El = Math.random() ? 'h1' : 'h2'; -const tag = {"Title"}; +const tag = React.createElement(El, { className: "ok", key: "key" }, "Title"); diff --git a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js.diff b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js.diff index 6bfacb30cd..ca5259d892 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxIntrinsicUnions.js.diff @@ -12,4 +12,4 @@ +/// +const React = require("react"); +const El = Math.random() ? 'h1' : 'h2'; -+const tag = {"Title"}; \ No newline at end of file ++const tag = React.createElement(El, { className: "ok", key: "key" }, "Title"); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js b/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js index d36c3df7d0..1c70ee3d23 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js +++ b/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js @@ -32,15 +32,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); function MyComp4(props, context, bad, verybad) { - return
; + return React.createElement("div", null); } function MyComp3(props, context, bad) { - return
; + return React.createElement("div", null); } function MyComp2(props, context) { - return
; + return React.createElement("div", null); } -const a = ; // using `MyComp` as a component should error - it expects more arguments than react provides -const b = ; // using `MyComp` as a component should error - it expects more arguments than react provides -const c = ; // Should be OK, `context` is allowed, per react rules -const d = ; // Technically OK, but probably questionable +const a = React.createElement(MyComp4, { x: 2 }); // using `MyComp` as a component should error - it expects more arguments than react provides +const b = React.createElement(MyComp3, { x: 2 }); // using `MyComp` as a component should error - it expects more arguments than react provides +const c = React.createElement(MyComp2, { x: 2 }); // Should be OK, `context` is allowed, per react rules +const d = React.createElement(MyTagWithOptionalNonJSXBits, { x: 2 }); // Technically OK, but probably questionable diff --git a/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js.diff b/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js.diff index 145afbf73e..b210831c2c 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxIssuesErrorWhenTagExpectsTooManyArguments.js.diff @@ -10,22 +10,17 @@ +/// +const React = require("react"); function MyComp4(props, context, bad, verybad) { -- return React.createElement("div", null); -+ return
; - } - function MyComp3(props, context, bad) { -- return React.createElement("div", null); -+ return
; + return React.createElement("div", null); } +@@= skipped -12, +12 lines =@@ function MyComp2(props, context) { -- return React.createElement("div", null); -+ return
; + return React.createElement("div", null); } -var a = React.createElement(MyComp4, { x: 2 }); // using `MyComp` as a component should error - it expects more arguments than react provides -var b = React.createElement(MyComp3, { x: 2 }); // using `MyComp` as a component should error - it expects more arguments than react provides -var c = React.createElement(MyComp2, { x: 2 }); // Should be OK, `context` is allowed, per react rules -var d = React.createElement(MyTagWithOptionalNonJSXBits, { x: 2 }); // Technically OK, but probably questionable -+const a = ; // using `MyComp` as a component should error - it expects more arguments than react provides -+const b = ; // using `MyComp` as a component should error - it expects more arguments than react provides -+const c = ; // Should be OK, `context` is allowed, per react rules -+const d = ; // Technically OK, but probably questionable \ No newline at end of file ++const a = React.createElement(MyComp4, { x: 2 }); // using `MyComp` as a component should error - it expects more arguments than react provides ++const b = React.createElement(MyComp3, { x: 2 }); // using `MyComp` as a component should error - it expects more arguments than react provides ++const c = React.createElement(MyComp2, { x: 2 }); // Should be OK, `context` is allowed, per react rules ++const d = React.createElement(MyTagWithOptionalNonJSXBits, { x: 2 }); // Technically OK, but probably questionable \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js b/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js index 7e4610b4bd..5f3ca1c7a7 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js +++ b/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js @@ -33,4 +33,4 @@ declare const Comp: (p: { className?: string }) => null //// [jsxLibraryManagedAttributesUnusedGeneric.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -; +jsx(Comp, { css: "color:hotpink;" }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js.diff b/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js.diff deleted file mode 100644 index 09a82176b6..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxLibraryManagedAttributesUnusedGeneric.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.jsxLibraryManagedAttributesUnusedGeneric.js -+++ new.jsxLibraryManagedAttributesUnusedGeneric.js -@@= skipped -32, +32 lines =@@ - //// [jsxLibraryManagedAttributesUnusedGeneric.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --jsx(Comp, { css: "color:hotpink;" }); -+; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js b/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js index 521dbb30d4..de3102f784 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js +++ b/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js @@ -30,5 +30,5 @@ class X { } exports.X = X; function A() { - return (

Hello

); + return (X.jsx("p", null, "Hello")); } diff --git a/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js.diff b/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js.diff index 509c66bb4a..624f462071 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxLocalNamespaceIndexSignatureNoCrash.js.diff @@ -18,6 +18,4 @@ +} exports.X = X; function A() { -- return (X.jsx("p", null, "Hello")); -+ return (

Hello

); - } \ No newline at end of file + return (X.jsx("p", null, "Hello")); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js b/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js index 17eff312f5..50a07fba47 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js +++ b/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js @@ -14,12 +14,6 @@ foo: 23\n //// [jsxMultilineAttributeValuesReact.js] -const a = ; -const b = ; -const c = ; +const a = React.createElement("input", { value: "\nfoo: 23\n" }); +const b = React.createElement("input", { value: "\nfoo: 23\n" }); +const c = React.createElement("input", { value: "\nfoo: 23\\n\n" }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js.diff b/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js.diff index 0a1ba96f3d..e2fb663b6b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxMultilineAttributeValuesReact.js.diff @@ -7,12 +7,6 @@ -var a = React.createElement("input", { value: "\nfoo: 23\n" }); -var b = React.createElement("input", { value: '\nfoo: 23\n' }); -var c = React.createElement("input", { value: '\nfoo: 23\\n\n' }); -+const a = ; -+const b = ; -+const c = ; \ No newline at end of file ++const a = React.createElement("input", { value: "\nfoo: 23\n" }); ++const b = React.createElement("input", { value: "\nfoo: 23\n" }); ++const c = React.createElement("input", { value: "\nfoo: 23\\n\n" }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js index d8f603e6e5..09f28eebda 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js @@ -28,14 +28,17 @@ export {}; export {}; -//// [test.js] -const Title = (props) =>

{props.children}

; -Hello, world!; -const Wrong = (props) =>

{props.offspring}

; -Byebye, world!; //// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +//// [test.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("/jsx/jsx-runtime"); +const Title = (props) => jsx_runtime_1.jsx("h1", { children: props.children }); +jsx_runtime_1.jsx(Title, { children: "Hello, world!" }); +const Wrong = (props) => jsx_runtime_1.jsx("h1", { children: props.offspring }); +jsx_runtime_1.jsx(Wrong, { children: "Byebye, world!" }); //// [jsx-dev-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js.diff index b7252c3ef9..390a966ebe 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js.diff @@ -1,18 +1,7 @@ --- old.jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js +++ new.jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsx).js -@@= skipped -27, +27 lines =@@ - export {}; - - --//// [jsx-runtime.js] --"use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); +@@= skipped -33, +33 lines =@@ //// [test.js] -+const Title = (props) =>

{props.children}

; -+Hello, world!; -+const Wrong = (props) =>

{props.offspring}

; -+Byebye, world!; -+//// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_runtime_1 = require("/jsx/jsx-runtime"); @@ -20,6 +9,11 @@ -(0, jsx_runtime_1.jsx)(Title, { children: "Hello, world!" }); -var Wrong = function (props) { return (0, jsx_runtime_1.jsx)("h1", { children: props.offspring }); }; -(0, jsx_runtime_1.jsx)(Wrong, { children: "Byebye, world!" }); ++const jsx_runtime_1 = require("/jsx/jsx-runtime"); ++const Title = (props) => jsx_runtime_1.jsx("h1", { children: props.children }); ++jsx_runtime_1.jsx(Title, { children: "Hello, world!" }); ++const Wrong = (props) => jsx_runtime_1.jsx("h1", { children: props.offspring }); ++jsx_runtime_1.jsx(Wrong, { children: "Byebye, world!" }); //// [jsx-dev-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js index 66f111405d..bcf5f7970d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js @@ -28,14 +28,18 @@ export {}; export {}; -//// [test.js] -const Title = (props) =>

{props.children}

; -Hello, world!; -const Wrong = (props) =>

{props.offspring}

; -Byebye, world!; //// [jsx-dev-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +//// [test.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("/jsx/jsx-dev-runtime"); +const _jsxFileName = "/test.tsx"; +const Title = (props) => jsx_dev_runtime_1.jsxDEV("h1", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 47 }, this); +jsx_dev_runtime_1.jsxDEV(Title, { children: "Hello, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 74 }, this); +const Wrong = (props) => jsx_dev_runtime_1.jsxDEV("h1", { children: props.offspring }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 48 }, this); +jsx_dev_runtime_1.jsxDEV(Wrong, { children: "Byebye, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 76 }, this); //// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js.diff index 56353a4443..e46ccae383 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js.diff @@ -1,18 +1,8 @@ --- old.jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js +++ new.jsxNamespaceElementChildrenAttributeIgnoredWhenReactJsx(jsx=react-jsxdev).js -@@= skipped -27, +27 lines =@@ - export {}; - - --//// [jsx-dev-runtime.js] --"use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); +@@= skipped -32, +32 lines =@@ + Object.defineProperty(exports, "__esModule", { value: true }); //// [test.js] -+const Title = (props) =>

{props.children}

; -+Hello, world!; -+const Wrong = (props) =>

{props.offspring}

; -+Byebye, world!; -+//// [jsx-dev-runtime.js] "use strict"; -var _this = this; Object.defineProperty(exports, "__esModule", { value: true }); @@ -22,6 +12,12 @@ -(0, jsx_dev_runtime_1.jsxDEV)(Title, { children: "Hello, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 74 }, this); -var Wrong = function (props) { return (0, jsx_dev_runtime_1.jsxDEV)("h1", { children: props.offspring }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 48 }, _this); }; -(0, jsx_dev_runtime_1.jsxDEV)(Wrong, { children: "Byebye, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 76 }, this); ++const jsx_dev_runtime_1 = require("/jsx/jsx-dev-runtime"); ++const _jsxFileName = "/test.tsx"; ++const Title = (props) => jsx_dev_runtime_1.jsxDEV("h1", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 47 }, this); ++jsx_dev_runtime_1.jsxDEV(Title, { children: "Hello, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 74 }, this); ++const Wrong = (props) => jsx_dev_runtime_1.jsxDEV("h1", { children: props.offspring }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 48 }, this); ++jsx_dev_runtime_1.jsxDEV(Wrong, { children: "Byebye, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 76 }, this); //// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js index 942223eb92..a53a347d30 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js @@ -109,5 +109,6 @@ export const Comp = () =>
; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Comp = void 0; -const Comp = () =>
; +const jsx_runtime_1 = require("preact/jsx-runtime"); +const Comp = () => jsx_runtime_1.jsx("div", {}); exports.Comp = Comp; diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js.diff index 8bf33695f8..731772d7f3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexport.js.diff @@ -6,5 +6,6 @@ exports.Comp = void 0; -var jsx_runtime_1 = require("preact/jsx-runtime"); -var Comp = function () { return (0, jsx_runtime_1.jsx)("div", {}); }; -+const Comp = () =>
; ++const jsx_runtime_1 = require("preact/jsx-runtime"); ++const Comp = () => jsx_runtime_1.jsx("div", {}); exports.Comp = Comp; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js index 43e956cf69..c3fbdf5ad9 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js @@ -105,5 +105,6 @@ export const Comp = () =>
; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Comp = void 0; -const Comp = () =>
; +const jsx_runtime_1 = require("preact/jsx-runtime"); +const Comp = () => jsx_runtime_1.jsx("div", {}); exports.Comp = Comp; diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js.diff index e490a85b11..7ea05971c8 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceGlobalReexportMissingAliasTarget.js.diff @@ -6,5 +6,6 @@ exports.Comp = void 0; -var jsx_runtime_1 = require("preact/jsx-runtime"); -var Comp = function () { return (0, jsx_runtime_1.jsx)("div", {}); }; -+const Comp = () =>
; ++const jsx_runtime_1 = require("preact/jsx-runtime"); ++const Comp = () => jsx_runtime_1.jsx("div", {}); exports.Comp = Comp; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js index 4a50a124a9..7a0ff7ae75 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js @@ -105,5 +105,6 @@ export const Comp = () =>
; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Comp = void 0; -const Comp = () =>
; +const jsx_runtime_1 = require("preact/jsx-runtime"); +const Comp = () => jsx_runtime_1.jsx("div", {}); exports.Comp = Comp; diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js.diff index 3e8a745db5..5fca1592d7 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespace.js.diff @@ -6,5 +6,6 @@ exports.Comp = void 0; -var jsx_runtime_1 = require("preact/jsx-runtime"); -var Comp = function () { return (0, jsx_runtime_1.jsx)("div", {}); }; -+const Comp = () =>
; ++const jsx_runtime_1 = require("preact/jsx-runtime"); ++const Comp = () => jsx_runtime_1.jsx("div", {}); exports.Comp = Comp; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js index 21f95406b9..cedcfa2ff7 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js @@ -68,5 +68,6 @@ export const Comp = () =>
; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Comp = void 0; -const Comp = () =>
; +const jsx_runtime_1 = require("@emotion/react/jsx-runtime"); +const Comp = () => jsx_runtime_1.jsx("div", { css: "color: hotpink;" }); exports.Comp = Comp; diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js.diff index 6ed7d16dfd..72ea270b34 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromConfigPickedOverGlobalOne(jsx=react-jsx).js.diff @@ -6,5 +6,6 @@ exports.Comp = void 0; -var jsx_runtime_1 = require("@emotion/react/jsx-runtime"); -var Comp = function () { return (0, jsx_runtime_1.jsx)("div", { css: "color: hotpink;" }); }; -+const Comp = () =>
; ++const jsx_runtime_1 = require("@emotion/react/jsx-runtime"); ++const Comp = () => jsx_runtime_1.jsx("div", { css: "color: hotpink;" }); exports.Comp = Comp; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js index f50dfff5ad..099c51d047 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js @@ -69,6 +69,7 @@ export const Comp = () =>
; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Comp = void 0; +const jsx_runtime_1 = require("@emotion/react/jsx-runtime"); /* @jsxImportSource @emotion/react */ -const Comp = () =>
; +const Comp = () => jsx_runtime_1.jsx("div", { css: "color: hotpink;" }); exports.Comp = Comp; diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js.diff index 5bf3ae6272..b66fee98ca 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceImplicitImportJSXNamespaceFromPragmaPickedOverGlobalOne.js.diff @@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Comp = void 0; -var jsx_runtime_1 = require("@emotion/react/jsx-runtime"); ++const jsx_runtime_1 = require("@emotion/react/jsx-runtime"); /* @jsxImportSource @emotion/react */ -var Comp = function () { return (0, jsx_runtime_1.jsx)("div", { css: "color: hotpink;" }); }; -+const Comp = () =>
; ++const Comp = () => jsx_runtime_1.jsx("div", { css: "color: hotpink;" }); exports.Comp = Comp; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js index dfd2665a13..3f49fb4c3a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js @@ -19,12 +19,15 @@ export {}; //// [jsx-dev-runtime.ts] export {}; -//// [test.js] -const Title = (props) =>

{props.children}

; -const element = Hello, world!; //// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +//// [test.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("/jsx/jsx-runtime"); +const Title = (props) => jsx_runtime_1.jsx("h1", { children: props.children }); +const element = jsx_runtime_1.jsx(Title, { children: "Hello, world!" }); //// [jsx-dev-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js.diff index 66cb6f02b0..08cd838e40 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js.diff @@ -1,21 +1,15 @@ --- old.jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js +++ new.jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsx).js -@@= skipped -18, +18 lines =@@ - //// [jsx-dev-runtime.ts] - export {}; - --//// [jsx-runtime.js] --"use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); +@@= skipped -24, +24 lines =@@ //// [test.js] -+const Title = (props) =>

{props.children}

; -+const element = Hello, world!; -+//// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_runtime_1 = require("/jsx/jsx-runtime"); -var Title = function (props) { return (0, jsx_runtime_1.jsx)("h1", { children: props.children }); }; -var element = (0, jsx_runtime_1.jsx)(Title, { children: "Hello, world!" }); ++const jsx_runtime_1 = require("/jsx/jsx-runtime"); ++const Title = (props) => jsx_runtime_1.jsx("h1", { children: props.children }); ++const element = jsx_runtime_1.jsx(Title, { children: "Hello, world!" }); //// [jsx-dev-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js index 3916efd4c6..c38dd60071 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js @@ -19,12 +19,16 @@ export {}; //// [jsx-dev-runtime.ts] export {}; -//// [test.js] -const Title = (props) =>

{props.children}

; -const element = Hello, world!; //// [jsx-dev-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +//// [test.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_dev_runtime_1 = require("/jsx/jsx-dev-runtime"); +const _jsxFileName = "/test.tsx"; +const Title = (props) => jsx_dev_runtime_1.jsxDEV("h1", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 47 }, this); +const element = jsx_dev_runtime_1.jsxDEV(Title, { children: "Hello, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 3, columnNumber: 16 }, this); //// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js.diff index 64ae17a775..5a177d9cd1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js.diff @@ -1,16 +1,8 @@ --- old.jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js +++ new.jsxNamespaceNoElementChildrenAttributeReactJsx(jsx=react-jsxdev).js -@@= skipped -18, +18 lines =@@ - //// [jsx-dev-runtime.ts] - export {}; - --//// [jsx-dev-runtime.js] --"use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); +@@= skipped -23, +23 lines =@@ + Object.defineProperty(exports, "__esModule", { value: true }); //// [test.js] -+const Title = (props) =>

{props.children}

; -+const element = Hello, world!; -+//// [jsx-dev-runtime.js] "use strict"; -var _this = this; Object.defineProperty(exports, "__esModule", { value: true }); @@ -18,6 +10,10 @@ -var _jsxFileName = "/test.tsx"; -var Title = function (props) { return (0, jsx_dev_runtime_1.jsxDEV)("h1", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 47 }, _this); }; -var element = (0, jsx_dev_runtime_1.jsxDEV)(Title, { children: "Hello, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 3, columnNumber: 16 }, this); ++const jsx_dev_runtime_1 = require("/jsx/jsx-dev-runtime"); ++const _jsxFileName = "/test.tsx"; ++const Title = (props) => jsx_dev_runtime_1.jsxDEV("h1", { children: props.children }, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 47 }, this); ++const element = jsx_dev_runtime_1.jsxDEV(Title, { children: "Hello, world!" }, void 0, false, { fileName: _jsxFileName, lineNumber: 3, columnNumber: 16 }, this); //// [jsx-runtime.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js b/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js index 7a8a3cca1f..71d7334c9a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js @@ -34,29 +34,40 @@ var upcaseComponent2 = ; // Parsed as instrinsic //// [jsxNamespacePrefixInNameReact.js] -var justElement1 = ; -var justElement2 = ; -var justElement3 = ; -var justElement4 = {"text"}; -var justElement5 = {"text"}; -var tooManySeparators1 = ; -var tooManySeparators2 = , ment; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var justElement1 = React.createElement("a:element", null); +var justElement2 = React.createElement("a:element", null); +var justElement3 = React.createElement("a:element", { attr: "value" }); +var justElement4 = React.createElement("a:element", null, "text"); +var justElement5 = React.createElement("a:element", { attr: "value" }, "text"); +var tooManySeparators1 = React.createElement("a:ele", { ment: true }); +var tooManySeparators2 = React.createElement("a:ele", { ment: true }), ment; > ; -var tooManySeparators3 = , ment; +var tooManySeparators3 = React.createElement("a:ele", { ment: true, attr: "value" }), ment; > ; -var tooManySeparators4 = {"text"}, ment; +var tooManySeparators4 = React.createElement("a:ele", { ment: true }, "text"), ment; > ; -var tooManySeparators5 = {"text"}, ment; +var tooManySeparators5 = React.createElement("a:ele", { ment: true, attr: "value" }, "text"), ment; > ; -var justAttribute1 = ; -var justAttribute2 = ; -var justAttribute3 = {"text"}; -var both1 = ; -var both2 = ; -var both3 = {"text"}; -var endOfIdent1 = ; -var endOfIdent2 = ; +var justAttribute1 = React.createElement("element", { "a:attr": "value" }); +var justAttribute2 = React.createElement("element", { "a:attr": "value" }); +var justAttribute3 = React.createElement("element", { "a:attr": "value" }, "text"); +var both1 = React.createElement("a:element", { "a:attr": "value" }); +var both2 = React.createElement("a:element", { "k:attr": "value" }); +var both3 = React.createElement("a:element", { "a:attr": "value" }, "text"); +var endOfIdent1 = React.createElement("a:attr", __assign({}, "value")); +var endOfIdent2 = React.createElement("a", { "attr:": "value" }); var beginOfIdent1 = < , a, attr = { "value": } / > ; -var beginOfIdent2 = ; -var upcaseComponent1 = ; // Parsed as intrinsic -var upcaseComponent2 = ; // Parsed as instrinsic +var beginOfIdent2 = React.createElement("a:attr", __assign({}, "value")); +var upcaseComponent1 = React.createElement("ns:Upcase", null); // Parsed as intrinsic +var upcaseComponent2 = React.createElement("Upcase:element", null); // Parsed as instrinsic diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js.diff deleted file mode 100644 index 2223a7458d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespacePrefixInNameReact.js.diff +++ /dev/null @@ -1,68 +0,0 @@ ---- old.jsxNamespacePrefixInNameReact.js -+++ new.jsxNamespacePrefixInNameReact.js -@@= skipped -33, +33 lines =@@ - - - //// [jsxNamespacePrefixInNameReact.js] --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; --var justElement1 = React.createElement("a:element", null); --var justElement2 = React.createElement("a:element", null); --var justElement3 = React.createElement("a:element", { attr: "value" }); --var justElement4 = React.createElement("a:element", null, "text"); --var justElement5 = React.createElement("a:element", { attr: "value" }, "text"); --var tooManySeparators1 = React.createElement("a:ele", { ment: true }); --var tooManySeparators2 = React.createElement("a:ele", { ment: true }), ment; -- > ; --var tooManySeparators3 = React.createElement("a:ele", { ment: true, attr: "value" }), ment; -- > ; --var tooManySeparators4 = React.createElement("a:ele", { ment: true }, "text"), ment; -- > ; --var tooManySeparators5 = React.createElement("a:ele", { ment: true, attr: "value" }, "text"), ment; -- > ; --var justAttribute1 = React.createElement("element", { "a:attr": "value" }); --var justAttribute2 = React.createElement("element", { "a:attr": "value" }); --var justAttribute3 = React.createElement("element", { "a:attr": "value" }, "text"); --var both1 = React.createElement("a:element", { "a:attr": "value" }); --var both2 = React.createElement("a:element", { "k:attr": "value" }); --var both3 = React.createElement("a:element", { "a:attr": "value" }, "text"); --var endOfIdent1 = React.createElement("a:attr", __assign({}, "value")); --var endOfIdent2 = React.createElement("a", { "attr:": "value" }); -+var justElement1 = ; -+var justElement2 = ; -+var justElement3 = ; -+var justElement4 = {"text"}; -+var justElement5 = {"text"}; -+var tooManySeparators1 = ; -+var tooManySeparators2 = , ment; -+ > ; -+var tooManySeparators3 = , ment; -+ > ; -+var tooManySeparators4 = {"text"}, ment; -+ > ; -+var tooManySeparators5 = {"text"}, ment; -+ > ; -+var justAttribute1 = ; -+var justAttribute2 = ; -+var justAttribute3 = {"text"}; -+var both1 = ; -+var both2 = ; -+var both3 = {"text"}; -+var endOfIdent1 = ; -+var endOfIdent2 = ; - var beginOfIdent1 = < , a, attr = { "value": } / > ; --var beginOfIdent2 = React.createElement("a:attr", __assign({}, "value")); --var upcaseComponent1 = React.createElement("ns:Upcase", null); // Parsed as intrinsic --var upcaseComponent2 = React.createElement("Upcase:element", null); // Parsed as instrinsic -+var beginOfIdent2 = ; -+var upcaseComponent1 = ; // Parsed as intrinsic -+var upcaseComponent2 = ; // Parsed as instrinsic \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js b/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js index eeb74bfb16..0cb4cdfcf2 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js @@ -24,4 +24,4 @@ function createElement(element, props, ...children) { } "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const MyLib = require("./library"); -const content = ; +const content = MyLib.createElement("my-element", null); diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js.diff index 7b6eedd1de..ddc0c92e31 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespaceReexports.js.diff @@ -17,4 +17,4 @@ -var MyLib = require("./library"); -var content = MyLib.createElement("my-element", null); +const MyLib = require("./library"); -+const content = ; \ No newline at end of file ++const content = MyLib.createElement("my-element", null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js b/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js index 32eea9b465..5a20394746 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js +++ b/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js @@ -13,5 +13,6 @@ declare module "react" { export const tag =
//// [jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js] +import { jsx as _jsx } from "react/jsx-runtime"; /// -export const tag =
; +export const tag = _jsx("div", { "ns:thing": "a" }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js.diff b/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js.diff deleted file mode 100644 index 741a5d5aa8..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js -+++ new.jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js -@@= skipped -12, +12 lines =@@ - export const tag =
- - //// [jsxNamespacedNameNotComparedToNonMatchingIndexSignature.js] --import { jsx as _jsx } from "react/jsx-runtime"; - /// --export const tag = _jsx("div", { "ns:thing": "a" }); -+export const tag =
; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js index cc1d4c1b05..314be06f5a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js @@ -41,31 +41,33 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; /// /* @jsxRuntime classic */ const React = require("react"); -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime automatic */ -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); +exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [three.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime classic */ /* @jsxRuntime automatic */ -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); +exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -74,10 +76,10 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; /* @jsxRuntime automatic */ /* @jsxRuntime classic */ const React = require("react"); -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff index 8028a77060..7ce6fc30de 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff @@ -7,59 +7,58 @@ -var React = require("react"); -var HelloWorld = function () { return React.createElement("h1", null, "Hello world"); }; +const React = require("react"); -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, - React.createElement("div", null)); --exports.selfClosing = React.createElement("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); + exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime automatic */ -var HelloWorld = function () { return (0, jsx_runtime_1.jsx)("h1", { children: "Hello world" }); }; -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", {}) }); -exports.selfClosing = (0, jsx_runtime_1.jsx)("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); ++exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [three.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime classic */ /* @jsxRuntime automatic */ -var HelloWorld = function () { return (0, jsx_runtime_1.jsx)("h1", { children: "Hello world" }); }; -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", {}) }); -exports.selfClosing = (0, jsx_runtime_1.jsx)("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); ++exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -@@= skipped -36, +33 lines =@@ +@@= skipped -36, +35 lines =@@ /// /* @jsxRuntime automatic */ /* @jsxRuntime classic */ -var React = require("react"); -var HelloWorld = function () { return React.createElement("h1", null, "Hello world"); }; +const React = require("react"); -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, - React.createElement("div", null)); --exports.selfClosing = React.createElement("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); + exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file + "use strict"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js index cc1d4c1b05..314be06f5a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js @@ -41,31 +41,33 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; /// /* @jsxRuntime classic */ const React = require("react"); -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime automatic */ -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); +exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [three.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime classic */ /* @jsxRuntime automatic */ -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); +exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -74,10 +76,10 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; /* @jsxRuntime automatic */ /* @jsxRuntime classic */ const React = require("react"); -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff index 1db09ca25d..33fe146c6c 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff @@ -7,59 +7,58 @@ -var React = require("react"); -var HelloWorld = function () { return React.createElement("h1", null, "Hello world"); }; +const React = require("react"); -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, - React.createElement("div", null)); --exports.selfClosing = React.createElement("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); + exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime automatic */ -var HelloWorld = function () { return (0, jsx_runtime_1.jsx)("h1", { children: "Hello world" }); }; -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", {}) }); -exports.selfClosing = (0, jsx_runtime_1.jsx)("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); ++exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [three.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); /// /* @jsxRuntime classic */ /* @jsxRuntime automatic */ -var HelloWorld = function () { return (0, jsx_runtime_1.jsx)("h1", { children: "Hello world" }); }; -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => jsx_runtime_1.jsx("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", {}) }); -exports.selfClosing = (0, jsx_runtime_1.jsx)("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: jsx_runtime_1.jsx("div", {}) }); ++exports.selfClosing = jsx_runtime_1.jsx("img", { src: "./image.png" }); //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -@@= skipped -36, +33 lines =@@ +@@= skipped -36, +35 lines =@@ /// /* @jsxRuntime automatic */ /* @jsxRuntime classic */ -var React = require("react"); -var HelloWorld = function () { return React.createElement("h1", null, "Hello world"); }; +const React = require("react"); -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, - React.createElement("div", null)); --exports.selfClosing = React.createElement("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); + exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file + "use strict"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js index cc1d4c1b05..a0409f1a58 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js @@ -41,31 +41,33 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; /// /* @jsxRuntime classic */ const React = require("react"); -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); /// /* @jsxRuntime automatic */ -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => jsx_dev_runtime_1.jsxDEV("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = jsx_dev_runtime_1.jsxDEV(jsx_dev_runtime_1.Fragment, { children: jsx_dev_runtime_1.jsxDEV("div", {}) }); +exports.selfClosing = jsx_dev_runtime_1.jsxDEV("img", { src: "./image.png" }); //// [three.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); /// /* @jsxRuntime classic */ /* @jsxRuntime automatic */ -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => jsx_dev_runtime_1.jsxDEV("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = jsx_dev_runtime_1.jsxDEV(jsx_dev_runtime_1.Fragment, { children: jsx_dev_runtime_1.jsxDEV("div", {}) }); +exports.selfClosing = jsx_dev_runtime_1.jsxDEV("img", { src: "./image.png" }); //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -74,10 +76,10 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; /* @jsxRuntime automatic */ /* @jsxRuntime classic */ const React = require("react"); -const HelloWorld = () =>

Hello world

; +const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = <>
; -exports.selfClosing = ; +exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff index dd07b5d84f..4c01107a6e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff @@ -7,13 +7,12 @@ -var React = require("react"); -var HelloWorld = function () { return React.createElement("h1", null, "Hello world"); }; +const React = require("react"); -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, - React.createElement("div", null)); --exports.selfClosing = React.createElement("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); + exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; -var _this = this; @@ -21,15 +20,16 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; -var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); -var _jsxFileName = "two.tsx"; ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); /// /* @jsxRuntime automatic */ -var HelloWorld = function () { return (0, jsx_dev_runtime_1.jsxDEV)("h1", { children: "Hello world" }, void 0, false, { fileName: _jsxFileName, lineNumber: 3, columnNumber: 32 }, _this); }; -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => jsx_dev_runtime_1.jsxDEV("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = (0, jsx_dev_runtime_1.jsxDEV)(jsx_dev_runtime_1.Fragment, { children: (0, jsx_dev_runtime_1.jsxDEV)("div", {}, void 0, false, { fileName: _jsxFileName, lineNumber: 4, columnNumber: 23 }, this) }, void 0, false, { fileName: _jsxFileName, lineNumber: 4, columnNumber: 20 }, this); -exports.selfClosing = (0, jsx_dev_runtime_1.jsxDEV)("img", { src: "./image.png" }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 27 }, this); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = jsx_dev_runtime_1.jsxDEV(jsx_dev_runtime_1.Fragment, { children: jsx_dev_runtime_1.jsxDEV("div", {}) }); ++exports.selfClosing = jsx_dev_runtime_1.jsxDEV("img", { src: "./image.png" }); //// [three.js] "use strict"; -var _this = this; @@ -37,33 +37,32 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; -var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); -var _jsxFileName = "three.tsx"; ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); /// /* @jsxRuntime classic */ /* @jsxRuntime automatic */ -var HelloWorld = function () { return (0, jsx_dev_runtime_1.jsxDEV)("h1", { children: "Hello world" }, void 0, false, { fileName: _jsxFileName, lineNumber: 4, columnNumber: 32 }, _this); }; -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => jsx_dev_runtime_1.jsxDEV("h1", { children: "Hello world" }); exports.HelloWorld = HelloWorld; -exports.frag = (0, jsx_dev_runtime_1.jsxDEV)(jsx_dev_runtime_1.Fragment, { children: (0, jsx_dev_runtime_1.jsxDEV)("div", {}, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 23 }, this) }, void 0, false, { fileName: _jsxFileName, lineNumber: 5, columnNumber: 20 }, this); -exports.selfClosing = (0, jsx_dev_runtime_1.jsxDEV)("img", { src: "./image.png" }, void 0, false, { fileName: _jsxFileName, lineNumber: 6, columnNumber: 27 }, this); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = jsx_dev_runtime_1.jsxDEV(jsx_dev_runtime_1.Fragment, { children: jsx_dev_runtime_1.jsxDEV("div", {}) }); ++exports.selfClosing = jsx_dev_runtime_1.jsxDEV("img", { src: "./image.png" }); //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -@@= skipped -40, +33 lines =@@ +@@= skipped -40, +35 lines =@@ /// /* @jsxRuntime automatic */ /* @jsxRuntime classic */ -var React = require("react"); -var HelloWorld = function () { return React.createElement("h1", null, "Hello world"); }; +const React = require("react"); -+const HelloWorld = () =>

Hello world

; ++const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, - React.createElement("div", null)); --exports.selfClosing = React.createElement("img", { src: "./image.png" }); -+exports.frag = <>
; -+exports.selfClosing = ; ++exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); + exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file + "use strict"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxSpreadFirstUnionNoErrors.js b/testdata/baselines/reference/submodule/compiler/jsxSpreadFirstUnionNoErrors.js index f053cbf957..9097b52c01 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxSpreadFirstUnionNoErrors.js +++ b/testdata/baselines/reference/submodule/compiler/jsxSpreadFirstUnionNoErrors.js @@ -20,11 +20,22 @@ const c = ; //// [jsxSpreadFirstUnionNoErrors.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = require("react"); const Info = (props) => props.status === "hidden" - ?
} {...{ wrong() { return
x
; } }}/>; -const t5 = x
} {...{ get wrong() { return
x
; } }}/>; -const t6 = x
} {...{ set wrong(s) { let a =
x
; } }}/>; +const t1 = React.createElement("div", Object.assign({}, React.createElement("span", null))); +const t2 = React.createElement("div", Object.assign({}, React.createElement("span", { className: "foo" }))); +const t3 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong: React.createElement("div", null, "x") }); +const t4 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong() { return React.createElement("div", null, "x"); } }); +const t5 = React.createElement(Comp, { right: React.createElement("div", null, "x"), get wrong() { return React.createElement("div", null, "x"); } }); +const t6 = React.createElement(Comp, { right: React.createElement("div", null, "x"), set wrong(s) { let a = React.createElement("div", null, "x"); } }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=es2015).js.diff b/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=es2015).js.diff deleted file mode 100644 index 3e0b253d86..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=es2015).js.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.jsxSpreadTag(target=es2015).js -+++ new.jsxSpreadTag(target=es2015).js -@@= skipped -23, +23 lines =@@ - - - //// [a.js] --const t1 = React.createElement("div", Object.assign({}, React.createElement("span", null))); --const t2 = React.createElement("div", Object.assign({}, React.createElement("span", { className: "foo" }))); --const t3 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong: React.createElement("div", null, "x") }); --const t4 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong() { return React.createElement("div", null, "x"); } }); --const t5 = React.createElement(Comp, { right: React.createElement("div", null, "x"), get wrong() { return React.createElement("div", null, "x"); } }); --const t6 = React.createElement(Comp, { right: React.createElement("div", null, "x"), set wrong(s) { let a = React.createElement("div", null, "x"); } }); -+const t1 =
}/>; -+const t2 =
}/>; -+const t3 = x
} {...{ wrong:
x
}}/>; -+const t4 = x
} {...{ wrong() { return
x
; } }}/>; -+const t5 = x
} {...{ get wrong() { return
x
; } }}/>; -+const t6 = x
} {...{ set wrong(s) { let a =
x
; } }}/>; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js b/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js index bc93c58467..e08bd32974 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js +++ b/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js @@ -24,9 +24,9 @@ const t6 = }/>; -const t2 =
}/>; -const t3 = x
} {...{ wrong:
x
}}/>; -const t4 = x
} {...{ wrong() { return
x
; } }}/>; -const t5 = x
} {...{ get wrong() { return
x
; } }}/>; -const t6 = x
} {...{ set wrong(s) { let a =
x
; } }}/>; +const t1 = React.createElement("div", { ...React.createElement("span", null) }); +const t2 = React.createElement("div", { ...React.createElement("span", { className: "foo" }) }); +const t3 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong: React.createElement("div", null, "x") }); +const t4 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong() { return React.createElement("div", null, "x"); } }); +const t5 = React.createElement(Comp, { right: React.createElement("div", null, "x"), get wrong() { return React.createElement("div", null, "x"); } }); +const t6 = React.createElement(Comp, { right: React.createElement("div", null, "x"), set wrong(s) { let a = React.createElement("div", null, "x"); } }); diff --git a/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js.diff b/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js.diff deleted file mode 100644 index c8c646a686..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxSpreadTag(target=esnext).js.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.jsxSpreadTag(target=esnext).js -+++ new.jsxSpreadTag(target=esnext).js -@@= skipped -23, +23 lines =@@ - - - //// [a.js] --const t1 = React.createElement("div", { ...React.createElement("span", null) }); --const t2 = React.createElement("div", { ...React.createElement("span", { className: "foo" }) }); --const t3 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong: React.createElement("div", null, "x") }); --const t4 = React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong() { return React.createElement("div", null, "x"); } }); --const t5 = React.createElement(Comp, { right: React.createElement("div", null, "x"), get wrong() { return React.createElement("div", null, "x"); } }); --const t6 = React.createElement(Comp, { right: React.createElement("div", null, "x"), set wrong(s) { let a = React.createElement("div", null, "x"); } }); -+const t1 =
}/>; -+const t2 =
}/>; -+const t3 = x
} {...{ wrong:
x
}}/>; -+const t4 = x
} {...{ wrong() { return
x
; } }}/>; -+const t5 = x
} {...{ get wrong() { return
x
; } }}/>; -+const t6 = x
} {...{ set wrong(s) { let a =
x
; } }}/>; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js b/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js index 8a2d949514..6f7c1ccc00 100644 --- a/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js +++ b/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js @@ -9,7 +9,7 @@ declare var React: any; //// [keywordInJsxIdentifier.js] -; -; -; -; +React.createElement("foo", { "class-id": true }); +React.createElement("foo", { class: true }); +React.createElement("foo", { "class-id": "1" }); +React.createElement("foo", { class: "1" }); diff --git a/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js.diff b/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js.diff deleted file mode 100644 index b1eaedfd57..0000000000 --- a/testdata/baselines/reference/submodule/compiler/keywordInJsxIdentifier.js.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.keywordInJsxIdentifier.js -+++ new.keywordInJsxIdentifier.js -@@= skipped -8, +8 lines =@@ - - - //// [keywordInJsxIdentifier.js] --React.createElement("foo", { "class-id": true }); --React.createElement("foo", { class: true }); --React.createElement("foo", { "class-id": "1" }); --React.createElement("foo", { class: "1" }); -+; -+; -+; -+; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js b/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js index 207cfd4898..0d0f8da81d 100644 --- a/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js +++ b/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js @@ -15,5 +15,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Foo = Foo; function Foo() { // No error; "const" is lowercase and therefore intrinsic. - return ; + return React.createElement("const", { T: true, extends: true }); } diff --git a/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js.diff b/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js.diff deleted file mode 100644 index c4b450809f..0000000000 --- a/testdata/baselines/reference/submodule/compiler/parseJsxExtends1.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.parseJsxExtends1.js -+++ new.parseJsxExtends1.js -@@= skipped -14, +14 lines =@@ - exports.Foo = Foo; - function Foo() { - // No error; "const" is lowercase and therefore intrinsic. -- return React.createElement("const", { T: true, extends: true }); -+ return ; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js b/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js index 2a6f951b73..7eb967fa99 100644 --- a/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js +++ b/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js @@ -15,5 +15,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Foo = Foo; function Foo() { // Error: T is not declared. - return ; + return React.createElement(T, { extends: true }); } diff --git a/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js.diff b/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js.diff deleted file mode 100644 index cbc2b84832..0000000000 --- a/testdata/baselines/reference/submodule/compiler/parseJsxExtends2.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.parseJsxExtends2.js -+++ new.parseJsxExtends2.js -@@= skipped -14, +14 lines =@@ - exports.Foo = Foo; - function Foo() { - // Error: T is not declared. -- return React.createElement(T, { extends: true }); -+ return ; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js b/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js index fdabf88cc7..bf9f9d3a3f 100644 --- a/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js +++ b/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js @@ -18,13 +18,24 @@ export function wu(CC: F) { //// [quickIntersectionCheckCorrectlyCachesErrors.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.wu = wu; function wu(CC) { class WU { m() { g(CC); - return ; + return React.createElement(CC, __assign({}, null)); } } } diff --git a/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js.diff b/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js.diff index 839c060b29..16535a06f0 100644 --- a/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js.diff +++ b/testdata/baselines/reference/submodule/compiler/quickIntersectionCheckCorrectlyCachesErrors.js.diff @@ -1,20 +1,6 @@ --- old.quickIntersectionCheckCorrectlyCachesErrors.js +++ new.quickIntersectionCheckCorrectlyCachesErrors.js -@@= skipped -17, +17 lines =@@ - - //// [quickIntersectionCheckCorrectlyCachesErrors.js] - "use strict"; --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; +@@= skipped -31, +31 lines =@@ Object.defineProperty(exports, "__esModule", { value: true }); exports.wu = wu; function wu(CC) { @@ -25,11 +11,10 @@ + class WU { + m() { g(CC); -- return React.createElement(CC, __assign({}, null)); + return React.createElement(CC, __assign({}, null)); - }; - return WU; - }()); -+ return ; + } + } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js index 419c4ccf5d..ef4cb2f788 100644 --- a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js +++ b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js @@ -83,37 +83,37 @@ class FieldFeedback extends react_1.default.Component { when: () => true }; render() { - return
Hello
; + return react_1.default.createElement("div", null, "Hello"); } } // OK -const Test1 = () => !!value}/>; +const Test1 = () => react_1.default.createElement(FieldFeedback, { when: value => !!value }); // Error: Void not assignable to boolean -const Test2 = () => console.log(value)}/>; +const Test2 = () => react_1.default.createElement(FieldFeedback, { when: value => console.log(value) }); class FieldFeedbackBeta extends react_1.default.Component { static defaultProps = { when: () => true }; render() { - return
Hello
; + return react_1.default.createElement("div", null, "Hello"); } } // OK -const Test1a = () => !!value} error>Hah; +const Test1a = () => react_1.default.createElement(FieldFeedbackBeta, { when: value => !!value, error: true }, "Hah"); // Error: Void not assignable to boolean -const Test2a = () => console.log(value)} error>Hah; +const Test2a = () => react_1.default.createElement(FieldFeedbackBeta, { when: value => console.log(value), error: true }, "Hah"); class FieldFeedback2 extends FieldFeedback { static defaultProps = { when: () => true }; render() { this.props.when("now"); // OK, always defined - return
Hello
; + return react_1.default.createElement("div", null, "Hello"); } } // OK -const Test3 = () => !!value}/>; +const Test3 = () => react_1.default.createElement(FieldFeedback2, { when: value => !!value }); // Error: Void not assignable to boolean -const Test4 = () => console.log(value)}/>; +const Test4 = () => react_1.default.createElement(FieldFeedback2, { when: value => console.log(value) }); // OK -const Test5 = () => ; +const Test5 = () => react_1.default.createElement(FieldFeedback2, null); diff --git a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js.diff b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js.diff index 8479d5cc9a..52abfbdd5b 100644 --- a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.js.diff @@ -72,47 +72,46 @@ + when: () => true + }; + render() { -+ return
Hello
; ++ return react_1.default.createElement("div", null, "Hello"); + } +} +// OK -+const Test1 = () => !!value}/>; ++const Test1 = () => react_1.default.createElement(FieldFeedback, { when: value => !!value }); +// Error: Void not assignable to boolean -+const Test2 = () => console.log(value)}/>; ++const Test2 = () => react_1.default.createElement(FieldFeedback, { when: value => console.log(value) }); +class FieldFeedbackBeta extends react_1.default.Component { + static defaultProps = { + when: () => true + }; + render() { -+ return
Hello
; ++ return react_1.default.createElement("div", null, "Hello"); + } +} +// OK -+const Test1a = () => !!value} error>Hah; ++const Test1a = () => react_1.default.createElement(FieldFeedbackBeta, { when: value => !!value, error: true }, "Hah"); +// Error: Void not assignable to boolean -+const Test2a = () => console.log(value)} error>Hah; ++const Test2a = () => react_1.default.createElement(FieldFeedbackBeta, { when: value => console.log(value), error: true }, "Hah"); +class FieldFeedback2 extends FieldFeedback { + static defaultProps = { + when: () => true + }; + render() { this.props.when("now"); // OK, always defined -- return react_1.default.createElement("div", null, "Hello"); + return react_1.default.createElement("div", null, "Hello"); - }; - FieldFeedback2.defaultProps = { - when: function () { return true; } - }; - return FieldFeedback2; -}(FieldFeedback)); -+ return
Hello
; + } +} // OK -var Test3 = function () { return react_1.default.createElement(FieldFeedback2, { when: function (value) { return !!value; } }); }; -+const Test3 = () => !!value}/>; ++const Test3 = () => react_1.default.createElement(FieldFeedback2, { when: value => !!value }); // Error: Void not assignable to boolean -var Test4 = function () { return react_1.default.createElement(FieldFeedback2, { when: function (value) { return console.log(value); } }); }; -+const Test4 = () => console.log(value)}/>; ++const Test4 = () => react_1.default.createElement(FieldFeedback2, { when: value => console.log(value) }); // OK -var Test5 = function () { return react_1.default.createElement(FieldFeedback2, null); }; -+const Test5 = () => ; \ No newline at end of file ++const Test5 = () => react_1.default.createElement(FieldFeedback2, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js b/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js index f8f014bd4d..b9117b4716 100644 --- a/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js +++ b/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js @@ -14,13 +14,24 @@ function f

(App: React.ComponentClass

| React.StatelessComponent

): void //// [reactHOCSpreadprops.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); function f(App) { class C extends React.Component { render() { - return ; + return React.createElement(App, __assign({}, this.props)); } } } diff --git a/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js.diff b/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js.diff index 66cf6929ce..1fb74ea82b 100644 --- a/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactHOCSpreadprops.js.diff @@ -19,17 +19,11 @@ - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -28, +13 lines =@@ + }; Object.defineProperty(exports, "__esModule", { value: true }); /// -var React = require("react"); @@ -39,14 +33,14 @@ - __extends(C, _super); - function C() { - return _super !== null && _super.apply(this, arguments) || this; +- } +- C.prototype.render = function () { + class C extends React.Component { + render() { -+ return ; - } -- C.prototype.render = function () { -- return React.createElement(App, __assign({}, this.props)); + return React.createElement(App, __assign({}, this.props)); - }; - return C; - }(React.Component)); ++ } + } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js index 49803a925e..a0af265648 100644 --- a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js @@ -17,9 +17,10 @@ export function Foo() { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Foo = Foo; +const jsx_runtime_1 = require("react/jsx-runtime"); function Bar() { - return

; + return jsx_runtime_1.jsx("div", {}); } function Foo() { - return ; + return jsx_runtime_1.jsx(Bar, {}); } diff --git a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js.diff index 7ef5c9130d..91bec7f3ec 100644 --- a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsx).js.diff @@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Foo = Foo; -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); function Bar() { - return (0, jsx_runtime_1.jsx)("div", {}); -+ return
; ++ return jsx_runtime_1.jsx("div", {}); } function Foo() { - return (0, jsx_runtime_1.jsx)(Bar, {}); -+ return ; ++ return jsx_runtime_1.jsx(Bar, {}); } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js index 49803a925e..320099909f 100644 --- a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js +++ b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js @@ -17,9 +17,11 @@ export function Foo() { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Foo = Foo; +const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +const _jsxFileName = "index.tsx"; function Bar() { - return
; + return jsx_dev_runtime_1.jsxDEV("div", {}, void 0, false, { fileName: _jsxFileName, lineNumber: 6, columnNumber: 9 }, this); } function Foo() { - return ; + return jsx_dev_runtime_1.jsxDEV(Bar, {}, void 0, false, { fileName: _jsxFileName, lineNumber: 10, columnNumber: 9 }, this); } diff --git a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js.diff b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js.diff index 7f1bacd6e1..9545d5592e 100644 --- a/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactImportUnusedInNewJSXEmit(jsx=react-jsxdev).js.diff @@ -6,11 +6,13 @@ exports.Foo = Foo; -var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); -var _jsxFileName = "index.tsx"; ++const jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); ++const _jsxFileName = "index.tsx"; function Bar() { - return (0, jsx_dev_runtime_1.jsxDEV)("div", {}, void 0, false, { fileName: _jsxFileName, lineNumber: 6, columnNumber: 9 }, this); -+ return
; ++ return jsx_dev_runtime_1.jsxDEV("div", {}, void 0, false, { fileName: _jsxFileName, lineNumber: 6, columnNumber: 9 }, this); } function Foo() { - return (0, jsx_dev_runtime_1.jsxDEV)(Bar, {}, void 0, false, { fileName: _jsxFileName, lineNumber: 10, columnNumber: 9 }, this); -+ return ; ++ return jsx_dev_runtime_1.jsxDEV(Bar, {}, void 0, false, { fileName: _jsxFileName, lineNumber: 10, columnNumber: 9 }, this); } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js index f1f52df8fa..09f207a3fe 100644 --- a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js @@ -23,4 +23,5 @@ import './'; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; -exports.a =
; +const jsx_runtime_1 = require("react/jsx-runtime"); +exports.a = jsx_runtime_1.jsx("div", {}); diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js.diff b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js.diff index 197dbb7c26..ca2db47dbb 100644 --- a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js.diff @@ -1,9 +1,8 @@ --- old.reactJsxReactResolvedNodeNext.js +++ new.reactJsxReactResolvedNodeNext.js -@@= skipped -22, +22 lines =@@ - "use strict"; +@@= skipped -23, +23 lines =@@ Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; --const jsx_runtime_1 = require("react/jsx-runtime"); + const jsx_runtime_1 = require("react/jsx-runtime"); -exports.a = (0, jsx_runtime_1.jsx)("div", {}); -+exports.a =
; \ No newline at end of file ++exports.a = jsx_runtime_1.jsx("div", {}); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js index 33c96157cc..834a8fa145 100644 --- a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js @@ -28,4 +28,5 @@ import './'; //// [file.js] -export const a =
; +import { jsx as _jsx } from "react/jsx-runtime"; +export const a = _jsx("div", {}); diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js.diff b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js.diff deleted file mode 100644 index 49cfb6b1d4..0000000000 --- a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.reactJsxReactResolvedNodeNextEsm.js -+++ new.reactJsxReactResolvedNodeNextEsm.js -@@= skipped -27, +27 lines =@@ - - - //// [file.js] --import { jsx as _jsx } from "react/jsx-runtime"; --export const a = _jsx("div", {}); -+export const a =
; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js b/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js index 6c5fdf0ee5..2270ef915e 100644 --- a/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js +++ b/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js @@ -5,4 +5,4 @@ //// [reactNamespaceInvalidInput.js] -; +my-React-Lib.createElement("foo", { data: true }); diff --git a/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js.diff b/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js.diff deleted file mode 100644 index d7a2b82cd9..0000000000 --- a/testdata/baselines/reference/submodule/compiler/reactNamespaceInvalidInput.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.reactNamespaceInvalidInput.js -+++ new.reactNamespaceInvalidInput.js -@@= skipped -4, +4 lines =@@ - - - //// [reactNamespaceInvalidInput.js] --my-React-Lib.createElement("foo", { data: true }); -+; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js b/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js index d4d1827ade..bbacb89338 100644 --- a/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js +++ b/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js @@ -16,9 +16,20 @@ declare var x: any; //// [reactNamespaceJSXEmit.js] -; -; -; -; -; -<_Bar {...x}/>; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +myReactLib.createElement("foo", { data: true }); +myReactLib.createElement(Bar, { x: x }); +myReactLib.createElement("x-component", null); +myReactLib.createElement(Bar, __assign({}, x)); +myReactLib.createElement(Bar, __assign({}, x, { y: 2 })); +myReactLib.createElement(_Bar, __assign({}, x)); diff --git a/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js.diff b/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js.diff deleted file mode 100644 index 1c4ddd04ec..0000000000 --- a/testdata/baselines/reference/submodule/compiler/reactNamespaceJSXEmit.js.diff +++ /dev/null @@ -1,29 +0,0 @@ ---- old.reactNamespaceJSXEmit.js -+++ new.reactNamespaceJSXEmit.js -@@= skipped -15, +15 lines =@@ - - - //// [reactNamespaceJSXEmit.js] --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; --myReactLib.createElement("foo", { data: true }); --myReactLib.createElement(Bar, { x: x }); --myReactLib.createElement("x-component", null); --myReactLib.createElement(Bar, __assign({}, x)); --myReactLib.createElement(Bar, __assign({}, x, { y: 2 })); --myReactLib.createElement(_Bar, __assign({}, x)); -+; -+; -+; -+; -+; -+<_Bar {...x}/>; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js b/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js index eb23980b86..c3777567eb 100644 --- a/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js +++ b/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js @@ -6,4 +6,4 @@ //// [reactNamespaceMissingDeclaration.js] // Error myReactLib not declared -; +myReactLib.createElement("foo", { data: true }); diff --git a/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js.diff b/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js.diff deleted file mode 100644 index 782bf0b1f7..0000000000 --- a/testdata/baselines/reference/submodule/compiler/reactNamespaceMissingDeclaration.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.reactNamespaceMissingDeclaration.js -+++ new.reactNamespaceMissingDeclaration.js -@@= skipped -5, +5 lines =@@ - - //// [reactNamespaceMissingDeclaration.js] - // Error myReactLib not declared --myReactLib.createElement("foo", { data: true }); -+; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js b/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js index 1ff4c7ed40..398c6067ee 100644 --- a/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js +++ b/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js @@ -14,13 +14,24 @@ function myHigherOrderComponent

(Inner: React.ComponentClass

const React = require("react"); function myHigherOrderComponent(Inner) { return class OuterComponent extends React.Component { render() { - return ; + return React.createElement(Inner, __assign({}, this.props, { name: "Matt" })); } }; } diff --git a/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js.diff b/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js.diff index c629b44eed..9013e795a7 100644 --- a/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactReadonlyHOCAssignabilityReal.js.diff @@ -19,17 +19,11 @@ - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -28, +13 lines =@@ + }; Object.defineProperty(exports, "__esModule", { value: true }); /// -var React = require("react"); @@ -39,14 +33,14 @@ - __extends(OuterComponent, _super); - function OuterComponent() { - return _super !== null && _super.apply(this, arguments) || this; +- } +- OuterComponent.prototype.render = function () { + return class OuterComponent extends React.Component { + render() { -+ return ; - } -- OuterComponent.prototype.render = function () { -- return React.createElement(Inner, __assign({}, this.props, { name: "Matt" })); + return React.createElement(Inner, __assign({}, this.props, { name: "Matt" })); - }; - return OuterComponent; - }(React.Component)); ++ } + }; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js b/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js index 58649a0ebd..348085d966 100644 --- a/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js +++ b/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js @@ -39,5 +39,5 @@ const RandomComponent = () => { const OtherComponent = condition2 ? OtherRadio : Checkbox; - return condition1 ? : ; + return condition1 ? React.createElement(Component, null) : React.createElement(OtherComponent, null); }; diff --git a/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js.diff b/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js.diff index 15eeecbdf1..79753b9141 100644 --- a/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactSFCAndFunctionResolvable.js.diff @@ -19,6 +19,4 @@ + const OtherComponent = condition2 ? OtherRadio : Checkbox; -- return condition1 ? React.createElement(Component, null) : React.createElement(OtherComponent, null); -+ return condition1 ? : ; - }; \ No newline at end of file + return condition1 ? React.createElement(Component, null) : React.createElement(OtherComponent, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js index 761b041a70..c7411537fb 100644 --- a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js +++ b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js @@ -15,12 +15,21 @@ const children: any[] = []; //// [reactTagNameComponentWithPropsNoOOM.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); const classes = ""; const rest = {}; const children = []; - -{children} -; +React.createElement(Tag, __assign({ className: classes }, rest), children); diff --git a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js.diff b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js.diff index 183fea55d3..b65c64ca2a 100644 --- a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM.js.diff @@ -5,28 +5,20 @@ //// [reactTagNameComponentWithPropsNoOOM.js] "use strict"; -/// --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -13, +12 lines =@@ + return __assign.apply(this, arguments); + }; Object.defineProperty(exports, "__esModule", { value: true }); -var React = require("react"); -var classes = ""; -var rest = {}; -var children = []; --React.createElement(Tag, __assign({ className: classes }, rest), children); +/// +const React = require("react"); +const classes = ""; +const rest = {}; +const children = []; -+ -+{children} -+; \ No newline at end of file + React.createElement(Tag, __assign({ className: classes }, rest), children); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js index 2ae9c4bb29..39837e0ce6 100644 --- a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js +++ b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js @@ -15,12 +15,21 @@ const children: any[] = []; //// [reactTagNameComponentWithPropsNoOOM2.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; Object.defineProperty(exports, "__esModule", { value: true }); /// const React = require("react"); const classes = ""; const rest = {}; const children = []; - -{children} -; +React.createElement(Tag, __assign({ className: classes }, rest), children); diff --git a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js.diff b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js.diff index 878cf93db7..3e31279126 100644 --- a/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js.diff +++ b/testdata/baselines/reference/submodule/compiler/reactTagNameComponentWithPropsNoOOM2.js.diff @@ -5,28 +5,20 @@ //// [reactTagNameComponentWithPropsNoOOM2.js] "use strict"; -/// --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -13, +12 lines =@@ + return __assign.apply(this, arguments); + }; Object.defineProperty(exports, "__esModule", { value: true }); -var React = require("react"); -var classes = ""; -var rest = {}; -var children = []; --React.createElement(Tag, __assign({ className: classes }, rest), children); +/// +const React = require("react"); +const classes = ""; +const rest = {}; +const children = []; -+ -+{children} -+; \ No newline at end of file + React.createElement(Tag, __assign({ className: classes }, rest), children); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js b/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js index 23b52e4400..9aa3fb3d00 100644 --- a/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js +++ b/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js @@ -30,4 +30,4 @@ class TestComponent extends React.Component { return true; } } -const TestRender = () => ; +const TestRender = () => React.createElement(TestComponent, null); diff --git a/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js.diff b/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js.diff index c7b54cf6c8..53badffeb9 100644 --- a/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js.diff +++ b/testdata/baselines/reference/submodule/compiler/returnTypePredicateIsInstantiateInContextOfTarget.js.diff @@ -45,4 +45,4 @@ -var TestRender = function () { return React.createElement(TestComponent, null); }; + } +} -+const TestRender = () => ; \ No newline at end of file ++const TestRender = () => React.createElement(TestComponent, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.js b/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.js index c6dda133af..84a1006910 100644 --- a/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.js +++ b/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.js @@ -28,11 +28,11 @@ function MyComp2(props) { } class MyComp extends React.Component { } -; -; // should have no fix -; -+; // should have no fix -+

; //// [spreadIntersectionJsx.js] +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; const React = null; class A { a; @@ -17,4 +28,4 @@ class C { c; } let intersected; -let element =
; +let element = React.createElement("div", __assign({}, intersected)); diff --git a/testdata/baselines/reference/submodule/compiler/spreadIntersectionJsx.js.diff b/testdata/baselines/reference/submodule/compiler/spreadIntersectionJsx.js.diff index 46f887874d..999928b8fe 100644 --- a/testdata/baselines/reference/submodule/compiler/spreadIntersectionJsx.js.diff +++ b/testdata/baselines/reference/submodule/compiler/spreadIntersectionJsx.js.diff @@ -1,20 +1,9 @@ --- old.spreadIntersectionJsx.js +++ new.spreadIntersectionJsx.js -@@= skipped -8, +8 lines =@@ - - - //// [spreadIntersectionJsx.js] --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; +@@= skipped -19, +19 lines =@@ + }; + return __assign.apply(this, arguments); + }; -var React = null; -var A = /** @class */ (function () { - function A() { @@ -36,4 +25,4 @@ + c; +} +let intersected; -+let element =
; \ No newline at end of file ++let element = React.createElement("div", __assign({}, intersected)); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js b/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js index 256f7d6a14..83bede6793 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js +++ b/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js @@ -25,4 +25,4 @@ function createElement(name, attributes, ...contents) { function Button(attributes, contents) { return ''; } -const b = ; +const b = createElement(Button, null); diff --git a/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js.diff b/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js.diff index 9b910f4c47..b4fd10f5e2 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxAttributesHasInferrableIndex.js.diff @@ -17,4 +17,4 @@ return ''; } -var b = createElement(Button, null); -+const b = ; \ No newline at end of file ++const b = createElement(Button, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js b/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js index 9cdd36fd93..bcb2cfc921 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js +++ b/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js @@ -31,7 +31,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.MyComponent = MyComponent; const React = require("react"); function MyComponent(_props) { - return my component; + return React.createElement("span", null, "my component"); } //// [file1.js] "use strict"; @@ -39,6 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.result = void 0; const React = require("react"); const my_component_1 = require("./my-component"); -exports.result = ; + } }); diff --git a/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js.diff b/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js.diff index 43070d3c08..8d42623c29 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxDeepAttributeAssignabilityError.js.diff @@ -7,19 +7,16 @@ -var React = require("react"); +const React = require("react"); function MyComponent(_props) { -- return React.createElement("span", null, "my component"); -+ return my component; + return React.createElement("span", null, "my component"); } - //// [file1.js] +@@= skipped -8, +8 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.result = void 0; -var React = require("react"); -var my_component_1 = require("./my-component"); --exports.result = React.createElement(my_component_1.MyComponent, { x: "yes", y: { +const React = require("react"); +const my_component_1 = require("./my-component"); -+exports.result = ; \ No newline at end of file + } }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js index 5c33c92601..5eacef6509 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js +++ b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js @@ -33,7 +33,7 @@ export default RenderString Object.defineProperty(exports, "__esModule", { value: true }); exports.MyComponent = MyComponent; function MyComponent(props) { - return my component; + return React.createElement("span", null, "my component"); } //// [file1.js] "use strict"; @@ -44,11 +44,7 @@ const MY_STRING = 'Ceci n\'est pas une string.'; const MY_CLASSNAME = 'jeclass'; class RenderString extends React.PureComponent { render() { - return (<> - - {MY_STRING} - - ); + return (React.createElement(React.Fragment, null, React.createElement(my_component_1.MyComponent, null), React.createElement("span", null, MY_STRING), React.createElement("span", { className: MY_CLASSNAME }))); } } exports.default = RenderString; diff --git a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff index 42b6a7b064..001ed3813b 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff @@ -1,11 +1,6 @@ --- old.tsxFragmentChildrenCheck.js +++ new.tsxFragmentChildrenCheck.js -@@= skipped -32, +32 lines =@@ - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MyComponent = MyComponent; - function MyComponent(props) { -- return React.createElement("span", null, "my component"); -+ return my component; +@@= skipped -36, +36 lines =@@ } //// [file1.js] "use strict"; @@ -39,11 +34,7 @@ +const MY_CLASSNAME = 'jeclass'; +class RenderString extends React.PureComponent { + render() { -+ return (<> -+ -+ {MY_STRING} -+ -+ ); ++ return (React.createElement(React.Fragment, null, React.createElement(my_component_1.MyComponent, null), React.createElement("span", null, MY_STRING), React.createElement("span", { className: MY_CLASSNAME }))); } - RenderString.prototype.render = function () { - return (React.createElement(React.Fragment, null, diff --git a/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js b/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js index 00771c90a4..38c16c0bed 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js +++ b/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js @@ -22,6 +22,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); /// const react_1 = __importDefault(require("react")); -const bad = ; -const good = ; -const alsoOk = text; +const bad = react_1.default.createElement(Elem, null); +const good = react_1.default.createElement(Elem, { someKey: "ok" }); +const alsoOk = react_1.default.createElement(Elem2, null, "text"); diff --git a/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js.diff b/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js.diff index 744da82e2a..94fa349e7c 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxInvokeComponentType.js.diff @@ -9,6 +9,6 @@ -var good = react_1.default.createElement(Elem, { someKey: "ok" }); -var alsoOk = react_1.default.createElement(Elem2, null, "text"); +const react_1 = __importDefault(require("react")); -+const bad = ; -+const good = ; -+const alsoOk = text; \ No newline at end of file ++const bad = react_1.default.createElement(Elem, null); ++const good = react_1.default.createElement(Elem, { someKey: "ok" }); ++const alsoOk = react_1.default.createElement(Elem2, null, "text"); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js index 8f68db70c6..37e3dbd216 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js +++ b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js @@ -23,6 +23,17 @@ function test

(wrappedProps: P) { //// [tsxNotUsingApparentTypeOfSFC.js] "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -31,15 +42,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importDefault(require("react")); function test(wrappedProps) { let MySFC = function (props) { - return <>hello; + return react_1.default.createElement(react_1.default.Fragment, null, "hello"); }; class MyComponent extends react_1.default.Component { render() { - return <>hello; + return react_1.default.createElement(react_1.default.Fragment, null, "hello"); } } - let x = ; // should error - let y = ; // should error - let z = ; // should work - let q = ; // should work + let x = react_1.default.createElement(MySFC, null); // should error + let y = react_1.default.createElement(MyComponent, null); // should error + let z = react_1.default.createElement(MySFC, __assign({}, wrappedProps)); // should work + let q = react_1.default.createElement(MyComponent, __assign({}, wrappedProps)); // should work } diff --git a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js.diff b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js.diff index 2b675d848b..4d9fc9f526 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.js.diff @@ -20,18 +20,10 @@ - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; - var __importDefault = (this && this.__importDefault) || function (mod) { + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { +@@= skipped -31, +15 lines =@@ return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); @@ -40,20 +32,18 @@ +const react_1 = __importDefault(require("react")); function test(wrappedProps) { - var MySFC = function (props) { -- return react_1.default.createElement(react_1.default.Fragment, null, "hello"); + let MySFC = function (props) { -+ return <>hello; + return react_1.default.createElement(react_1.default.Fragment, null, "hello"); }; - var MyComponent = /** @class */ (function (_super) { - __extends(MyComponent, _super); - function MyComponent() { - return _super !== null && _super.apply(this, arguments) || this; +- } +- MyComponent.prototype.render = function () { + class MyComponent extends react_1.default.Component { + render() { -+ return <>hello; - } -- MyComponent.prototype.render = function () { -- return react_1.default.createElement(react_1.default.Fragment, null, "hello"); + return react_1.default.createElement(react_1.default.Fragment, null, "hello"); - }; - return MyComponent; - }(react_1.default.Component)); @@ -61,9 +51,10 @@ - var y = react_1.default.createElement(MyComponent, null); // should error - var z = react_1.default.createElement(MySFC, __assign({}, wrappedProps)); // should work - var q = react_1.default.createElement(MyComponent, __assign({}, wrappedProps)); // should work ++ } + } -+ let x = ; // should error -+ let y = ; // should error -+ let z = ; // should work -+ let q = ; // should work ++ let x = react_1.default.createElement(MySFC, null); // should error ++ let y = react_1.default.createElement(MyComponent, null); // should error ++ let z = react_1.default.createElement(MySFC, __assign({}, wrappedProps)); // should work ++ let q = react_1.default.createElement(MyComponent, __assign({}, wrappedProps)); // should work } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxReactPropsInferenceSucceedsOnIntersections.js b/testdata/baselines/reference/submodule/compiler/tsxReactPropsInferenceSucceedsOnIntersections.js index fbf8a84002..6a231bf839 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxReactPropsInferenceSucceedsOnIntersections.js +++ b/testdata/baselines/reference/submodule/compiler/tsxReactPropsInferenceSucceedsOnIntersections.js @@ -20,10 +20,21 @@ const CustomButton: React.SFC = props => ; +let k = React.createElement("button", Object.assign({}, buttonProps), React.createElement("span", { className: cx('class1', { class2: true }) })); diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js.diff b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js.diff index 480b7cf280..f11c5b03e2 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js.diff +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js.diff @@ -6,6 +6,4 @@ let buttonProps; // any -let k = React.createElement("button", Object.assign({}, buttonProps), - React.createElement("span", { className: cx('class1', { class2: true }) })); -+let k = ; \ No newline at end of file ++let k = React.createElement("button", Object.assign({}, buttonProps), React.createElement("span", { className: cx('class1', { class2: true }) })); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js index a77f30190e..fde8858581 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js @@ -19,6 +19,4 @@ let k = ; +let k = React.createElement("button", Object.assign({}, buttonProps), React.createElement("span", { className: cx('class1', { class2: true }) })); diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js.diff b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js.diff index 2f24f932f4..7596308bd4 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js.diff @@ -6,6 +6,4 @@ let buttonProps; -let k = React.createElement("button", Object.assign({}, buttonProps), - React.createElement("span", { className: cx('class1', { class2: true }) })); -+let k = ; \ No newline at end of file ++let k = React.createElement("button", Object.assign({}, buttonProps), React.createElement("span", { className: cx('class1', { class2: true }) })); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js index a544cb1e3a..f446ea7728 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js @@ -19,6 +19,4 @@ let k = ; +let k = React.createElement("button", Object.assign({}, buttonProps), React.createElement("span", { className: cx('class1', { class2: true }) })); diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js.diff b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js.diff index 9e2100dceb..8b4c8d2664 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js.diff +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js.diff @@ -6,6 +6,4 @@ let buttonProps; -let k = React.createElement("button", Object.assign({}, buttonProps), - React.createElement("span", { className: cx('class1', { class2: true }) })); -+let k = ; \ No newline at end of file ++let k = React.createElement("button", Object.assign({}, buttonProps), React.createElement("span", { className: cx('class1', { class2: true }) })); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences4.js b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences4.js index 58c0b77894..631d06cc5b 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences4.js +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences4.js @@ -16,4 +16,4 @@ let k = -

-
-
-
- )} - - - ; +let render = (ctrl, model) => vdom.createElement("section", { class: "todoapp" }, vdom.createElement("header", { class: "header" }, vdom.createElement("h1", null, "todos <x>"), vdom.createElement("input", { class: "new-todo", autofocus: true, autocomplete: "off", placeholder: "What needs to be done?", value: model.newTodo, onKeyup: ctrl.addTodo.bind(ctrl, model) })), vdom.createElement("section", { class: "main", style: { display: (model.todos && model.todos.length) ? "block" : "none" } }, vdom.createElement("input", { class: "toggle-all", type: "checkbox", onChange: ctrl.toggleAll.bind(ctrl) }), vdom.createElement("ul", { class: "todo-list" }, model.filteredTodos.map((todo) => vdom.createElement("li", { class: { todo: true, completed: todo.completed, editing: todo == model.editedTodo } }, vdom.createElement("div", { class: "view" }, (!todo.editable) ? + vdom.createElement("input", { class: "toggle", type: "checkbox" }) + : null, vdom.createElement("label", { onDoubleClick: () => { ctrl.editTodo(todo); } }, todo.title), vdom.createElement("button", { class: "destroy", onClick: ctrl.removeTodo.bind(ctrl, todo) }), vdom.createElement("div", { class: "iconBorder" }, vdom.createElement("div", { class: "icon" })))))))); diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitNesting.js.diff b/testdata/baselines/reference/submodule/conformance/tsxReactEmitNesting.js.diff index e495799e5a..7683cd4fcb 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitNesting.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitNesting.js.diff @@ -23,26 +23,6 @@ - vdom.createElement("div", { class: "icon" })))); - })))); -}; -+let render = (ctrl, model) =>
-+
-+

todos <x>

-+ -+
-+
-+ -+
    -+ {model.filteredTodos.map((todo) =>
  • -+
    -+ {(!todo.editable) ? -+ -+ : null} -+ -+ -+
    -+
    -+
    -+
    -+
  • )} -+
-+
-+
; \ No newline at end of file ++let render = (ctrl, model) => vdom.createElement("section", { class: "todoapp" }, vdom.createElement("header", { class: "header" }, vdom.createElement("h1", null, "todos <x>"), vdom.createElement("input", { class: "new-todo", autofocus: true, autocomplete: "off", placeholder: "What needs to be done?", value: model.newTodo, onKeyup: ctrl.addTodo.bind(ctrl, model) })), vdom.createElement("section", { class: "main", style: { display: (model.todos && model.todos.length) ? "block" : "none" } }, vdom.createElement("input", { class: "toggle-all", type: "checkbox", onChange: ctrl.toggleAll.bind(ctrl) }), vdom.createElement("ul", { class: "todo-list" }, model.filteredTodos.map((todo) => vdom.createElement("li", { class: { todo: true, completed: todo.completed, editing: todo == model.editedTodo } }, vdom.createElement("div", { class: "view" }, (!todo.editable) ? ++ vdom.createElement("input", { class: "toggle", type: "checkbox" }) ++ : null, vdom.createElement("label", { onDoubleClick: () => { ctrl.editTodo(todo); } }, todo.title), vdom.createElement("button", { class: "destroy", onClick: ctrl.removeTodo.bind(ctrl, todo) }), vdom.createElement("div", { class: "iconBorder" }, vdom.createElement("div", { class: "icon" })))))))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js index e403aeb27d..89ae8bd5cc 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js @@ -55,40 +55,41 @@ export function T12(a: any, b: any, c: any, d: any) { //// [test.js] +import { jsx as _jsx } from "react/jsx-runtime"; /// export function T1(a) { - return
T1
; + return _jsx("div", Object.assign({ className: "T1" }, a, { children: "T1" })); } export function T2(a, b) { - return
T2
; + return _jsx("div", Object.assign({ className: "T2" }, a, b, { children: "T2" })); } export function T3(a, b) { - return
T3
; + return _jsx("div", Object.assign({}, a, { className: "T3" }, b, { children: "T3" })); } export function T4(a, b) { - return
T4
; + return _jsx("div", Object.assign({ className: "T4" }, a, b, { children: "T4" })); } export function T5(a, b, c, d) { - return
T5
; + return _jsx("div", Object.assign({ className: "T5" }, a, b, { c, d }, { children: "T5" })); } export function T6(a, b, c, d) { - return
T6
; + return _jsx("div", Object.assign({ className: "T6" }, a, b, { ...c, ...d }, { children: "T6" })); } export function T7(a, b, c, d) { - return
T7
; + return _jsx("div", { children: "T7" }); } export function T8(a, b, c, d) { - return
T8
; + return _jsx("div", Object.assign({ className: "T8" }, { __proto__: null, dir: 'rtl' }, { children: "T8" })); } export function T9(a, b, c, d) { - return
T9
; + return _jsx("div", Object.assign({ className: "T9" }, { "__proto__": null }, { children: "T9" })); } export function T10(a, b, c, d) { - return
T10
; + return _jsx("div", { className: "T10", [__proto__]: null, children: "T10" }); } export function T11(a, b, c, d) { - return
T11
; + return _jsx("div", { className: "T11", ["__proto__"]: null, children: "T11" }); } export function T12(a, b, c, d) { - return
T12
; + return _jsx("div", { className: "T12", __proto__, children: "T12" }); } diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js.diff b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js.diff index d5be0980bd..eb7ce0adcf 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2015).js.diff @@ -1,56 +1,11 @@ --- old.tsxReactEmitSpreadAttribute(target=es2015).js +++ new.tsxReactEmitSpreadAttribute(target=es2015).js -@@= skipped -54, +54 lines =@@ - - - //// [test.js] --import { jsx as _jsx } from "react/jsx-runtime"; - /// - export function T1(a) { -- return _jsx("div", Object.assign({ className: "T1" }, a, { children: "T1" })); -+ return
T1
; - } - export function T2(a, b) { -- return _jsx("div", Object.assign({ className: "T2" }, a, b, { children: "T2" })); -+ return
T2
; - } - export function T3(a, b) { -- return _jsx("div", Object.assign({}, a, { className: "T3" }, b, { children: "T3" })); -+ return
T3
; - } - export function T4(a, b) { -- return _jsx("div", Object.assign({ className: "T4" }, a, b, { children: "T4" })); -+ return
T4
; - } - export function T5(a, b, c, d) { -- return _jsx("div", Object.assign({ className: "T5" }, a, b, { c, d }, { children: "T5" })); -+ return
T5
; +@@= skipped -72, +72 lines =@@ + return _jsx("div", Object.assign({ className: "T5" }, a, b, { c, d }, { children: "T5" })); } export function T6(a, b, c, d) { - return _jsx("div", Object.assign({ className: "T6" }, a, b, Object.assign(Object.assign({}, c), d), { children: "T6" })); -+ return
T6
; ++ return _jsx("div", Object.assign({ className: "T6" }, a, b, { ...c, ...d }, { children: "T6" })); } export function T7(a, b, c, d) { -- return _jsx("div", { children: "T7" }); -+ return
T7
; - } - export function T8(a, b, c, d) { -- return _jsx("div", Object.assign({ className: "T8" }, { __proto__: null, dir: 'rtl' }, { children: "T8" })); -+ return
T8
; - } - export function T9(a, b, c, d) { -- return _jsx("div", Object.assign({ className: "T9" }, { "__proto__": null }, { children: "T9" })); -+ return
T9
; - } - export function T10(a, b, c, d) { -- return _jsx("div", { className: "T10", [__proto__]: null, children: "T10" }); -+ return
T10
; - } - export function T11(a, b, c, d) { -- return _jsx("div", { className: "T11", ["__proto__"]: null, children: "T11" }); -+ return
T11
; - } - export function T12(a, b, c, d) { -- return _jsx("div", { className: "T12", __proto__, children: "T12" }); -+ return
T12
; - } \ No newline at end of file + return _jsx("div", { children: "T7" }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js index e403aeb27d..87162bbccc 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js @@ -55,40 +55,41 @@ export function T12(a: any, b: any, c: any, d: any) { //// [test.js] +import { jsx as _jsx } from "react/jsx-runtime"; /// export function T1(a) { - return
T1
; + return _jsx("div", { className: "T1", ...a, children: "T1" }); } export function T2(a, b) { - return
T2
; + return _jsx("div", { className: "T2", ...a, ...b, children: "T2" }); } export function T3(a, b) { - return
T3
; + return _jsx("div", { ...a, className: "T3", ...b, children: "T3" }); } export function T4(a, b) { - return
T4
; + return _jsx("div", { className: "T4", ...a, ...b, children: "T4" }); } export function T5(a, b, c, d) { - return
T5
; + return _jsx("div", { className: "T5", ...a, ...b, ...{ c, d }, children: "T5" }); } export function T6(a, b, c, d) { - return
T6
; + return _jsx("div", { className: "T6", ...a, ...b, ...{ ...c, ...d }, children: "T6" }); } export function T7(a, b, c, d) { - return
T7
; + return _jsx("div", { children: "T7" }); } export function T8(a, b, c, d) { - return
T8
; + return _jsx("div", { className: "T8", ...{ __proto__: null, dir: 'rtl' }, children: "T8" }); } export function T9(a, b, c, d) { - return
T9
; + return _jsx("div", { className: "T9", ...{ "__proto__": null }, children: "T9" }); } export function T10(a, b, c, d) { - return
T10
; + return _jsx("div", { className: "T10", [__proto__]: null, children: "T10" }); } export function T11(a, b, c, d) { - return
T11
; + return _jsx("div", { className: "T11", ["__proto__"]: null, children: "T11" }); } export function T12(a, b, c, d) { - return
T12
; + return _jsx("div", { className: "T12", __proto__, children: "T12" }); } diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js.diff b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js.diff deleted file mode 100644 index d206d9b247..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=es2018).js.diff +++ /dev/null @@ -1,56 +0,0 @@ ---- old.tsxReactEmitSpreadAttribute(target=es2018).js -+++ new.tsxReactEmitSpreadAttribute(target=es2018).js -@@= skipped -54, +54 lines =@@ - - - //// [test.js] --import { jsx as _jsx } from "react/jsx-runtime"; - /// - export function T1(a) { -- return _jsx("div", { className: "T1", ...a, children: "T1" }); -+ return
T1
; - } - export function T2(a, b) { -- return _jsx("div", { className: "T2", ...a, ...b, children: "T2" }); -+ return
T2
; - } - export function T3(a, b) { -- return _jsx("div", { ...a, className: "T3", ...b, children: "T3" }); -+ return
T3
; - } - export function T4(a, b) { -- return _jsx("div", { className: "T4", ...a, ...b, children: "T4" }); -+ return
T4
; - } - export function T5(a, b, c, d) { -- return _jsx("div", { className: "T5", ...a, ...b, ...{ c, d }, children: "T5" }); -+ return
T5
; - } - export function T6(a, b, c, d) { -- return _jsx("div", { className: "T6", ...a, ...b, ...{ ...c, ...d }, children: "T6" }); -+ return
T6
; - } - export function T7(a, b, c, d) { -- return _jsx("div", { children: "T7" }); -+ return
T7
; - } - export function T8(a, b, c, d) { -- return _jsx("div", { className: "T8", ...{ __proto__: null, dir: 'rtl' }, children: "T8" }); -+ return
T8
; - } - export function T9(a, b, c, d) { -- return _jsx("div", { className: "T9", ...{ "__proto__": null }, children: "T9" }); -+ return
T9
; - } - export function T10(a, b, c, d) { -- return _jsx("div", { className: "T10", [__proto__]: null, children: "T10" }); -+ return
T10
; - } - export function T11(a, b, c, d) { -- return _jsx("div", { className: "T11", ["__proto__"]: null, children: "T11" }); -+ return
T11
; - } - export function T12(a, b, c, d) { -- return _jsx("div", { className: "T12", __proto__, children: "T12" }); -+ return
T12
; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js index e403aeb27d..87162bbccc 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js @@ -55,40 +55,41 @@ export function T12(a: any, b: any, c: any, d: any) { //// [test.js] +import { jsx as _jsx } from "react/jsx-runtime"; /// export function T1(a) { - return
T1
; + return _jsx("div", { className: "T1", ...a, children: "T1" }); } export function T2(a, b) { - return
T2
; + return _jsx("div", { className: "T2", ...a, ...b, children: "T2" }); } export function T3(a, b) { - return
T3
; + return _jsx("div", { ...a, className: "T3", ...b, children: "T3" }); } export function T4(a, b) { - return
T4
; + return _jsx("div", { className: "T4", ...a, ...b, children: "T4" }); } export function T5(a, b, c, d) { - return
T5
; + return _jsx("div", { className: "T5", ...a, ...b, ...{ c, d }, children: "T5" }); } export function T6(a, b, c, d) { - return
T6
; + return _jsx("div", { className: "T6", ...a, ...b, ...{ ...c, ...d }, children: "T6" }); } export function T7(a, b, c, d) { - return
T7
; + return _jsx("div", { children: "T7" }); } export function T8(a, b, c, d) { - return
T8
; + return _jsx("div", { className: "T8", ...{ __proto__: null, dir: 'rtl' }, children: "T8" }); } export function T9(a, b, c, d) { - return
T9
; + return _jsx("div", { className: "T9", ...{ "__proto__": null }, children: "T9" }); } export function T10(a, b, c, d) { - return
T10
; + return _jsx("div", { className: "T10", [__proto__]: null, children: "T10" }); } export function T11(a, b, c, d) { - return
T11
; + return _jsx("div", { className: "T11", ["__proto__"]: null, children: "T11" }); } export function T12(a, b, c, d) { - return
T12
; + return _jsx("div", { className: "T12", __proto__, children: "T12" }); } diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js.diff b/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js.diff deleted file mode 100644 index 7ed74518c3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitSpreadAttribute(target=esnext).js.diff +++ /dev/null @@ -1,56 +0,0 @@ ---- old.tsxReactEmitSpreadAttribute(target=esnext).js -+++ new.tsxReactEmitSpreadAttribute(target=esnext).js -@@= skipped -54, +54 lines =@@ - - - //// [test.js] --import { jsx as _jsx } from "react/jsx-runtime"; - /// - export function T1(a) { -- return _jsx("div", { className: "T1", ...a, children: "T1" }); -+ return
T1
; - } - export function T2(a, b) { -- return _jsx("div", { className: "T2", ...a, ...b, children: "T2" }); -+ return
T2
; - } - export function T3(a, b) { -- return _jsx("div", { ...a, className: "T3", ...b, children: "T3" }); -+ return
T3
; - } - export function T4(a, b) { -- return _jsx("div", { className: "T4", ...a, ...b, children: "T4" }); -+ return
T4
; - } - export function T5(a, b, c, d) { -- return _jsx("div", { className: "T5", ...a, ...b, ...{ c, d }, children: "T5" }); -+ return
T5
; - } - export function T6(a, b, c, d) { -- return _jsx("div", { className: "T6", ...a, ...b, ...{ ...c, ...d }, children: "T6" }); -+ return
T6
; - } - export function T7(a, b, c, d) { -- return _jsx("div", { children: "T7" }); -+ return
T7
; - } - export function T8(a, b, c, d) { -- return _jsx("div", { className: "T8", ...{ __proto__: null, dir: 'rtl' }, children: "T8" }); -+ return
T8
; - } - export function T9(a, b, c, d) { -- return _jsx("div", { className: "T9", ...{ "__proto__": null }, children: "T9" }); -+ return
T9
; - } - export function T10(a, b, c, d) { -- return _jsx("div", { className: "T10", [__proto__]: null, children: "T10" }); -+ return
T10
; - } - export function T11(a, b, c, d) { -- return _jsx("div", { className: "T11", ["__proto__"]: null, children: "T11" }); -+ return
T11
; - } - export function T12(a, b, c, d) { -- return _jsx("div", { className: "T12", __proto__, children: "T12" }); -+ return
T12
; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js index a08ce93c49..15701f97f9 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js @@ -71,45 +71,24 @@ world // WHITESPACE, DO NOT RUN 'FORMAT DOCUMENT' ON IT var p = 0; // Emit " " -
; +React.createElement("div", null, " "); // Emit " ", p, " " -
{p}
; +React.createElement("div", null, " ", p, " "); // Emit only p -
- {p} -
; +React.createElement("div", null, p); // Emit only p -
- {p} -
; +React.createElement("div", null, p); // Emit " 3" -
3 -
; +React.createElement("div", null, " "); // Emit " 3 " -
3
; +React.createElement("div", null, " 3 "); // Emit "3" -
- 3 -
; +React.createElement("div", null); // Emit no args -
-
; +React.createElement("div", null); // Emit "foo bar" -
- - foo - - bar - -
; +React.createElement("div", null, "fo ba"); // Emit "hello\\ world" -
- - hello\ - -world -
; +React.createElement("div", null, "hello worl"); // Emit " a b c d " -
a - b c - d
; +React.createElement("div", null, " b d "); diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js.diff b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js.diff index 3603bfcb92..2bcd69a1d3 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js.diff @@ -1,64 +1,34 @@ --- old.tsxReactEmitWhitespace.js +++ new.tsxReactEmitWhitespace.js -@@= skipped -70, +70 lines =@@ - // WHITESPACE, DO NOT RUN 'FORMAT DOCUMENT' ON IT - var p = 0; +@@= skipped -72, +72 lines =@@ // Emit " " --React.createElement("div", null, " "); -+
; + React.createElement("div", null, " "); // Emit " ", p, " " -React.createElement("div", null, - " ", - p, - " "); --// Emit only p --React.createElement("div", null, p); --// Emit only p --React.createElement("div", null, p); -+
{p}
; -+// Emit only p -+
-+ {p} -+
; -+// Emit only p -+
-+ {p} -+
; ++React.createElement("div", null, " ", p, " "); + // Emit only p + React.createElement("div", null, p); + // Emit only p + React.createElement("div", null, p); // Emit " 3" -React.createElement("div", null, " 3"); -+
3 -+
; ++React.createElement("div", null, " "); // Emit " 3 " --React.createElement("div", null, " 3 "); -+
3
; + React.createElement("div", null, " 3 "); // Emit "3" -React.createElement("div", null, "3"); -+
-+ 3 -+
; ++React.createElement("div", null); // Emit no args --React.createElement("div", null); -+
-+
; + React.createElement("div", null); // Emit "foo bar" -React.createElement("div", null, "foo bar"); -+
-+ -+ foo -+ -+ bar -+ -+
; ++React.createElement("div", null, "fo ba"); // Emit "hello\\ world" -React.createElement("div", null, "hello\\ world"); -+
-+ -+ hello\ -+ -+world -+
; ++React.createElement("div", null, "hello worl"); // Emit " a b c d " -React.createElement("div", null, " a b c d "); -+
a -+ b c -+ d
; \ No newline at end of file ++React.createElement("div", null, " b d "); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js index ed681f9c50..37be051add 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js @@ -20,8 +20,8 @@ declare var React: any; //// [file.js] // Emit ' word' in the last string -
word code word
; +React.createElement("div", null, "word ", React.createElement("code", null, "code"), " word"); // Same here -
code word
; +React.createElement("div", null, React.createElement("code", null, "code"), " word"); // And here -
word
; +React.createElement("div", null, React.createElement("code", null), " word"); diff --git a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js.diff b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js.diff index b6c427ad09..7c1a366eca 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js.diff @@ -8,14 +8,14 @@ - "word ", - React.createElement("code", null, "code"), - " word"); -+
word code word
; ++React.createElement("div", null, "word ", React.createElement("code", null, "code"), " word"); // Same here -React.createElement("div", null, - React.createElement("code", null, "code"), - " word"); -+
code word
; ++React.createElement("div", null, React.createElement("code", null, "code"), " word"); // And here -React.createElement("div", null, - React.createElement("code", null), - " word"); -+
word
; \ No newline at end of file ++React.createElement("div", null, React.createElement("code", null), " word"); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js index 22ebf69381..7d3f3aad7a 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js @@ -36,18 +36,14 @@ let x: TodoListProps; //// [tsxSpreadChildrenInvalidType.js] function Todo(prop) { - return
{prop.key.toString() + prop.todo}
; + return React.createElement("div", null, prop.key.toString() + prop.todo); } function TodoList({ todos }) { - return
- {...} -
; + return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); } function TodoListNoError({ todos }) { // any is not checked - return
- {...} -
; + return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); } let x; -; +React.createElement(TodoList, Object.assign({}, x)); diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js.diff deleted file mode 100644 index 0f7cba9465..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- old.tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js -+++ new.tsxSpreadChildrenInvalidType(jsx=react,target=es2015).js -@@= skipped -35, +35 lines =@@ - - //// [tsxSpreadChildrenInvalidType.js] - function Todo(prop) { -- return React.createElement("div", null, prop.key.toString() + prop.todo); -+ return
{prop.key.toString() + prop.todo}
; - } - function TodoList({ todos }) { -- return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); -+ return
-+ {...} -+
; - } - function TodoListNoError({ todos }) { - // any is not checked -- return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); -+ return
-+ {...} -+
; - } - let x; --React.createElement(TodoList, Object.assign({}, x)); -+; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js index 22ebf69381..35dcc70c45 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js @@ -35,19 +35,26 @@ let x: TodoListProps; //// [tsxSpreadChildrenInvalidType.js] +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; function Todo(prop) { - return
{prop.key.toString() + prop.todo}
; + return React.createElement("div", null, prop.key.toString() + prop.todo); } function TodoList({ todos }) { - return
- {...} -
; + return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); } function TodoListNoError({ todos }) { // any is not checked - return
- {...} -
; + return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); } let x; -; +React.createElement(TodoList, __assign({}, x)); diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js.diff index dffbe8e9cf..63aa7fa9d1 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react,target=es5).js.diff @@ -1,20 +1,9 @@ --- old.tsxSpreadChildrenInvalidType(jsx=react,target=es5).js +++ new.tsxSpreadChildrenInvalidType(jsx=react,target=es5).js -@@= skipped -34, +34 lines =@@ - - - //// [tsxSpreadChildrenInvalidType.js] --var __assign = (this && this.__assign) || function () { -- __assign = Object.assign || function(t) { -- for (var s, i = 1, n = arguments.length; i < n; i++) { -- s = arguments[i]; -- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) -- t[p] = s[p]; -- } -- return t; -- }; -- return __assign.apply(this, arguments); --}; +@@= skipped -45, +45 lines =@@ + }; + return __assign.apply(this, arguments); + }; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { @@ -25,29 +14,21 @@ - return to.concat(ar || Array.prototype.slice.call(from)); -}; function Todo(prop) { -- return React.createElement("div", null, prop.key.toString() + prop.todo); --} + return React.createElement("div", null, prop.key.toString() + prop.todo); + } -function TodoList(_a) { - var todos = _a.todos; - return React.createElement.apply(React, __spreadArray(["div", null], React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo }), false)); --} ++function TodoList({ todos }) { ++ return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); + } -function TodoListNoError(_a) { - var todos = _a.todos; -+ return
{prop.key.toString() + prop.todo}
; -+} -+function TodoList({ todos }) { -+ return
-+ {...} -+
; -+} +function TodoListNoError({ todos }) { // any is not checked - return React.createElement.apply(React, __spreadArray(["div", null], React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo }), false)); -+ return
-+ {...} -+
; ++ return React.createElement("div", null, ...React.createElement(Todo, { key: todos[0].id, todo: todos[0].todo })); } -var x; --React.createElement(TodoList, __assign({}, x)); +let x; -+; \ No newline at end of file + React.createElement(TodoList, __assign({}, x)); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt index 2451cbd0d7..5d9568a1b8 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt @@ -1,7 +1,8 @@ +tsxSpreadChildrenInvalidType.tsx(17,12): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. -==== tsxSpreadChildrenInvalidType.tsx (1 errors) ==== +==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { @@ -19,6 +20,8 @@ tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be a } function Todo(prop: { key: number, todo: string }) { return
{prop.key.toString() + prop.todo}
; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. } function TodoList({ todos }: TodoListProps) { return
diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt.diff index 037a694051..f48d3c13b3 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt.diff @@ -2,20 +2,16 @@ +++ new.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -tsxSpreadChildrenInvalidType.tsx(17,12): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? ++tsxSpreadChildrenInvalidType.tsx(17,12): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. --==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== -+==== tsxSpreadChildrenInvalidType.tsx (1 errors) ==== - declare module JSX { - interface Element { } - interface IntrinsicElements { -@@= skipped -19, +18 lines =@@ - } +@@= skipped -20, +20 lines =@@ function Todo(prop: { key: number, todo: string }) { return
{prop.key.toString() + prop.todo}
; -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? ++!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. } function TodoList({ todos }: TodoListProps) { return
\ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js index 22ebf69381..7d85c20aa2 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js @@ -35,19 +35,16 @@ let x: TodoListProps; //// [tsxSpreadChildrenInvalidType.js] +import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; function Todo(prop) { - return
{prop.key.toString() + prop.todo}
; + return _jsx("div", { children: prop.key.toString() + prop.todo }); } function TodoList({ todos }) { - return
- {...} -
; + return _jsxs("div", { children: [..._jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); } function TodoListNoError({ todos }) { // any is not checked - return
- {...} -
; + return _jsxs("div", { children: [..._jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); } let x; -; +_jsx(TodoList, Object.assign({}, x)); diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js.diff deleted file mode 100644 index b42efad222..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js -+++ new.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).js -@@= skipped -34, +34 lines =@@ - - - //// [tsxSpreadChildrenInvalidType.js] --import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; - function Todo(prop) { -- return _jsx("div", { children: prop.key.toString() + prop.todo }); -+ return
{prop.key.toString() + prop.todo}
; - } - function TodoList({ todos }) { -- return _jsxs("div", { children: [..._jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); -+ return
-+ {...} -+
; - } - function TodoListNoError({ todos }) { - // any is not checked -- return _jsxs("div", { children: [..._jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); -+ return
-+ {...} -+
; - } - let x; --_jsx(TodoList, Object.assign({}, x)); -+; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols index 79ed9af9f8..584dbb4378 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols @@ -40,7 +40,6 @@ function Todo(prop: { key: number, todo: string }) { >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) return
{prop.key.toString() + prop.todo}
; ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) >prop.key.toString : Symbol(toString, Decl(lib.es5.d.ts, --, --)) >prop.key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 21)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) @@ -49,7 +48,6 @@ function Todo(prop: { key: number, todo: string }) { >prop.todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } function TodoList({ todos }: TodoListProps) { >TodoList : Symbol(TodoList, Decl(tsxSpreadChildrenInvalidType.tsx, 17, 1)) @@ -57,8 +55,6 @@ function TodoList({ todos }: TodoListProps) { >TodoListProps : Symbol(TodoListProps, Decl(tsxSpreadChildrenInvalidType.tsx, 11, 1)) return
->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - {...} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 20, 17)) @@ -71,7 +67,6 @@ function TodoList({ todos }: TodoListProps) { >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } function TodoListNoError({ todos }: TodoListProps) { >TodoListNoError : Symbol(TodoListNoError, Decl(tsxSpreadChildrenInvalidType.tsx, 22, 1)) @@ -80,8 +75,6 @@ function TodoListNoError({ todos }: TodoListProps) { // any is not checked return
->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - {...( as any)} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 26, 18)) @@ -94,7 +87,6 @@ function TodoListNoError({ todos }: TodoListProps) { >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } let x: TodoListProps; >x : Symbol(x, Decl(tsxSpreadChildrenInvalidType.tsx, 29, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols.diff index 61aae10c21..0ce954b47e 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).symbols.diff @@ -25,7 +25,6 @@ return
{prop.key.toString() + prop.todo}
; ->prop.key.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) +>prop.key.toString : Symbol(toString, Decl(lib.es5.d.ts, --, --)) >prop.key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 21)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) @@ -35,16 +34,7 @@ >prop.todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - } - function TodoList({ todos }: TodoListProps) { - >TodoList : Symbol(TodoList, Decl(tsxSpreadChildrenInvalidType.tsx, 17, 1)) -@@= skipped -15, +17 lines =@@ - >TodoListProps : Symbol(TodoListProps, Decl(tsxSpreadChildrenInvalidType.tsx, 11, 1)) - - return
-+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) -+ +@@= skipped -18, +18 lines =@@ {...} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 20, 17)) @@ -61,16 +51,8 @@ +>todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } - function TodoListNoError({ todos }: TodoListProps) { - >TodoListNoError : Symbol(TodoListNoError, Decl(tsxSpreadChildrenInvalidType.tsx, 22, 1)) -@@= skipped -20, +23 lines =@@ - - // any is not checked - return
-+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) -+ +@@= skipped -20, +20 lines =@@ {...( as any)} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 26, 18)) @@ -87,7 +69,4 @@ +>todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - } - let x: TodoListProps; - >x : Symbol(x, Decl(tsxSpreadChildrenInvalidType.tsx, 29, 3)) \ No newline at end of file + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types index 7dbd49fefa..09192cfdfa 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types @@ -23,13 +23,13 @@ interface TodoListProps { >todos : TodoProp[] } function Todo(prop: { key: number, todo: string }) { ->Todo : (prop: { key: number; todo: string; }) => JSX.Element +>Todo : (prop: { key: number; todo: string; }) => any >prop : { key: number; todo: string; } >key : number >todo : string return
{prop.key.toString() + prop.todo}
; ->
{prop.key.toString() + prop.todo}
: JSX.Element +>
{prop.key.toString() + prop.todo}
: any >div : any >prop.key.toString() + prop.todo : string >prop.key.toString() : string @@ -44,16 +44,16 @@ function Todo(prop: { key: number, todo: string }) { >div : any } function TodoList({ todos }: TodoListProps) { ->TodoList : ({ todos }: TodoListProps) => JSX.Element +>TodoList : ({ todos }: TodoListProps) => any >todos : TodoProp[] return
->
{...}
: JSX.Element +>
{...}
: any >div : any {...} -> : JSX.Element ->Todo : (prop: { key: number; todo: string; }) => JSX.Element +> : any +>Todo : (prop: { key: number; todo: string; }) => any >key : number >todos[0].id : number >todos[0] : TodoProp @@ -71,19 +71,19 @@ function TodoList({ todos }: TodoListProps) { >div : any } function TodoListNoError({ todos }: TodoListProps) { ->TodoListNoError : ({ todos }: TodoListProps) => JSX.Element +>TodoListNoError : ({ todos }: TodoListProps) => any >todos : TodoProp[] // any is not checked return
->
{...( as any)}
: JSX.Element +>
{...( as any)}
: any >div : any {...( as any)} >( as any) : any > as any : any -> : JSX.Element ->Todo : (prop: { key: number; todo: string; }) => JSX.Element +> : any +>Todo : (prop: { key: number; todo: string; }) => any >key : number >todos[0].id : number >todos[0] : TodoProp @@ -104,7 +104,7 @@ let x: TodoListProps; >x : TodoListProps -> : JSX.Element ->TodoList : ({ todos }: TodoListProps) => JSX.Element +> : any +>TodoList : ({ todos }: TodoListProps) => any >x : TodoListProps diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types.diff deleted file mode 100644 index 5a56d4467f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types.diff +++ /dev/null @@ -1,72 +0,0 @@ ---- old.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types -+++ new.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).types -@@= skipped -22, +22 lines =@@ - >todos : TodoProp[] - } - function Todo(prop: { key: number, todo: string }) { -->Todo : (prop: { key: number; todo: string; }) => any -+>Todo : (prop: { key: number; todo: string; }) => JSX.Element - >prop : { key: number; todo: string; } - >key : number - >todo : string - - return
{prop.key.toString() + prop.todo}
; -->
{prop.key.toString() + prop.todo}
: any -+>
{prop.key.toString() + prop.todo}
: JSX.Element - >div : any - >prop.key.toString() + prop.todo : string - >prop.key.toString() : string -@@= skipped -21, +21 lines =@@ - >div : any - } - function TodoList({ todos }: TodoListProps) { -->TodoList : ({ todos }: TodoListProps) => any -+>TodoList : ({ todos }: TodoListProps) => JSX.Element - >todos : TodoProp[] - - return
-->
{...}
: any -+>
{...}
: JSX.Element - >div : any - - {...} --> : any -->Todo : (prop: { key: number; todo: string; }) => any -+> : JSX.Element -+>Todo : (prop: { key: number; todo: string; }) => JSX.Element - >key : number - >todos[0].id : number - >todos[0] : TodoProp -@@= skipped -27, +27 lines =@@ - >div : any - } - function TodoListNoError({ todos }: TodoListProps) { -->TodoListNoError : ({ todos }: TodoListProps) => any -+>TodoListNoError : ({ todos }: TodoListProps) => JSX.Element - >todos : TodoProp[] - - // any is not checked - return
-->
{...( as any)}
: any -+>
{...( as any)}
: JSX.Element - >div : any - - {...( as any)} - >( as any) : any - > as any : any --> : any -->Todo : (prop: { key: number; todo: string; }) => any -+> : JSX.Element -+>Todo : (prop: { key: number; todo: string; }) => JSX.Element - >key : number - >todos[0].id : number - >todos[0] : TodoProp -@@= skipped -33, +33 lines =@@ - >x : TodoListProps - - --> : any -->TodoList : ({ todos }: TodoListProps) => any -+> : JSX.Element -+>TodoList : ({ todos }: TodoListProps) => JSX.Element - >x : TodoListProps diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt index 2451cbd0d7..5d9568a1b8 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt @@ -1,7 +1,8 @@ +tsxSpreadChildrenInvalidType.tsx(17,12): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. -==== tsxSpreadChildrenInvalidType.tsx (1 errors) ==== +==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { @@ -19,6 +20,8 @@ tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be a } function Todo(prop: { key: number, todo: string }) { return
{prop.key.toString() + prop.todo}
; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. } function TodoList({ todos }: TodoListProps) { return
diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt.diff deleted file mode 100644 index db093aa516..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt -+++ new.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt -@@= skipped -0, +0 lines =@@ --tsxSpreadChildrenInvalidType.tsx(17,12): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. - tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. - - --==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== -+==== tsxSpreadChildrenInvalidType.tsx (1 errors) ==== - declare module JSX { - interface Element { } - interface IntrinsicElements { -@@= skipped -19, +18 lines =@@ - } - function Todo(prop: { key: number, todo: string }) { - return
{prop.key.toString() + prop.todo}
; -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. - } - function TodoList({ todos }: TodoListProps) { - return
\ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js index 22ebf69381..8899866579 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js @@ -35,19 +35,18 @@ let x: TodoListProps; //// [tsxSpreadChildrenInvalidType.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); function Todo(prop) { - return
{prop.key.toString() + prop.todo}
; + return jsx_runtime_1.jsx("div", { children: prop.key.toString() + prop.todo }); } function TodoList({ todos }) { - return
- {...} -
; + return jsx_runtime_1.jsxs("div", { children: [...jsx_runtime_1.jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); } function TodoListNoError({ todos }) { // any is not checked - return
- {...} -
; + return jsx_runtime_1.jsxs("div", { children: [...jsx_runtime_1.jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); } let x; -; +jsx_runtime_1.jsx(TodoList, __assign({}, x)); diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js.diff index 8183dce8a4..cb0314f5e0 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js.diff @@ -1,10 +1,9 @@ --- old.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js +++ new.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).js -@@= skipped -34, +34 lines =@@ - +@@= skipped -35, +35 lines =@@ //// [tsxSpreadChildrenInvalidType.js] --"use strict"; + "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { @@ -25,8 +24,9 @@ - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; --Object.defineProperty(exports, "__esModule", { value: true }); + Object.defineProperty(exports, "__esModule", { value: true }); -var jsx_runtime_1 = require("react/jsx-runtime"); ++const jsx_runtime_1 = require("react/jsx-runtime"); function Todo(prop) { - return (0, jsx_runtime_1.jsx)("div", { children: prop.key.toString() + prop.todo }); -} @@ -36,21 +36,17 @@ -} -function TodoListNoError(_a) { - var todos = _a.todos; -+ return
{prop.key.toString() + prop.todo}
; ++ return jsx_runtime_1.jsx("div", { children: prop.key.toString() + prop.todo }); +} +function TodoList({ todos }) { -+ return
-+ {...} -+
; ++ return jsx_runtime_1.jsxs("div", { children: [...jsx_runtime_1.jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); +} +function TodoListNoError({ todos }) { // any is not checked - return (0, jsx_runtime_1.jsxs)("div", { children: __spreadArray([], (0, jsx_runtime_1.jsx)(Todo, { todo: todos[0].todo }, todos[0].id), true) }); -+ return
-+ {...} -+
; ++ return jsx_runtime_1.jsxs("div", { children: [...jsx_runtime_1.jsx(Todo, { todo: todos[0].todo }, todos[0].id)] }); } -var x; -(0, jsx_runtime_1.jsx)(TodoList, __assign({}, x)); +let x; -+; \ No newline at end of file ++jsx_runtime_1.jsx(TodoList, __assign({}, x)); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols index 79ed9af9f8..584dbb4378 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols @@ -40,7 +40,6 @@ function Todo(prop: { key: number, todo: string }) { >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) return
{prop.key.toString() + prop.todo}
; ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) >prop.key.toString : Symbol(toString, Decl(lib.es5.d.ts, --, --)) >prop.key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 21)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) @@ -49,7 +48,6 @@ function Todo(prop: { key: number, todo: string }) { >prop.todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } function TodoList({ todos }: TodoListProps) { >TodoList : Symbol(TodoList, Decl(tsxSpreadChildrenInvalidType.tsx, 17, 1)) @@ -57,8 +55,6 @@ function TodoList({ todos }: TodoListProps) { >TodoListProps : Symbol(TodoListProps, Decl(tsxSpreadChildrenInvalidType.tsx, 11, 1)) return
->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - {...} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 20, 17)) @@ -71,7 +67,6 @@ function TodoList({ todos }: TodoListProps) { >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } function TodoListNoError({ todos }: TodoListProps) { >TodoListNoError : Symbol(TodoListNoError, Decl(tsxSpreadChildrenInvalidType.tsx, 22, 1)) @@ -80,8 +75,6 @@ function TodoListNoError({ todos }: TodoListProps) { // any is not checked return
->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - {...( as any)} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 26, 18)) @@ -94,7 +87,6 @@ function TodoListNoError({ todos }: TodoListProps) { >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; ->div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } let x: TodoListProps; >x : Symbol(x, Decl(tsxSpreadChildrenInvalidType.tsx, 29, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols.diff index 95d82241a1..4c35434bc6 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).symbols.diff @@ -25,7 +25,6 @@ return
{prop.key.toString() + prop.todo}
; ->prop.key.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) +>prop.key.toString : Symbol(toString, Decl(lib.es5.d.ts, --, --)) >prop.key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 21)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) @@ -35,16 +34,7 @@ >prop.todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) >prop : Symbol(prop, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 14)) >todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 15, 34)) -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - } - function TodoList({ todos }: TodoListProps) { - >TodoList : Symbol(TodoList, Decl(tsxSpreadChildrenInvalidType.tsx, 17, 1)) -@@= skipped -15, +17 lines =@@ - >TodoListProps : Symbol(TodoListProps, Decl(tsxSpreadChildrenInvalidType.tsx, 11, 1)) - - return
-+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) -+ +@@= skipped -18, +18 lines =@@ {...} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 20, 17)) @@ -61,16 +51,8 @@ +>todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) } - function TodoListNoError({ todos }: TodoListProps) { - >TodoListNoError : Symbol(TodoListNoError, Decl(tsxSpreadChildrenInvalidType.tsx, 22, 1)) -@@= skipped -20, +23 lines =@@ - - // any is not checked - return
-+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) -+ +@@= skipped -20, +20 lines =@@ {...( as any)} >Todo : Symbol(Todo, Decl(tsxSpreadChildrenInvalidType.tsx, 14, 1)) >key : Symbol(key, Decl(tsxSpreadChildrenInvalidType.tsx, 26, 18)) @@ -87,7 +69,4 @@ +>todo : Symbol(todo, Decl(tsxSpreadChildrenInvalidType.tsx, 9, 15))
; -+>div : Symbol(__index, Decl(tsxSpreadChildrenInvalidType.tsx, 2, 30)) - } - let x: TodoListProps; - >x : Symbol(x, Decl(tsxSpreadChildrenInvalidType.tsx, 29, 3)) \ No newline at end of file + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types index 7dbd49fefa..09192cfdfa 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types +++ b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types @@ -23,13 +23,13 @@ interface TodoListProps { >todos : TodoProp[] } function Todo(prop: { key: number, todo: string }) { ->Todo : (prop: { key: number; todo: string; }) => JSX.Element +>Todo : (prop: { key: number; todo: string; }) => any >prop : { key: number; todo: string; } >key : number >todo : string return
{prop.key.toString() + prop.todo}
; ->
{prop.key.toString() + prop.todo}
: JSX.Element +>
{prop.key.toString() + prop.todo}
: any >div : any >prop.key.toString() + prop.todo : string >prop.key.toString() : string @@ -44,16 +44,16 @@ function Todo(prop: { key: number, todo: string }) { >div : any } function TodoList({ todos }: TodoListProps) { ->TodoList : ({ todos }: TodoListProps) => JSX.Element +>TodoList : ({ todos }: TodoListProps) => any >todos : TodoProp[] return
->
{...}
: JSX.Element +>
{...}
: any >div : any {...} -> : JSX.Element ->Todo : (prop: { key: number; todo: string; }) => JSX.Element +> : any +>Todo : (prop: { key: number; todo: string; }) => any >key : number >todos[0].id : number >todos[0] : TodoProp @@ -71,19 +71,19 @@ function TodoList({ todos }: TodoListProps) { >div : any } function TodoListNoError({ todos }: TodoListProps) { ->TodoListNoError : ({ todos }: TodoListProps) => JSX.Element +>TodoListNoError : ({ todos }: TodoListProps) => any >todos : TodoProp[] // any is not checked return
->
{...( as any)}
: JSX.Element +>
{...( as any)}
: any >div : any {...( as any)} >( as any) : any > as any : any -> : JSX.Element ->Todo : (prop: { key: number; todo: string; }) => JSX.Element +> : any +>Todo : (prop: { key: number; todo: string; }) => any >key : number >todos[0].id : number >todos[0] : TodoProp @@ -104,7 +104,7 @@ let x: TodoListProps; >x : TodoListProps -> : JSX.Element ->TodoList : ({ todos }: TodoListProps) => JSX.Element +> : any +>TodoList : ({ todos }: TodoListProps) => any >x : TodoListProps diff --git a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types.diff b/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types.diff deleted file mode 100644 index 2e8e466a07..0000000000 --- a/testdata/baselines/reference/submodule/conformance/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types.diff +++ /dev/null @@ -1,72 +0,0 @@ ---- old.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types -+++ new.tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).types -@@= skipped -22, +22 lines =@@ - >todos : TodoProp[] - } - function Todo(prop: { key: number, todo: string }) { -->Todo : (prop: { key: number; todo: string; }) => any -+>Todo : (prop: { key: number; todo: string; }) => JSX.Element - >prop : { key: number; todo: string; } - >key : number - >todo : string - - return
{prop.key.toString() + prop.todo}
; -->
{prop.key.toString() + prop.todo}
: any -+>
{prop.key.toString() + prop.todo}
: JSX.Element - >div : any - >prop.key.toString() + prop.todo : string - >prop.key.toString() : string -@@= skipped -21, +21 lines =@@ - >div : any - } - function TodoList({ todos }: TodoListProps) { -->TodoList : ({ todos }: TodoListProps) => any -+>TodoList : ({ todos }: TodoListProps) => JSX.Element - >todos : TodoProp[] - - return
-->
{...}
: any -+>
{...}
: JSX.Element - >div : any - - {...} --> : any -->Todo : (prop: { key: number; todo: string; }) => any -+> : JSX.Element -+>Todo : (prop: { key: number; todo: string; }) => JSX.Element - >key : number - >todos[0].id : number - >todos[0] : TodoProp -@@= skipped -27, +27 lines =@@ - >div : any - } - function TodoListNoError({ todos }: TodoListProps) { -->TodoListNoError : ({ todos }: TodoListProps) => any -+>TodoListNoError : ({ todos }: TodoListProps) => JSX.Element - >todos : TodoProp[] - - // any is not checked - return
-->
{...( as any)}
: any -+>
{...( as any)}
: JSX.Element - >div : any - - {...( as any)} - >( as any) : any - > as any : any --> : any -->Todo : (prop: { key: number; todo: string; }) => any -+> : JSX.Element -+>Todo : (prop: { key: number; todo: string; }) => JSX.Element - >key : number - >todos[0].id : number - >todos[0] : TodoProp -@@= skipped -33, +33 lines =@@ - >x : TodoListProps - - --> : any -->TodoList : ({ todos }: TodoListProps) => any -+> : JSX.Element -+>TodoList : ({ todos }: TodoListProps) => JSX.Element - >x : TodoListProps diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js index 549e944ec2..3c58af9c30 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js @@ -19,11 +19,11 @@ var SFCComp = SFC1 || SFC2; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); function SFC1(prop) { - return
hello
; + return React.createElement("div", null, "hello"); } ; function SFC2(prop) { - return

World

; + return React.createElement("h1", null, "World "); } var SFCComp = SFC1 || SFC2; -; +React.createElement(SFCComp, { x: true }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js.diff index 8d300c1b48..1db363007c 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType1.js.diff @@ -7,14 +7,5 @@ -var React = require("react"); +const React = require("react"); function SFC1(prop) { -- return React.createElement("div", null, "hello"); -+ return
hello
; - } - ; - function SFC2(prop) { -- return React.createElement("h1", null, "World "); -+ return

World

; - } - var SFCComp = SFC1 || SFC2; --React.createElement(SFCComp, { x: true }); -+; \ No newline at end of file + return React.createElement("div", null, "hello"); + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js index 927dae5e23..b86f9f64c9 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js @@ -19,11 +19,11 @@ var SFCComp = SFC1 || SFC2; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); function SFC1(prop) { - return
hello
; + return React.createElement("div", null, "hello"); } ; function SFC2(prop) { - return

World

; + return React.createElement("h1", null, "World "); } var SFCComp = SFC1 || SFC2; -; +React.createElement(SFCComp, { x: "hi" }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js.diff index 09e32c1aa6..e45d4081c9 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType2.js.diff @@ -7,14 +7,5 @@ -var React = require("react"); +const React = require("react"); function SFC1(prop) { -- return React.createElement("div", null, "hello"); -+ return
hello
; - } - ; - function SFC2(prop) { -- return React.createElement("h1", null, "World "); -+ return

World

; - } - var SFCComp = SFC1 || SFC2; --React.createElement(SFCComp, { x: "hi" }); -+; \ No newline at end of file + return React.createElement("div", null, "hello"); + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js index 651519c889..5c9c0b6f0e 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js @@ -67,8 +67,8 @@ var EmptyRCComp = RC3 || RC4; var PartRCComp = RC1 || RC4; var RCComp = RC1 || RC2; // OK -let a = ; -let a1 = ; -let a2 = ; -let b = ; -let c = ; +let a = React.createElement(RCComp, { x: "Hi" }); +let a1 = React.createElement(EmptyRCComp, null); +let a2 = React.createElement(EmptyRCComp, { "data-prop": "hello" }); +let b = React.createElement(PartRCComp, null); +let c = React.createElement(PartRCComp, { "data-extra": "hello" }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js.diff index fba4aa5ba5..148e7ca2c7 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType3.js.diff @@ -93,8 +93,8 @@ -var a2 = React.createElement(EmptyRCComp, { "data-prop": "hello" }); -var b = React.createElement(PartRCComp, null); -var c = React.createElement(PartRCComp, { "data-extra": "hello" }); -+let a = ; -+let a1 = ; -+let a2 = ; -+let b = ; -+let c = ; \ No newline at end of file ++let a = React.createElement(RCComp, { x: "Hi" }); ++let a1 = React.createElement(EmptyRCComp, null); ++let a2 = React.createElement(EmptyRCComp, { "data-prop": "hello" }); ++let b = React.createElement(PartRCComp, null); ++let c = React.createElement(PartRCComp, { "data-extra": "hello" }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js index 26945a3956..98860a5690 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js @@ -66,6 +66,6 @@ var RCComp = RC1 || RC2; var EmptyRCComp = RC3 || RC4; var PartRCComp = RC1 || RC4; // Error -let a = ; -let b = ; -let c = ; +let a = React.createElement(RCComp, { x: true }); +let b = React.createElement(PartRCComp, { x: 10 }); +let c = React.createElement(EmptyRCComp, { prop: true }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js.diff index ca36d71d76..2f0a00b57d 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType4.js.diff @@ -91,6 +91,6 @@ -var a = React.createElement(RCComp, { x: true }); -var b = React.createElement(PartRCComp, { x: 10 }); -var c = React.createElement(EmptyRCComp, { prop: true }); -+let a = ; -+let b = ; -+let c = ; \ No newline at end of file ++let a = React.createElement(RCComp, { x: true }); ++let b = React.createElement(PartRCComp, { x: 10 }); ++let c = React.createElement(EmptyRCComp, { prop: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js index d51691b1ba..1d8378d235 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js @@ -27,16 +27,16 @@ let b = Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); function EmptySFC1() { - return
hello
; + return React.createElement("div", null, "hello"); } function EmptySFC2() { - return
Hello
; + return React.createElement("div", null, "Hello"); } function SFC2(prop) { - return

World

; + return React.createElement("h1", null, "World"); } var EmptySFCComp = EmptySFC1 || EmptySFC2; var SFC2AndEmptyComp = SFC2 || EmptySFC1; -let a = ; -let a1 = ; -let b = ; +let a = React.createElement(EmptySFCComp, null); +let a1 = React.createElement(EmptySFCComp, { "data-prop": true }); +let b = React.createElement(SFC2AndEmptyComp, { x: true }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js.diff index 0f3861cc58..9905dc442a 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType5.js.diff @@ -7,22 +7,15 @@ -var React = require("react"); +const React = require("react"); function EmptySFC1() { -- return React.createElement("div", null, "hello"); -+ return
hello
; + return React.createElement("div", null, "hello"); } - function EmptySFC2() { -- return React.createElement("div", null, "Hello"); -+ return
Hello
; - } - function SFC2(prop) { -- return React.createElement("h1", null, "World"); -+ return

World

; +@@= skipped -12, +12 lines =@@ } var EmptySFCComp = EmptySFC1 || EmptySFC2; var SFC2AndEmptyComp = SFC2 || EmptySFC1; -var a = React.createElement(EmptySFCComp, null); -var a1 = React.createElement(EmptySFCComp, { "data-prop": true }); -var b = React.createElement(SFC2AndEmptyComp, { x: true }); -+let a = ; -+let a1 = ; -+let b = ; \ No newline at end of file ++let a = React.createElement(EmptySFCComp, null); ++let a1 = React.createElement(EmptySFCComp, { "data-prop": true }); ++let b = React.createElement(SFC2AndEmptyComp, { x: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js index 18a74ca5bd..a95d993e5a 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js @@ -30,18 +30,18 @@ let d = ; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); function EmptySFC1() { - return
Hi
; + return React.createElement("div", null, "Hi"); } function EmptySFC2() { - return
Hello
; + return React.createElement("div", null, "Hello"); } function SFC2(prop) { - return

World

; + return React.createElement("h1", null, "World"); } var EmptySFCComp = EmptySFC1 || EmptySFC2; var SFC2AndEmptyComp = SFC2 || EmptySFC1; // Error -let a = ; -let b = ; -let c = ; -let d = ; +let a = React.createElement(EmptySFCComp, { x: true }); +let b = React.createElement(SFC2AndEmptyComp, { x: "hi" }); +let c = React.createElement(SFC2AndEmptyComp, null); +let d = React.createElement(SFC2AndEmptyComp, { "data-prop": true }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js.diff index 5310b9d490..ed9062c4cf 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionElementType6.js.diff @@ -7,17 +7,9 @@ -var React = require("react"); +const React = require("react"); function EmptySFC1() { -- return React.createElement("div", null, "Hi"); -+ return
Hi
; - } - function EmptySFC2() { -- return React.createElement("div", null, "Hello"); -+ return
Hello
; - } - function SFC2(prop) { -- return React.createElement("h1", null, "World"); -+ return

World

; + return React.createElement("div", null, "Hi"); } +@@= skipped -13, +13 lines =@@ var EmptySFCComp = EmptySFC1 || EmptySFC2; var SFC2AndEmptyComp = SFC2 || EmptySFC1; // Error @@ -25,7 +17,7 @@ -var b = React.createElement(SFC2AndEmptyComp, { x: "hi" }); -var c = React.createElement(SFC2AndEmptyComp, null); -var d = React.createElement(SFC2AndEmptyComp, { "data-prop": true }); -+let a = ; -+let b = ; -+let c = ; -+let d = ; \ No newline at end of file ++let a = React.createElement(EmptySFCComp, { x: true }); ++let b = React.createElement(SFC2AndEmptyComp, { x: "hi" }); ++let c = React.createElement(SFC2AndEmptyComp, null); ++let d = React.createElement(SFC2AndEmptyComp, { "data-prop": true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js index 8531685922..91824fb9b1 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js @@ -32,12 +32,12 @@ const React = require("react"); class MyComponent extends React.Component { render() { const { AnyComponent } = this.props; - return (); + return (React.createElement(AnyComponent, null)); } } // Stateless Component As Props - }/>; +React.createElement(MyComponent, { AnyComponent: () => React.createElement("button", null, "test") }); // Component Class as Props class MyButtonComponent extends React.Component { } -; +React.createElement(MyComponent, { AnyComponent: MyButtonComponent }); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js.diff index d347c25e5e..42cab6e376 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent1.js.diff @@ -25,22 +25,22 @@ - __extends(MyComponent, _super); - function MyComponent() { - return _super !== null && _super.apply(this, arguments) || this; +- } +- MyComponent.prototype.render = function () { +- var AnyComponent = this.props.AnyComponent; +const React = require("react"); +class MyComponent extends React.Component { + render() { + const { AnyComponent } = this.props; -+ return (); - } -- MyComponent.prototype.render = function () { -- var AnyComponent = this.props.AnyComponent; -- return (React.createElement(AnyComponent, null)); + return (React.createElement(AnyComponent, null)); - }; - return MyComponent; -}(React.Component)); ++ } +} // Stateless Component As Props -React.createElement(MyComponent, { AnyComponent: function () { return React.createElement("button", null, "test"); } }); -+ }/>; ++React.createElement(MyComponent, { AnyComponent: () => React.createElement("button", null, "test") }); // Component Class as Props -var MyButtonComponent = /** @class */ (function (_super) { - __extends(MyButtonComponent, _super); @@ -49,7 +49,6 @@ - } - return MyButtonComponent; -}(React.Component)); --React.createElement(MyComponent, { AnyComponent: MyButtonComponent }); +class MyButtonComponent extends React.Component { +} -+; \ No newline at end of file + React.createElement(MyComponent, { AnyComponent: MyButtonComponent }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js index 777fb531c1..3fdbe20dee 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js @@ -17,4 +17,4 @@ const X: Invalid1 = 1; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const X = 1; -; +React.createElement(X, null); diff --git a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js.diff b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js.diff index 928b14cda1..01d3413d60 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxUnionTypeComponent2.js.diff @@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var React = require("react"); -var X = 1; --React.createElement(X, null); +const React = require("react"); +const X = 1; -+; \ No newline at end of file + React.createElement(X, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeEscapesInJsxtags.js b/testdata/baselines/reference/submodule/conformance/unicodeEscapesInJsxtags.js index 29fdfcb2da..19d083df09 100644 --- a/testdata/baselines/reference/submodule/conformance/unicodeEscapesInJsxtags.js +++ b/testdata/baselines/reference/submodule/conformance/unicodeEscapesInJsxtags.js @@ -32,16 +32,16 @@ const x = { video: () => null } //// [file.js] import * as React from "react"; -const Compa = (x) =>
{"" + x}
; +const Compa = (x) => React.createElement("div", null, "" + x); const x = { video: () => null }; -<\u0061>; -<\u0061-b>; -; -; -; -<\u{0061}>
; -<\u{0061}-b>; -; -; -
; + ~~~~~~~~~~~~~~ -!!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -- } -- } -+ \ No newline at end of file ++!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt.diff index c99434bd88..f3d1426937 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt.diff @@ -2,42 +2,15 @@ +++ new.commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt @@= skipped -0, +0 lines =@@ -commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -- -- --==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== -- // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs -- namespace JSX {} -- class Component { -- render() { -- return
-- ~~~~~ -- {/* missing */} -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- {null/* preserved */} -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- { -- ~~~~~~~~~~~~~ -- // ??? 1 -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- { // ??? 2 -- ~~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- {// ??? 3 -- ~~~~~~~~~~~~~~~~~~~~~ -- } -- ~~~~~~~~~~~~~ -- { -- ~~~~~~~~~~~~~ -- // ??? 4 -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- /* ??? 5 */} -- ~~~~~~~~~~~~~~~~~~~~~~~~ --
; -- ~~~~~~~~~~~~~~ ++commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + + + ==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +@@= skipped -33, +33 lines =@@ + ~~~~~~~~~~~~~~~~~~~~~~~~ +
; + ~~~~~~~~~~~~~~ -!!! error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -- } -- } -+ \ No newline at end of file ++!!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + } + } \ No newline at end of file