Skip to content
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
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

dan2k3k4
Copy link
Member

@dan2k3k4 dan2k3k4 commented Dec 5, 2023

No description provided.

ThaNarie and others added 29 commits March 12, 2017 14:54
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
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants