build: avoid shipping patch flag name strings in prod
This commit is contained in:
		
							parent
							
								
									3bc2914e32
								
							
						
					
					
						commit
						a76e58e5fd
					
				@ -85,7 +85,8 @@ export const transformText: NodeTransform = (node, context) => {
 | 
				
			|||||||
            getConstantType(child) === ConstantTypes.NOT_CONSTANT
 | 
					            getConstantType(child) === ConstantTypes.NOT_CONSTANT
 | 
				
			||||||
          ) {
 | 
					          ) {
 | 
				
			||||||
            callArgs.push(
 | 
					            callArgs.push(
 | 
				
			||||||
              `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`
 | 
					              PatchFlags.TEXT +
 | 
				
			||||||
 | 
					                (__DEV__ ? ` /* ${PatchFlagNames[PatchFlags.TEXT]} */` : ``)
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          children[i] = {
 | 
					          children[i] = {
 | 
				
			||||||
 | 
				
			|||||||
@ -88,7 +88,8 @@ export const transformFor = createStructuralDirectiveTransform(
 | 
				
			|||||||
        helper(FRAGMENT),
 | 
					        helper(FRAGMENT),
 | 
				
			||||||
        undefined,
 | 
					        undefined,
 | 
				
			||||||
        renderExp,
 | 
					        renderExp,
 | 
				
			||||||
        `${fragmentFlag} /* ${PatchFlagNames[fragmentFlag]} */`,
 | 
					        fragmentFlag +
 | 
				
			||||||
 | 
					          (__DEV__ ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``),
 | 
				
			||||||
        undefined,
 | 
					        undefined,
 | 
				
			||||||
        undefined,
 | 
					        undefined,
 | 
				
			||||||
        true /* isBlock */,
 | 
					        true /* isBlock */,
 | 
				
			||||||
@ -147,9 +148,10 @@ export const transformFor = createStructuralDirectiveTransform(
 | 
				
			|||||||
            helper(FRAGMENT),
 | 
					            helper(FRAGMENT),
 | 
				
			||||||
            keyProperty ? createObjectExpression([keyProperty]) : undefined,
 | 
					            keyProperty ? createObjectExpression([keyProperty]) : undefined,
 | 
				
			||||||
            node.children,
 | 
					            node.children,
 | 
				
			||||||
            `${PatchFlags.STABLE_FRAGMENT} /* ${
 | 
					            PatchFlags.STABLE_FRAGMENT +
 | 
				
			||||||
              PatchFlagNames[PatchFlags.STABLE_FRAGMENT]
 | 
					              (__DEV__
 | 
				
			||||||
            } */`,
 | 
					                ? ` /* ${PatchFlagNames[PatchFlags.STABLE_FRAGMENT]} */`
 | 
				
			||||||
 | 
					                : ``),
 | 
				
			||||||
            undefined,
 | 
					            undefined,
 | 
				
			||||||
            undefined,
 | 
					            undefined,
 | 
				
			||||||
            true
 | 
					            true
 | 
				
			||||||
 | 
				
			|||||||
@ -251,9 +251,10 @@ function createChildrenCodegenNode(
 | 
				
			|||||||
        helper(FRAGMENT),
 | 
					        helper(FRAGMENT),
 | 
				
			||||||
        createObjectExpression([keyProperty]),
 | 
					        createObjectExpression([keyProperty]),
 | 
				
			||||||
        children,
 | 
					        children,
 | 
				
			||||||
        `${PatchFlags.STABLE_FRAGMENT} /* ${
 | 
					        PatchFlags.STABLE_FRAGMENT +
 | 
				
			||||||
          PatchFlagNames[PatchFlags.STABLE_FRAGMENT]
 | 
					          (__DEV__
 | 
				
			||||||
        } */`,
 | 
					            ? ` /* ${PatchFlagNames[PatchFlags.STABLE_FRAGMENT]} */`
 | 
				
			||||||
 | 
					            : ``),
 | 
				
			||||||
        undefined,
 | 
					        undefined,
 | 
				
			||||||
        undefined,
 | 
					        undefined,
 | 
				
			||||||
        true,
 | 
					        true,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user