framework icon indicating copy to clipboard operation
framework copied to clipboard

How can I change the isomorphic namespace to custom one in client side

Open ameykshirsagar opened this issue 10 years ago • 7 comments

Hi, I would like to know where I can change the window.isomorphic namespace to another one from total.js framework itself??

Thank you

ameykshirsagar avatar Aug 12 '16 18:08 ameykshirsagar

Hi @ameykshirsagar you can change it in config file see this https://docs.totaljs.com/latest/en.html#api~FrameworkConfiguration~directory-isomorphic

molda avatar Aug 12 '16 18:08 molda

@molda : Thank you

ameykshirsagar avatar Aug 12 '16 18:08 ameykshirsagar

@ameykshirsagar this is not possible what you want. Maybe we can add a new option for it, but this is not good solution. Thanks!

petersirka avatar Aug 12 '16 19:08 petersirka

@petersirka : I was asking about it because window.isomorphic as a namespace exposed in window object can be too obvious to find out the isomorphic function's internals via browser's developer tools as it straight away prints out the entire isomorphic function. It could probably be good to follow the folder's name as a namespace so that the user can create its own namespace easily. What do you say??

ameykshirsagar avatar Aug 12 '16 19:08 ameykshirsagar

Your idea is not possible for the current state, but we can add e.g. exports.namespace="mycode" and the framework registers this namespace as a global variable for both sides (server/client). This is possible.

petersirka avatar Aug 12 '16 19:08 petersirka

@petersirka : Cool. No issues. For now I shall do the masking on the client side.

ameykshirsagar avatar Aug 12 '16 19:08 ameykshirsagar

I have looked into it and it's very hard to add it. The isomorphic variable is initialized before the framework is loaded and according this variable is created a mapping. I wonder that this is not good idea and I tought that the implemetation will be more simple. I hope that you have a solution for it now.

Sorry 👎

petersirka avatar Aug 19 '16 06:08 petersirka