Git Product home page Git Product logo

primefaces-mobile-ajax-resources-issue-reproducer's Introduction

PrimeFaces #1759 Reproducer

This project is a reproducer for PrimeFaces #1759: Unecessary non-mobile resources loaded when navigating to PrimeFaces mobile view via Ajax

Steps to reproduce:

  1. Clone the reproducer project:

     git clone https://github.com/stiemannkj1/primefaces-mobile-ajax-resources-issue-reproducer
    
  2. Build the project with maven:

     cd primefaces-mobile-ajax-resources-issue-reproducer && mvn clean install
    
  3. Deploy the project to tomcat:

     cp target/primefaces-mobile-ajax-resources-issue-reproducer*.war $TOMCAT_HOME/webapps/
    
  4. Navigate to index.xhtml (http://localhost:8080/primefaces-mobile-ajax-resources-issue-reproducer-1.0-SNAPSHOT/faces/index.xhtml).

  5. Right click on the page and select Inspect Element.

  6. Click on the Network tab to see what resources are loaded.

  7. Click the page2 h:commandButton.

If the bug still exists, then components.js will be loaded via GET. If the bug is fixed, then components.js and all other non-mobile resources will not be loaded.

Notes:

  • During a non-ajax request, non-mobile resources are suppressed by the PrimeFaces mobile HeadRenderer:

     if(library != null && library.equals("primefaces")) {
     	String resourceName = (String) attrs.get("name");
     	if(resourceName.startsWith("jquery")
     			|| resourceName.startsWith("primefaces")
     			|| resourceName.startsWith("components")
     			|| resourceName.startsWith("core")) {
     		shouldRender = false;
     	}
     }
    
  • This bug only occurs when navigating from pages which do not contain components-mobile.js or components.js already.

  • This bug causes JS errors in a portlet environment.

  • This issue only occurs on PrimeFaces 6.0. This issue does not occur with PrimeFaces 5.3 and below.

primefaces-mobile-ajax-resources-issue-reproducer's People

Contributors

stiemannkj1 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.