以上就是给各位分享javascript–如何制作CordovaAppLiveReload,特别是由webpack构建并在设备或模拟器中运行,同时本文还将给你拓展com.intellij.lang.ja
以上就是给各位分享javascript – 如何制作Cordova App Live Reload,特别是由webpack构建并在设备或模拟器中运行,同时本文还将给你拓展com.intellij.lang.javascript.JavaScriptSupportLoader的实例源码、cordova – 视觉工作室2015年apache cordovo没有在模拟器中运行与空白应用程序项目模板、IOS模拟器:JavaScriptCoreWTF :: CrashOnOverflow :: crash:、javascript - 如何用webpack+react+PHP搭建网站?等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- javascript – 如何制作Cordova App Live Reload,特别是由webpack构建并在设备或模拟器中运行
- com.intellij.lang.javascript.JavaScriptSupportLoader的实例源码
- cordova – 视觉工作室2015年apache cordovo没有在模拟器中运行与空白应用程序项目模板
- IOS模拟器:JavaScriptCoreWTF :: CrashOnOverflow :: crash:
- javascript - 如何用webpack+react+PHP搭建网站?
javascript – 如何制作Cordova App Live Reload,特别是由webpack构建并在设备或模拟器中运行
解决方法
我已经下载了cordova-plugin-browsersync
cordova插件添加cordova-plugin-browsersync无效,所以我手动将其复制到plugins文件夹,更新了cordova的package.json并从cordova-plugin-browsersync文件夹安装了插件的节点模块.
之后,如果在www文件夹中修改了任何内容,应用程序似乎会更快地更新.
现在必须解决如何从webpack-dev-server输出中间包文件,默认情况下不会这样做.我找到了write-file-webpack-plugin,但它没有将所有文件输出到build文件夹,因此可能无法很好地用于此目的.
所以我的计划是
>创建一个webpack.config.cordova.js文件,其中代码压缩已关闭>设置任何监视src文件夹并调用node.js脚本的应用程序>哪个脚本以编程方式编译该webpack配置,输出到cordova的www /
com.intellij.lang.javascript.JavaScriptSupportLoader的实例源码
public static String findPackageForMxml(final PsiElement expression) { String s = null; final PsiFile containingFile = expression.getContainingFile(); if(containingFile.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4 && containingFile.getContext() != null) { final PsiFile contextContainigFile = containingFile.getContext().getContainingFile(); VirtualFile file = contextContainigFile.getVirtualFile(); if(file == null && contextContainigFile.getoriginalFile() != null) { file = contextContainigFile.getoriginalFile().getVirtualFile(); } s = getExpectedPackageNameFromFile(file,containingFile.getProject(),true); } return s; }
public static JSClass getClassFromTagNameInMxml(final PsiElement psiElement) { XmlTag tag = psiElement != null ? PsiTreeUtil.getNonStrictParentOfType(psiElement,XmlTag.class) : null; if(tag != null && (tag.getNamespacePrefix().length() > 0 || JavaScriptSupportLoader.isFlexMxmFile(tag.getContainingFile()))) { if(isScriptContextTag(tag)) { tag = ((XmlFile) tag.getContainingFile()).getDocument().getRoottag(); } final XmlElementDescriptor descriptor = tag.getDescriptor(); if(descriptor != null) { PsiElement decl = descriptor.getDeclaration(); if(decl instanceof JSClass) { return ((JSClass) decl); } else if(decl instanceof XmlFile) { return XmlBackedJSClassImpl.getXmlBackedClass((XmlFile) decl); } } } return null; }
public static String findScriptNs(XmlTag roottag) { String ns = roottag.getNamespace(); if(JavaScriptSupportLoader.isFlexMxmFile(roottag.getContainingFile())) { ns = ""; for(String testNs : JavaScriptSupportLoader.MXML_URIS) { if(roottag.getPrefixByNamespace(testNs) != null) { ns = testNs; break; } } } return ns; }
@NotNull @Override public String[] getNames(Project project,boolean includeNonProjectItems) { final Set<String> result = new HashSet<String>(); result.addAll(StubIndex.getInstance().getAllKeys(JavaScriptIndexKeys.ELEMENTS_BY_NAME,project)); FileBasedindex.getInstance().processAllKeys(FilenameIndex.NAME,new Processor<String>() { @Override public boolean process(String s) { if(JavaScriptSupportLoader.isFlexMxmFile(s)) { result.add(FileUtil.getNameWithoutExtension(s)); } return true; } },project); return result.toArray(new String[result.size()]); }
@Override public void actionPerformed(final AnActionEvent e) { Editor editor = e.getData(PlatformDataKeys.EDITOR); PsiFile psifile = e.getData(LangDataKeys.PSI_FILE); Project project = e.getData(PlatformDataKeys.PROJECT); final VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE); if(JavaScriptSupportLoader.isFlexMxmFile(file)) { editor = BaseCodeInsightAction.getInjectedEditor(project,editor); psifile = PsiUtilBase.getPsiFileInEditor(editor,project); } new JavaScriptGenerateAccessorHandler(getGenerationMode()).invoke(project,editor,psifile); }
private static void process(final JSNamedElement node,final ProblemsHolder holder) { if(node.getContainingFile().getLanguage() != JavaScriptSupportLoader.ECMA_SCRIPT_L4) { return; } PsiElement nameIdentifier = node.getNameIdentifier(); if(nameIdentifier != null && JSPsiImplUtils.getTypeFromDeclaration(node) == null && (!(node instanceof JSParameter) || !((JSParameter) node).isRest())) { holder.registerProblem(nameIdentifier,JavaScriptBundle.message(node instanceof JSFunction ? "js.untyped.function.problem" : "js.untyped" + ".variable.problem",nameIdentifier.getText()),ProblemHighlightType.GENERIC_ERROR_OR_WARNING,new AddTypetoDclFix()); } }
public EmberJSParser(PsiBuilder builder) { super(JavaScriptSupportLoader.JAVASCRIPT_1_5,builder); myExpressionParser = new EmberJSExpressionParser(); myStatementParser = new StatementParser<EmberJSParser>(this) { @Override protected void doParseStatement(boolean canHaveClasses) { final IElementType firstToken = builder.getTokenType(); if (firstToken == JSTokenTypes.LBRACE) { parseExpressionStatement(); checkForSemicolon(); return; } if (isIdentifierToken(firstToken)) { final IElementType nextToken = builder.lookAhead(1); if (nextToken == JSTokenTypes.IN_KEYWORD) { parseInStatement(); return; } } if (builder.getTokenType() == JSTokenTypes.LPAR) { if (parseInStatement()) { return; } } super.doParseStatement(canHaveClasses); } private boolean parseInStatement() { PsiBuilder.Marker statement = builder.mark(); if (!getExpressionParser().parseInExpression()) { statement.drop(); return false; } statement.done(JSElementTypes.EXPRESSION_STATEMENT); return true; } }; }
private static String doGenerateDoc(final JSFunction function) { StringBuilder builder = new StringBuilder(); final JSParameterList parameterList = function.getParameterList(); final PsiFile containingFile = function.getContainingFile(); final boolean ecma = containingFile.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4; if(parameterList != null) { for(JSParameter parameter : parameterList.getParameters()) { builder.append("* @param ").append(parameter.getName()); //String s = JSPsiImplUtils.getTypeFromDeclaration(parameter); //if (s != null) builder.append(" : ").append(s); builder.append("\n"); } } if(ecma) { String s = JSPsiImplUtils.getTypeFromDeclaration(function); if(s != null && !"void".equals(s)) { builder.append("* @return "); //builder.append(s); builder.append("\n"); } } return builder.toString(); }
public static Collection<JSQualifiednamedElement> findElementsByName(String name,Project project,GlobalSearchScope scope) { final Set<JSQualifiednamedElement> result = new HashSet<JSQualifiednamedElement>(); Collection<JSQualifiednamedElement> jsQualifiednamedElements = StubIndex.getElements(JavaScriptIndexKeys.ELEMENTS_BY_NAME,name,project,scope,JSQualifiednamedElement.class); for(JSQualifiednamedElement e : jsQualifiednamedElements) { result.add((JSQualifiednamedElement) e.getNavigationElement()); } Collection<VirtualFile> files = new ArrayList<VirtualFile>(); files.addAll(FileBasedindex.getInstance().getContainingFiles(FilenameIndex.NAME,name + JavaScriptSupportLoader.MXML_FILE_EXTENSION_DOT,scope)); files.addAll(FileBasedindex.getInstance().getContainingFiles(FilenameIndex.NAME,name + JavaScriptSupportLoader.MXML_FILE_EXTENSION2_DOT,scope)); for(final VirtualFile file : files) { if(!file.isValid()) { continue; } final PsiFile psiFile = PsiManager.getInstance(project).findFile(file); if(psiFile != null) { result.add(XmlBackedJSClassImpl.getXmlBackedClass((XmlFile) psiFile)); } } return result; }
public static String getQNametoStartHierarchySearch(final JSFunction node) { PsiElement parentNode = node.getParent(); parentNode = getClassReferenceForXmlFromContext(parentNode); if(parentNode instanceof JSClass) { final JSAttributeList attributeList = node.getAttributeList(); if(attributeList == null || !attributeList.hasModifier(JSAttributeList.ModifierType.OVERRIDE) || attributeList.hasModifier(JSAttributeList.ModifierType.STATIC) || attributeList.getAccesstype() == JSAttributeList.Accesstype.PRIVATE) { return null; } if(parentNode instanceof JSClass) { return ((JSClass) parentNode).getQualifiedname(); } } else if(node instanceof JSFunctionExpression && parentNode.getContainingFile().getLanguage() != JavaScriptSupportLoader.ECMA_SCRIPT_L4) { final ContextResolver resolver = new ContextResolver(node.getFirstChild()); return resolver.getQualifierAsstring(); } else if(parentNode instanceof JSFile && parentNode.getContainingFile().getLanguage() != JavaScriptSupportLoader.ECMA_SCRIPT_L4) { return node.getName(); } return null; }
public ImplicitJSVariableImpl(final String name,String qName,PsiFile containingFile) { super(containingFile.getManager(),JavaScriptSupportLoader.ECMA_SCRIPT_L4.getBaseLanguage()); myContainingFile = containingFile; myName = name; myType = qName; }
public static boolean isAdequatePlaceForImport(final PsiNamedElement parent,@NotNull PsiElement place) { if(parent instanceof JSFile && !parent.getLanguage().isKindOf(JavaScriptSupportLoader.ECMA_SCRIPT_L4)) { return false; } if(place instanceof JSReferenceExpression) { final PsiElement placeParent = place.getParent(); if(placeParent instanceof JSReferenceExpression) { final PsiElement currentParent = JSResolveUtil.getTopReferenceParent(placeParent); if(JSResolveUtil.isSelfReference(currentParent,place) || //currentParent instanceof JSDeFinitionExpression || currentParent instanceof JSReferenceList) { return false; } } } else if(place instanceof JSDocTagValue) { // further conditions to come } else { if(!(place instanceof JSFile)) { return false; } } return true; }
public static String getSignatureForParameter(final JSParameter p,boolean skipType) { final String s = skipType ? null : p.getTypestring(); if(s != null && s.length() > 0) { final boolean ecmal4 = p.getContainingFile().getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4; String result; if(ecmal4) { if(p.isRest()) { result = "..."; } else { result = p.getName() + ":" + s; } } else { result = "[" + s + "] " + p.getName(); } final String initializerText = p.getinitializerText(); if(initializerText != null) { result += " = " + initializerText; } return result; } return p.getName(); }
protected static String getExceptionVarTypeBasedOnContext(@NotNull PsiElement context) { if(context.getContainingFile().getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4) { return ":Error"; } return ""; }
@Override public void update(final AnActionEvent e) { final VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE); boolean status = false; if(file != null) { if(file.getFileType() == JavaScriptFileType.INSTANCE) { final Editor editor = e.getData(PlatformDataKeys.EDITOR); final PsiFile psifile = e.getData(LangDataKeys.PSI_FILE); if(editor != null && psifile != null) { status = psifile.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4; } } else if(JavaScriptSupportLoader.isFlexMxmFile(file)) { status = true; } } e.getPresentation().setEnabled(status); e.getPresentation().setVisible(status); }
private static ProblemHighlightType getHighlightTypeForTypeOrSignatureProblem(@NotNull PsiElement node) { if(node.getContainingFile().getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4) { return ProblemHighlightType.GENERIC_ERROR; } return ProblemHighlightType.GENERIC_ERROR_OR_WARNING; }
@Override protected JSExpression findIntroducedExpression(final PsiFile file,final int start,final int end,Editor editor) { if(file.getLanguage() != JavaScriptSupportLoader.ECMA_SCRIPT_L4) { CommonRefactoringUtil.showErrorHint(file.getProject(),JavaScriptBundle.message("javascript.introduce.field.error.not.available.in.javascript" + ".code"),getRefactoringName(),null); return null; } return super.findIntroducedExpression(file,start,end,editor); }
@Override public void processIntention(@NotNull PsiElement element) throws IncorrectOperationException { assert (element instanceof JSVarStatement); final JSVarStatement varStatement = (JSVarStatement) element; StringBuilder declarationBuffer = new StringBuilder(); List<String> initializations = new ArrayList<String>(); for (JSVariable variable : varStatement.getvariables()) { declarationBuffer.append((declarationBuffer.length() == 0) ? VAR_KEYWORD : ",") .append(variable.getName()); String s = JSPsiImplUtils.getTypeFromDeclaration(variable); final PsiFile containingFile = element.getContainingFile(); if (s == null && containingFile.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4) { s = JSResolveUtil.getExpressionType(variable.getinitializer(),containingFile); } if (s != null) { declarationBuffer.append(":").append(s); } if (variable.hasInitializer()) { initializations.add(variable.getName() + '=' + variable.getinitializer().getText() + ';'); } } declarationBuffer.append(';'); // Do replacement. Jsstatement newStatement = JSElementFactory.replaceStatement(varStatement,declarationBuffer.toString()); for (final String initialization : initializations) { newStatement = JSElementFactory.addStatementAfter(newStatement,initialization); } }
public static boolean isNewResolveAndCompletion(PsiFile psiFile) { return psiFile.getLanguage().isKindOf(JavaScriptSupportLoader.ECMA_SCRIPT_L4) || JavaScriptSupportLoader.isFlexMxmFile(psiFile); }
public ResolveProcessor(final String name,PsiElement _place) { myName = name; place = _place; final boolean b = place instanceof JSReferenceExpression && ((JSReferenceExpression) place).getQualifier() == null; allowUnqualifiedStaticsFromInstance = b; if(myName != null && place instanceof JSReferenceExpression) { final ASTNode node = place.getNode().findChildByType(JSTokenTypes.COLON_COLON); String explicitNs = null; // Todo: e.g. protected is also ns if(node != null) { final JSExpression expression = ((JSReferenceExpression) place).getQualifier(); if(expression instanceof JSReferenceExpression) { anyNsAllowed = ((JSReferenceExpression) expression).resolve() instanceof JSVariable; } explicitNs = expression != null ? expression.getText() : null; } else { final JSExpression qualifier = ((JSReferenceExpression) place).getQualifier(); if(qualifier instanceof JSReferenceExpression && qualifier.getNode().findChildByType(JSTokenTypes.COLON_COLON) != null) { anyNsAllowed = ((JSReferenceExpression) qualifier).resolve() instanceof JSVariable; explicitNs = ((JSReferenceExpression) qualifier).getReferencedname(); } } if(explicitNs != null && !anyNsAllowed) { openednses = new THashSet<String>(); openednses.add(explicitNs); defaultNsIsNotAllowed = true; } } if(myName == null && place instanceof JSReferenceExpression) { PsiElement parent = place.getParent(); if(parent instanceof JSReferenceList) { if(parent.getNode().getElementType() == JSElementTypes.EXTENDS_LIST) { final PsiElement element = parent.getParent(); if(element instanceof JSClass) { if(((JSClass) element).isInterface()) { myAcceptOnlyClasses = false; myAcceptOnlyInterfaces = true; } else { myAcceptOnlyClasses = true; myAcceptOnlyInterfaces = false; } } } else { myAcceptOnlyClasses = false; myAcceptOnlyInterfaces = true; } } } ecma = place != null && place.getContainingFile().getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4; }
public static boolean isInlineComponentTag(XmlTag tag) { return COMPONENT_TAG_NAME.equals(tag.getLocalName()) && JavaScriptSupportLoader.isMxmlNs(tag.getNamespace()) && !(tag.getParent() instanceof XmlDocument); }
static ProblemHighlightType getUnresolveReferenceHighlightType(final @Nullable JSExpression qualifier,@NotNull JSExpression node) { JSClass jsClass; final PsiFile containingFile = node.getContainingFile(); if(qualifier != null) { jsClass = JSResolveUtil.findClassOfQualifier(qualifier,containingFile); if(jsClass == null && (qualifier instanceof JSReferenceExpression)) { ResolveResult[] results = ((JSReferenceExpression) qualifier).multiResolve(false); if(results.length != 0) { PsiElement resultElement = results[0].getElement(); String type = null; if(resultElement instanceof JSVariable) { type = ((JSVariable) resultElement).getTypestring(); } else if(resultElement instanceof JSFunction) { type = ((JSFunction) resultElement).getReturnTypestring(); } if("*".equals(type)) { return ProblemHighlightType.LIKE_UNKNowN_SYMBOL; } jsClass = JSResolveUtil.getClassOfContext(resultElement); } } } else { jsClass = JSResolveUtil.getClassOfContext(node); } final boolean ecmaL4File = containingFile.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4; if(jsClass != null && ecmaL4File && (!(jsClass instanceof XmlBackedJSClassImpl) || jsClass.getContainingFile().getFileType() == XmlFileType.INSTANCE)) { final JSAttributeList attributeList = jsClass.getAttributeList(); if(attributeList == null || !attributeList.hasModifier(JSAttributeList.ModifierType.DYNAMIC)) { return ProblemHighlightType.ERROR; } } if(ecmaL4File && jsClass == null && node.getParent() instanceof JSReferenceList) { return ProblemHighlightType.ERROR; } return ProblemHighlightType.LIKE_UNKNowN_SYMBOL; }
@Override public boolean supports(PsiFile file) { return file.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4 || JavaScriptSupportLoader.isFlexMxmFile(file); }
@Override protected ProblemHighlightType getProblemHighlightType(PsiElement location) { return location.getContainingFile().getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4 ? ProblemHighlightType.GENERIC_ERROR:super.getProblemHighlightType(location); }
cordova – 视觉工作室2015年apache cordovo没有在模拟器中运行与空白应用程序项目模板
我也做了以下因为它无法通过注册这个来创建java虚拟机:_JAVA_OPTIONS:-Xmx512M
这是一个错误还是有解决方法?
附加问题:
如何让visual studio 2015询问使用哪个android设备模拟器(类似于eclipse),而不是使用创建的不同模拟器列表中的第一个模拟器.
解决方法
关于如何告诉Visual Studio在模拟器列表中显示不同的模拟器的第二个问题 – 目前还没有办法做到这一点.默认的Android SDK模拟器是硬编码选项,如果安装了Andoird的Visual Studio模拟器也是一个选项.它可能通过加载模拟器然后部署到Device目标(没有插入设备)在其他模拟器上运行,例如Genymotion.
IOS模拟器:JavaScriptCoreWTF :: CrashOnOverflow :: crash:
React Native版本:0.34,
平台:iOS.
将xCode升级到8.0版后启动
解决方法
chmod 644 ~/Library/LaunchAgents/com.github.facebook.watchman.plist
javascript - 如何用webpack+react+PHP搭建网站?
通常php搭建后台的话数据接口是嵌入在网页中的,而webpack+react通常是生成一个html和一个bundle,那么两者如何联合在一起?
回复内容:
通常php搭建后台的话数据接口是嵌入在网页中的,而webpack+react通常是生成一个html和一个bundle,那么两者如何联合在一起?
Webpack 打包之后生成一个.js文件,在 HTML 页面中用<script></script>直接引入这个文件,PHP 只用来发送 HTML 就行了。
PHP只需提供JSON数据即可,其他的全部ReactJS写
除了PHP返回json数据之外,其他与楼上一致
立即学习“PHP免费学习笔记(深入)”;
今天关于javascript – 如何制作Cordova App Live Reload,特别是由webpack构建并在设备或模拟器中运行的介绍到此结束,谢谢您的阅读,有关com.intellij.lang.javascript.JavaScriptSupportLoader的实例源码、cordova – 视觉工作室2015年apache cordovo没有在模拟器中运行与空白应用程序项目模板、IOS模拟器:JavaScriptCoreWTF :: CrashOnOverflow :: crash:、javascript - 如何用webpack+react+PHP搭建网站?等更多相关知识的信息可以在本站进行查询。
本文标签: