« first day (3342 days earlier)      last day (1589 days later) » 

12:23 AM
angular > angularjs
 
 
8 hours later…
8:50 AM
Hi, I've been wondering, how to turn on debugging/logging for node.js server, so I could just console.log out the data while getting from client?
I remember I was able to do it few times any months ago, it has something to do with process.debug.LOG_LEVEL, but what precisely and where to put, it forgot.
Anyone knows?
 
9:19 AM
you need to use a special module to log with log levels
I think console.log will simply always log to sysout
 
 
3 hours later…
12:11 PM
I want to make a custom lang that compiles to JS (something like typescript but not as extensive). Does anyone have any suggestions on the easiest way to do it?
 
@JBis well, parse the script into tokens
tokens are anything meaningful to your program. Build a syntax tree with it, ensuring there are no bad tokens
Only after you've made a syntax tree, you can begin converting to javascript equivalent
I don't think you could just use a regex or something if that's where you're getting at
 
@JBis learn to write a meta-interpreter
then the step to an interpreted language (such as TS) is smaller
 
@Neil Once I get it to a syntax tree can something else take over to convert to js?
 
@JBis not really, I mean it's you that gives meaning to the syntax of the language
 
@Neil so what would I use?
@KarelG compile to ts?
 
12:17 PM
@JBis a token parser. You literally just read the characters one at a time and chop of tokens
 
Brutal
 
bahahaha and another meme image comes floating into the sidebar
 
I mean the alternative is to have a very very simple language where you can just say, check for the existence of things like template "name"
 
picollo ?
 
12:33 PM
Hi guys.
 
Ok my Lang is gonna be "HiAPL" (HTML is a programming language) and its gonna use html syntax
 
@Neil What's up, mate? Are you around?
 
@HassanAlthaf yep, in a manner of speaking
 
<string>Yes, @geisterfurz007Stopthischaos</string>
 
12:35 PM
oh JS woke up
 
Run while you can, Wietlol...
JBis is making an HTML programming language.
 
@Neil Hey man, how have you been? I'm working on a react application.
 
what? EW!
 
And it uses an API.
 
@HassanAlthaf how's that been going?
 
12:36 PM
My concern is that the API secret keys could get leaked when everything is bundled together.
 
does your application have users? that need to be signed in?
 
I searched about it, and found suggestions to involve it in the ENV file, bbut the documentation says that the ENV file too gets bundled.
@Wietlol Yes.
 
then perhaps make all web calls use the user authentication
 
@HassanAlthaf you can launch the program passing parameters
so make a literal .bat file that launches the server with the key
 
that way, you, as developer, do not provide the secrets, but they are provided at runtime
 
12:37 PM
this way every installation can be different as well
 
You should not make the API calls from the client side. Use a backend where you can "hide" the API key.
 
@geisterfurz007Stopthischaos but that client needs to call the server
 
@Neil Don't kinda get it.
 
@HassanAlthaf well your web app, you start on the backend
 
@HassanAlthaf are you afraid of leaking third party credentials? or of leaking client secrets to connect to your own back end?
 
12:39 PM
it's just a program ultimately which listens on a port
 
If I were to guess, I would expect that there is no backend yet. Is that correct?
 
any information you pass on the command line isn't part of the program or ENV file
is there a backend?
 
=@geisterfurz007Stopthischaos Uses an external API completely.
Have no control of the backend.
 
ah
 
Tada! Now you can start talking about the actual problem and not one about the backend and not one about the frontend :D
 
12:40 PM
I know I don't have to hardcode the JWT Token that represents the logged in user, so it isn't much of a concern.
The client secret id is supposed to be sensitive
Or, does the JWT Token too need some security measures?
 
@HassanAlthaf to hide anything from the user, you need a backend of your own
 
oh no
 
To summarize: If you have a static API token (as in "a secret string that was given to you by the API for your specific application"), your concerns are valid.
 
@geisterfurz007Stopthischaos That's right. A static API token that allows me to get a JWT token that represents a user.
That static API token goes with every request along with the JWT token.
 
I mean you could include on the page a hyper-encrypted key, and a means to decrypt it, but you see the problem hopefully..
it's all public to the user, so even the means to decrypt said key
 
12:42 PM
They'd already have the code to decrypt it.
 
Since I need to decrypt it anyway in the frontend.
I'm so nervous, I've never played with sensitive APIs in the frontend.
 
Everything that happens in the browser is public. Which is funny when there are pure javascript puzzles where you can just find the price in the source code :')
 
I don't know what I could do wrong.
 
Doing that in the first place.
The only correct thing to do would be to set up a backend for this, really.
 
12:44 PM
So, what I really thought of doing was
Writing a backend API
That I call from the client
 
you can create a backend, which does the sensitive calls for you
 
that is often a very good idea
 
Which will help me to hide the code.
 
call it "middle-end" if you prefer
 
Like a Facade
 
12:45 PM
Correct, yes.
 
yeah, think of it that way
 
but my concern is
Can't another use the same ackend?
*ackend
Call the same API
 
if it is a bundle you share with many other clients, then this is where my idea comes in
 
if you build that middle-end, anyone could use that middle-end api
 
