eclipse-archived/ceylon

resource loading doesn't work in browser

Closed this issue · 5 comments

I can't use ceylon.locale in the Web IDE because apparently Resource.textContent() is not supported in the web browser environment. This is a limitation I was not aware of, and a pretty nasty one!

@chochos I would love to see this issue get fixed...

Apparently this is a dupe of #6034, which seems to explain the cause.

@gavinking then you might need to weigh in on that issue. Are you okay with adding async versions of those methods or do you think we should come up with some other solution?

I've solved this, at least as far as .properties files go, by simply embedding resource text data in the .js file. Each resource file is exported as a field of type String of the JS module.

Sure, it bloats out the .js file of any module like ceylon.locale with a whole lotta resources, but is there really an obviously better way?

I've closed this, and further discussion can go in the original issue #6034.