Feat treeshaking: Centralize js dependency management#243
Open
Feat treeshaking: Centralize js dependency management#243
Conversation
DrRataplan
reviewed
Jan 14, 2026
DrRataplan
reviewed
Jan 14, 2026
| When jinks generates an application: | ||
|
|
||
| 1. `modules/generator.xql` loads `config/package.json` | ||
| 2. CDN URLs are pre-computed using `config:cdn-url()` function |
Contributor
There was a problem hiding this comment.
are these parameterized? So load jinn-tap from http://localhost:5174, jinks from resources/scripts and pb-components from CDN
Contributor
Author
There was a problem hiding this comment.
yes, but the current integration with examples: for autosuggestion via jinks.json needs addressing
DrRataplan
requested changes
Jan 14, 2026
This was referenced Jan 14, 2026
Closed
…d apps - Introduced `sync:dependencies` and `validate:dependencies` scripts in package.json. - Added GitHub Actions workflow for syncing shared dependencies from root package.json to config/package.json. - Updated dependabot.yml to monitor dependencies in both root and config directories.
- Added a function to build CDN URLs from the dependencies defined in package.json. - Updated API context to include CDN URLs for swagger-ui and other assets. - Modified HTML templates to conditionally load assets from CDN or fallback to default URLs based on availability.
…ons in package.json - Updated swagger-ui-dist to version 5.31.0. - Updated @jinntec/jinn-codemirror to version 1.18.2.
- Updated annotate.html to use Fore.js version 2.8.0. - Modified base.html and static/base.html to conditionally load Fore.js from CDN if available, with a fallback to the default URL.
- Added new dependencies: theme-toggles and @jinntec/jinntap to package.json. - Updated README.md to clarify CDN URL template usage and overrides. - Improved API and generator modules to dynamically build CDN URLs for all asset types. - Enhanced templates to utilize the new CDN mapping for loading assets conditionally. - Processed styles array to replace hardcoded CDN URLs with templated versions from package.json.
- Added checks for missing base URLs and ensured at least one asset type is defined.
- Validated that all asset type templates contain the {{version}} placeholder, adding appropriate warnings.
- Added `versioning-strategy: increase` to the Dependabot configuration for better version management. - Introduced `package-lock.json` to ensure consistent dependency resolution for automated updates.
- Enhanced the configuration to support profile-specific version overrides in `config/package.json`. - Updated the `effective-version` function to check for overrides based on active profiles. - Modified the CDN URL generation to apply these overrides, ensuring the correct versions are used when building URLs. - Improved documentation in `README.md` to clarify the usage of overrides and their precedence. - Adjusted templates to utilize effective versions for dependencies, enhancing flexibility in version management.
- Updated README.md to emphasize the use of function call syntax. - Modified various HTML templates to implement the new syntax for CDN key access. review comment: jinks#243#discussion_r2689497823
280e01a to
cabc35c
Compare
…and failing links
…ndency management - Added permissions for write access to contents and pull requests. - Updated the checkout step to fetch the full history. - Changed the dependency sync command to use npm script. - Improved change detection logic for config/package.json. - Enhanced commit and push logic to handle branch determination for pull requests.
refactor sync yaml simplify logic
DrRataplan
reviewed
Jan 16, 2026
| ], | ||
| "script": { | ||
| "fore": "1.9.0", | ||
| "fore": "2.8.0", |
Contributor
There was a problem hiding this comment.
this should come from the central config, right?
DrRataplan
reviewed
Jan 16, 2026
| [% if exists($cdn?('jinn-codemirror-bundle')) %] | ||
| <script type="module" src="[[ $cdn?('jinn-codemirror-bundle') ]]"></script> | ||
| [% else %] | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@jinntec/jinn-codemirror@1.17.0/dist/jinn-codemirror-bundle.js"></script> |
Contributor
There was a problem hiding this comment.
can't we do this defaulting in the config.json? Also, this should be 1.18.2 because of that firefox bug
DrRataplan
reviewed
Jan 16, 2026
| <jinn-tap url="[[ $url ]]" name="[[ $context?doc?path ]]" schema="[[ $context?features?jinntap?schema ]]" | ||
| token="[[ jt:jwt-token() ]]" server="[[ $features?collab?server ]]" sidebar="#attributes-panel"> | ||
| [% if exists($features?jinntap?version) and $features?jinntap?version != "dev" %] | ||
| <img slot="aside" class="logo" src="[[ $features?jinntap?cdn ]]@[[ $features?jinntap?version ]]/dist/jinntap-logo-128.png" alt="JinnTap"/> |
Contributor
There was a problem hiding this comment.
why not always get this through the configuration?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Establishes a single source of truth for Node.js dependencies across jinks and generated applications.
Key Changes:
config/package.jsonas centralized registry for all generated-app dependencies$cdnmap instead of hardcoded CDN URLsconfig/package.jsonwithversioning-strategy: increaseconfig.jsonfilesconfig/package-lock.jsonrequired for DependabotBenefits:
should be reviewed after #240 is merged