Meteor Privatesources

screenshot of Meteor Privatesources

Create bundles for lazy-loading components, with authentication

Overview

The numtel:privatesources package is a powerful tool designed for developers using the Meteor framework, particularly when handling files in the private directory of an application. This package simplifies the process of client-side lazy loading by allowing users to create a privatesources.json file that details bundles of source files. These files are then efficiently processed and served to clients, optimizing performance and ensuring a smoother user experience.

With rising complexity in web applications, especially those utilizing numerous assets, the transition to the numtel:lazy-bundles package further emphasizes the need for a modernized approach to resource management. This package not only aids in transpiling files but also helps in managing dependencies effectively, making it a valuable addition for Meteor developers.

Features

  • Easy Bundle Description: Create a privatesources.json file to specify bundles of source files, facilitating seamless client-side lazy loading.
  • Automatic Transpilation: Source files are automatically combined and transpiled into single .js and .css files per bundle, streamlining asset delivery.
  • Router Integration: Utilizes the iron:router package for configuring routes, ensuring efficient loading and management of assets.
  • Custom File Naming: Supports flexible naming conventions for JSON files, allowing for easier organization (e.g., myapp.privatesources.json).
  • Template Files Sorting: Automatically sorts HTML files to the top, ensuring that template availability precedes script execution in bundles.
  • Dynamic Asset Loading: Employs the Assets.getText() method to retrieve asset data on the server side, enhancing flexibility and control over asset loading.
  • Authentication Hooks: Features customizable allow() functions for added security, helping to manage client authenticity when accessing assets.
  • Compatibility with Loader Libraries: Works effectively with libraries like miro:preloader and manuelschoebel:wait-on-lib for comprehensive asset management during routing.