{"id":26105,"library":"primefaces","title":"PrimeFaces","description":"PrimeFaces is a popular open-source UI component library for JavaServer Faces (JSF) with a rich set of over 100 components for enterprise web applications. The npm package 'primefaces' provides TypeScript type definitions for PrimeFaces client-side JavaScript API. Version 14.0.0 is the current stable release as per the given data, but the latest tagged release is 15.0.14. The library has a high release cadence (multiple minor releases per month) and is actively maintained by the PrimeFaces team. Key differentiators include extensive theme support, built-in AJAX, and a large component set. Peer dependencies include hammerjs, component-emitter, keycharm, propagating-hammerjs, and uuid for gesture and event support.","status":"active","version":"14.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/primefaces/primefaces","tags":["javascript","typescript"],"install":[{"cmd":"npm install primefaces","lang":"bash","label":"npm"},{"cmd":"yarn add primefaces","lang":"bash","label":"yarn"},{"cmd":"pnpm add primefaces","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for gesture/touch event handling in PrimeFaces components","package":"@egjs/hammerjs","optional":false},{"reason":"Used for event emitter pattern in PrimeFaces client-side API","package":"component-emitter","optional":false},{"reason":"Manages keyboard shortcuts and key bindings","package":"keycharm","optional":false},{"reason":"Enables event propagation for hammer.js gestures","package":"propagating-hammerjs","optional":false},{"reason":"Generates unique identifiers for PrimeFaces components","package":"uuid","optional":false}],"imports":[{"note":"The 'primefaces' package only provides TypeScript type definitions. Import side-effects to register global types. Do not use require; the package does not export any runtime values.","wrong":"const PrimeFaces = require('primefaces')","symbol":"PrimeFaces","correct":"import 'primefaces'"},{"note":"PF is a global function provided by PrimeFaces runtime, not a named export from the types package. Importing 'primefaces' adds type declarations for the global PF object.","wrong":"import { PF } from 'primefaces'","symbol":"PF","correct":"import 'primefaces'"},{"note":"PrimeFaces is a global namespace. The types package augments the global scope. Do not attempt named imports.","wrong":"import { PrimeFaces } from 'primefaces'","symbol":"PrimeFaces.widget.WidgetName","correct":"import 'primefaces'"},{"note":"PrimeFaces type definitions depend on jQuery types. Ensure jQuery type definitions are imported first (or tsconfig includes jQuery).","wrong":"import 'primefaces';\nimport 'jquery';","symbol":"JQuery","correct":"import 'jquery';\nimport 'primefaces';"}],"quickstart":{"code":"// Ensure jQuery type definitions are available\nimport 'jquery';\nimport 'primefaces';\n\n// Use PF global function to get a widget instance\nconst dialog = PF('myDialog');\nif (dialog) {\n  dialog.show();\n}\n\n// Access PrimeFaces settings\nPrimeFaces.settings.locale = 'en';\n\n// Use PrimeFaces ajax utility\nPrimeFaces.ajax.AjaxRequest({\n  url: '/my-endpoint',\n  oncomplete: function(xhr, status, args) {\n    console.log('AJAX complete');\n  }\n});\n\n// Use component widget API\ndeclare const myAutoComplete: any; // Assume widget var from view\nmyAutoComplete.search('query');\n","lang":"typescript","description":"Demonstrates importing PrimeFaces types, using the global PF function, accessing PrimeFaces settings, making an AJAX request, and calling a widget method."},"warnings":[{"fix":"Review type changes in component options interfaces (e.g., DialogOptions, DataTableOptions). Check migration guide.","message":"In PrimeFaces 14+, the type definitions have been restructured. Some component options interfaces have changed.","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Replace widget.update() with widget.refresh()","message":"The 'update' method on widgets is deprecated in favor of 'refresh'.","severity":"deprecated","affected_versions":">=13.0.0"},{"fix":"Include primefaces.jar in your Java web app or use a CDN. The npm types are for client-side type checking only.","message":"This package only provides TypeScript type definitions, not the PrimeFaces library itself. You must include the PrimeFaces runtime (JS) separately, typically via a JSF taglib or build.","severity":"gotcha","affected_versions":"*"},{"fix":"Update jQuery types to version compatible with jQuery 4.0.0 (e.g., @types/jquery@4.x). Test custom scripts.","message":"jQuery dependency upgrade: PrimeFaces 15.0.13 upgraded to jQuery 4.0.0, which may break custom jQuery plugins or older type definitions.","severity":"breaking","affected_versions":">=15.0.13"},{"fix":"Use the new filter signature: filter(field, value, type) with optional parameters.","message":"The 'PrimeFaces.widget.DataTable' 'filter' method signature changed; old signature deprecated.","severity":"deprecated","affected_versions":">=14.0.0"},{"fix":"Add a declaration file (e.g., globals.d.ts) with declare const PF: (id: string) => any; or use a triple-slash directive.","message":"The type definitions rely on global augmentation. If your tsconfig has 'strict: true', you may need to declare global variables like 'PF'.","severity":"gotcha","affected_versions":"*"},{"fix":"Update column width expressions that use calc() to use the new syntax as per migration notes.","message":"PrimeFaces 15.0.11 introduced a breaking change in Datatable/TreeTable column width unit handling with CSS calc() function.","severity":"breaking","affected_versions":">=15.0.11"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Import with side-effect: import 'primefaces'; Then use PrimeFaces as a global.","cause":"The package does not export PrimeFaces as a named export; it augments the global scope.","error":"Cannot find name 'PrimeFaces'. Did you mean the module 'primefaces'?"},{"fix":"Import the primefaces package: import 'primefaces'; This adds global declarations for PF and PrimeFaces.","cause":"PF is a global function provided by PrimeFaces runtime, not declared in the type definitions unless imported.","error":"Cannot find name 'PF'. Do you need to install type definitions for a test runner?"},{"fix":"Ensure PrimeFaces JavaScript library is included (e.g., via JSF tag or script tag). The npm types only provide type checking, not the runtime.","cause":"The type definitions are present but the PrimeFaces runtime is not loaded in the browser.","error":"TypeError: PrimeFaces.ajax.AjaxRequest is not a function"},{"fix":"Use import 'primefaces'; instead of import Something from 'primefaces';.","cause":"The 'primefaces' package has no default export; it's a types-only package.","error":"Module 'primefaces' resolves to a type-only module. Imported module requires a default import."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}