Comments (10)
Hello.
In regards to point 1, I will be running some tests and see what is going on. It sounds like a bug.
In regards to point two, that is something of Denjucks. Maybe there can be some workaround if it has the option to configure the template folder where it reads the inclusion. We will check this out but directly, it is not related to Mandarine. Let’s see if there’s some workaround to it
from mandarinets.
@ThauEx I can't seem to reproduce this behavior. Can you confirm the property templateEngine
is inside the property mandarine
?. It should look like this:
"mandarine": {
"templateEngine": {
"engine": "denjucks"
}
}
from mandarinets.
I cleared the cache, but the issue persists. My config looks like this:
{
"mandarine": {
"server": {
"port": 9999
},
"resources": {
"staticFolder": "./public"
},
"templateEngine": {
"path": "./templates",
"engine": "denjucks"
}
}
}
When I enter something invalid as engine, it throws an error. So the config should be correct.
I can try to prepare an example if you want.
from mandarinets.
Sure. Let me see your code, the command you’re running to start up the application, and an screenshot with your folder’s structure (so directories and files). From that I will try to run it and see what’s going on.
from mandarinets.
Okay, great. I will provide it tomorrow (it already late here).
from mandarinets.
Great. Make sure you’ve ran —reload, and your whole app is pointing to @v1.0.1 . Sorry for this inconvenience, when the details are provided I will investigate further.
Regards.
from mandarinets.
@ThauEx Please also provide the code of the template. Regards.
from mandarinets.
Here is a sample project, run it via deno run --config tsconfig.json --allow-net --allow-read --unstable app.ts
It has two endpoints:
http://localhost:9999/test
http://localhost:9999/test2
Both should show the same, but the second one has the template engine configured inside the controller and the first one is taking it from the config (where the same is configured)
project.zip
If you need more, just tell me and thank you for the inventigation.
from mandarinets.
@ThauEx I see why this is happening. I am glad to inform it is not a bug :).
Here is a proof that it's working.
What was happening was, Mandarine.MandarineCore.setConfiguration is deprecated, it should not be used at all since if it's used, then the configuration will load after Mandarine's engine has loaded which when it gets to that point, it will be pointless to load the view engine from the configuration as it has been loaded already with its default value.
Instead, your configuration file must be name properties.json and it should be located in ./src/main/resources (./src/main/resources/properties.json) Please read this section of the documentation to see more
I am attaching your folder with the properties.json inside the directory it's supposed to be, and also for you to test it out, it should be working properly now.
project.zip
In regards to your second request:
And (not sure if it is and issue on view_engine), but when using denjucks and then extend tag ( {% extend 'some_template.html' %}), it's not using the configured template path, but the project root. So when using the configured path from above, I have to use {% extend 'templates/some_template.html'%}. I could do some more research if you want and open another issue for that.
I am afraid we are unable to do this at the time as it would mean to change everything in the engine just to add that feature. We could work this out if our view engine provider makes the required "infrastructure" for it, I highly encourage you to open a ticket for this in the view engine repository and if they make the changes to support this possible feature, then we could adapt it.
Coming back to the original issue: Please read the documentation I have attached, perhaps test the code that I have attached as well, and let me know if this issue was solved so I can close it.
Regards.
from mandarinets.
Thank you very much. I have not noticed the deprecation of Mandarine.MandarineCore.setConfiguration
.
For the scond thing, I will have a look on view-engine
and will maybe open an issue there.
from mandarinets.
Related Issues (20)
- Configuration should be set programatically HOT 1
- Implement service loader by JSON
- Create task scheduler
- Creates mandarine web sockets HOT 1
- Generics when getting dependencies manually HOT 1
- Expose Mandarine Security Expressions Evaluator HOT 1
- 3.0.0 Release Checklist
- Build Mandarine's first microservice factory. HOT 1
- Issue: @Session() injection undefined on windows HOT 7
- CORS preflight requests broken HOT 2
- Database connection could not be reached HOT 14
- custom view path not honored when using denjucks template engine
- Decorator finder processes for a long time or inifinitely
- Make project name more clean: `Mandarine` instead of `Mandarine.TS`
- Error on startup: `error: TS2339 [ERROR]: Property 'toPrimitive' does not exist on type 'never'.` HOT 6
- Severarl Errors: error: 'getIterator', 'toPrimitive', 'iterator' in main-core/reflectMetadata.ts HOT 1
- Async implementation of the loadUserByUsername function of UserDetailsService
- Requested module does not provide export named 'Middleware'
- `https://www.mandarinets.org/` could not be served HOT 1
- Is Mandarine actively developed?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mandarinets.