forked from zimmo-be/twig-loader
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates from original repo zimmo-be/twig-loader
#4
Open
dan2k3k4
wants to merge
29
commits into
AmazeeLabs:master
Choose a base branch
from
zimmo-be:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Switch the compiler to async mode, to allow webpack to resolve the included resources. The compilation is done in multiple passes until all paths are resolved (most of the time just 1 extra pass). Change the compiler export to a factory function so data can be passed from the loader to the compiler. Because of this structure the mapcache is not needed anymore. Create a util function to correctly generate template IDs that are the same between the loader and the compiler (previously they could differ). They always use the resolved webpack path as source for the ID. Skip dependencies in the token parsing that are not just a string. They will be handled at runtime, and are the responsibility from the template author. Also export the template tokens on the template function, so they can be used to register the template under a different name at runtime. This is useful when dealing with dynamic templates where you want to use `require.context` to bundle and register all your templates in your application bootstrap. Updated the test helper to make empty context available. Added a lot of comments in the code. re #26
Mark a failed resolve as false, so the compiler can ignore that resource and leave it in the template as is, so it can be picked up by Twig at runtime.
When not including `.twig` as extension, it will be added automatically. This is to create a scenario where a file can be resolve by webpack, and two different paths lead to the same resource. Also add a check on disk to allow cases where a template include value only exists at runtime as registered template.
When adding the behavior where a template must exists on disk to have it processed by the loader, the files do need to exist in disk. Also changed the include html to work with a resolve case where the '.twig' extension is added by the webpack resolve function.
These new tests will all fail when run on the old code.
# Conflicts: # README.md # lib/compiler.js # lib/loader.js # package.json
Add async webpack.resolve support
Add support for webpack >= 4.0.0
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.11...4.17.14) Signed-off-by: dependabot[bot] <[email protected]>
….17.14 Bump lodash from 4.17.11 to 4.17.14
[Security fix] Update "minimist" minimum version
Process tokens inside of setcapture
Added apply token
Use additionalProperties keyword in JSON Schema
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.14 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.14...4.17.19) Signed-off-by: dependabot[bot] <[email protected]>
….17.19 Bump lodash from 4.17.14 to 4.17.19
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.
No description provided.