Conversation

eli, vampire kitsune

Edited 7 months ago

it’s really weird to me that the import path influences the identity of a type in javascript (at least in firefox, anyway)

import { AType } from './type.js'
import { AType as AType2 } from './/type.js'
import { AType as AType3 } from './type.js'

console.log(AType === AType2) // false
console.log(AType === AType3) // true
1
1
3

@rowan yeah... the . part of the url is resolved by the client but the // isn't: a url with a double slash is technically different and the server could respond to it differently.

wondering about redirects oh this is fun too: https://stackoverflow.com/questions/78785224/how-are-es6-module-imports-with-http-redirects-supposed-to-work

2
0
1

@rowan i think my brother had some horror stories of URL routing that used raw base64 (not URL safe base64) and had to deal with the unnormalized URLs so it could handle repeated slashes in the base64

0
0
1

@monoidmusician oh. oh no. oh no. i hadn’t even thought about the implications regarding redirects neofox_googly_shocked

going to exploit this in my engine by making different instances of the same class in order to differentiate them in the resource handler

import { Meshes as EnvironmentMeshes } from './meshes.js'
import { Meshes as EntityMeshes } from './/meshes.js'
engine.getResource(EnvironmentMeshes)
engine.getResource(EntityMeshes)

neocat_floof

1
0
1

@rowan hehe nice :3 I think you could use query strings too

1
0
1

@monoidmusician ehehe dont worry, im extremely Not going to do the thing i suggested

0
0
2