drogonframework / drogonframework/drogon

How to Get Dynamic Loading of Views on macOS?

Open
#360 15 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

Dynamic compilation of views works on macOS after I set the configuration variable `load_dynamic_views` as stated in the documentation. I can see the corresponding log output and there’s also a handle from the `dlopen()` call in `loadLibs()`.

Although this mechanism works, I doesn’t look like the framework would pick up these new libraries during its runtime on macOS as I need to restart the process to see newly added CSP output.

**Steps to Reproduce**

1. Create a new Drogon project
2. Set `load_dynamic_views` to `true`
3. Add `../views` to the `dynamic_views_path` configuration array
4. Set `dynamic_views_output_path` to `./`
5. Add `views/Index.csp` and some example content like “Hello, world!”
6. Compile & run the application
7. Open the index page in the browser and verify that it shows “Hello, world!”
8. Edit the `Index.csp` file, for example by changing the string to “Hello, universe!”
9. Wait until the framework picks up the change
9. Reload the page in the browser

**Expected behavior**
The page should output “Hello, universe!”.

**Actual results**
The page still displays “Hello, world!”.

**Desktop:**
- OS: macOS 10.15
- Browser: Safari

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.