12:45 PM
Yes, in theory that would work. You'd need some form of authentication for your own backend (/middle-end).
 
so, you need to authenticate the requests
 
when you launch the program, you pass a unique key which is different from client to client
the program uses it as the key, and can't pretend to be another client
 
Hi I wanted to take some advice concerning a backend I want to make , react native room is empty , should I shoot here?
 
<if><bool><a/><equal/><b/></bool>
     <log><string>a equals b<string></log>
</if>
 
@LumbusterTick Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
12:46 PM
JBis, please <.<
 
EW
 
@LumbusterTick React Native is not really a backend :)
 
its beautiful
 
its so much boilerplate
 
@geisterfurz007Stopthischaos What kind of auth can I use?
@Neil I don't understand.
 
12:47 PM
its so much lack of open design
its so much html
 
It's just HTML and JS, how can I pass a key?
 
You know in a couple years your boss is gonna be like, "Hey <name>, go learn this new lang I heard about: HiAPL"
 
<name/>
 
@geisterfurz007Stopthischaos You get the idea, CSS would be there too.
 
12:48 PM
Declare variables with non keyword tags
 
@HassanAlthaf your client first downloads the html/js stuff
the server returns those html/js files
 
Wietlol stop >.>
 
it can choose to insert some weird key ;)
 
@HassanAlthaf the backend is the server which hosts those html and js files
 
<x type="string">Hello</x>
 
12:49 PM
Oh, so no SPA?
 
oh, that is still an SPA
 
in reality, even if your website were entirely static, you still need a backend to host it, even if all it does is stupidly give the clientside files in your website
 
And look at the benefit, SO can't close any question as dup
 
in fact, this would only work for SPAs
 
there are cloud hosting sites which do this for you, which hide the backend, but it is still there
 
12:50 PM
lets say my backend is just a simple apache2 server on ubuntu
 
@JBis <if><equal value1="a" value2="a"/></if>
 
@KarelG I want to not the equal!!
 
<not> beforehand
 
@HassanAlthaf <if><not><equal value1="a" value2="a"/></not></if>
 
but that setup has a high chance to have user errors
 
12:52 PM
<if> <not> <complex expression here> </if>
@Neil now that'd work
 
@HassanAlthaf apache tomcat is generally better for building a backend
assuming you want to use java of course
 
Is there any resource on how I can insert the secret keys?
 
alternatively you can use node.js
 
I hate Node :(((((((((
 
@HassanAlthaf it depends on what hosting application you're using, but generally they all accept command line parameters of this nature
 
12:53 PM
@KarelG nah thats awful
 
so, that gets attached to specific requests
by the server?
 
<a/><equal inverse/><b/>
there we go
 
Need to just do
 
<if>
	<condition>
		<not>
			<equal><variable name="a"/><variable name="b"/></equal>
		</not>
	</condition>
	<then><variable name="c"/></then>
	<else><variable name="d"/></else>
</if>
arguments are weird tho
you just place them next to each other
 
Authorization: Bearer <user_specific_token_here>
 
12:55 PM
like equal(a b)
 
@HassanAlthaf yeah, you start off with a backend which says, "everything in this folder, if a request comes in for /context/file, return file in that folder"
 
@Wietlol thats not bad
 
client_id: x,
client_secret: ijrfjourfjoarjfwaejoewkoewjdoajoiejoaewoijeofjofabf
 
12:55 PM
From there, you begin writing servlets or other handlers which deal with specific requests on the backend
 
you need to maintain the tree structure tho
 
classes are defined by using non keywords capital tags
 
@Neil Is there any resource of some sort that I could read/watch?
 
@HassanAlthaf you want to go for a java backend? you're committed?
 
I mean, it's not wrong to give it a shot.
bored of PHP
dont like node
We can try java
 
12:57 PM
@HassanAlthaf no
try HiAPL
 
@JBis I did man, but I realized it's too complicated for a non-Einstein brain.
 
yes its not a backend Indeed but the question is related to a backend
 
java isn't simple :P
but once you're setup, it flows nicely
 
@JBis for example, how does this look?
<property name="name" type="String"/>
 
hmm, how do you create arrays
 
@Neil I've used Java before for Desktop Apps, that do nothing more than CRUD/Auth, etc...
Is it going to be hard for me? :D
 
@Wietlol thats nice but maybe the tag should be the name
 
Hey could I get someones opinion on this web Component:
class CConR extends HTMLElement {
 constructor() {
  super();
  let sh = this.attachShadow({mode: 'open'});
  let st = document.createElement('style');
  st.textContent = "r-r{color:red !important;}";
  sh.appendChild(st);
 }
}
var CConElR = customElements.define('r-r', CConR);
 
you prolly need to get used to the syntax again
@JBis no, it is not
 
It doesnt seem to output any data
yet doesnt have an error
 
12:59 PM
"type" is not a string
look at generics, they arent strings
you need to maintain the structure
 
wdym?
 
<property name="name">
	<type>
		<simpleType name="String"/>
	</type>
</property>
like that
this way, you can add generics, like so
 

« first day (3342 days earlier)      last day (1589 days later) »