LinkedSoftwareDependencies / Components.js

🧩 A semantic dependency injection framework
https://componentsjs.readthedocs.io/
Other
41 stars 6 forks source link

Allow context validation in componentsjs-compile-config to be skipped #55

Open RubenVerborgh opened 3 years ago

RubenVerborgh commented 3 years ago

Issue type:


Description:

When working on CSS, we noticed that our validation script went from seconds to minutes between 3.x and 4.x:

componentsjs-compile-config urn:solid-server:default:Initializer -c config/default.json -f > /dev/null

Environment:

4.x

Crash log:

github-actions[bot] commented 3 years ago

Thanks for reporting!

rubensworks commented 3 years ago

Yes, I'm aware of this (and this is intentional).

That's because of the type-scoped context functionality that is very expensive to handle according to the spec (background: https://github.com/rubensworks/jsonld-context-parser.js/issues/34). The expensive part of the algorithm is usually not needed, so it's disabled in most cases for Components.js. However, I've decided to enable the expensive check when compiling a config, since this is usually not done so often.

(it used to run for much longer than minutes, so it has already been optimized a lot 😅 )

If needed, we can add a CLI param to componentsjs-compile-config to disable this check?

RubenVerborgh commented 3 years ago

If needed, we can add a CLI param to componentsjs-compile-config to disable this check?

I'd love that. Thanks!

RubenVerborgh commented 3 years ago

Another idea: in CSS, I would probably first do the fast check, and then the slow one, just as a smoke test. Maybe that is interesting behavior too.

rubensworks commented 3 years ago

For future reference, the internals are already in place to do this. It's just a matter of adding the arg here: