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

[feature] Support "pragmas" #1197

Open
janhancic opened this issue Jan 30, 2015 · 1 comment
Open

[feature] Support "pragmas" #1197

janhancic opened this issue Jan 30, 2015 · 1 comment
Labels

Comments

@janhancic
Copy link
Contributor

On number of different occasions have different people identified that it would be really useful if BRJS supported some sort of "pragma" functionality.

Best explained with an example

#if DEV
console.log('foo');
#endif

BRJS would then strip this code block when creating a WAR/flat file export.

There are numerous use cases: logging that should only be in when developing, assertions, benchamrking code, etc

I'm not proposing the syntax with this, just opening the feature request up for discussion.

It would be nice if we were also able to define custom pragmas, so that we could wrap certain bits of apps in this pragmas, and then strip them out depending on for which client we are building the app. <- haven't thought this one trough entirely.

@andy-berry-dev
Copy link
Member

We have this feature for WEB.xml which I can see being useful. I wonder whether having it within JS/HTML etc may lead to bad habits though.

This could done via #749 allow the use of tokens when exporting to static files where a config option set in a properties file can be used with an if/else in JS to optionally log something etc. - with this option the JS would still by present in every environment though instead of being filtered at 'build' time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants