Skip to content

Use javascript modules#11

Merged
creesch merged 2 commits intoTildes-MC:mainfrom
danthedaniel:js-modules
Dec 16, 2024
Merged

Use javascript modules#11
creesch merged 2 commits intoTildes-MC:mainfrom
danthedaniel:js-modules

Conversation

@danthedaniel
Copy link
Copy Markdown
Member

@danthedaniel danthedaniel commented Dec 16, 2024

This allows for inter-module imports and exports, with sharing of type information. Now we only need one <script /> tag in index.html and the rest of the JS gets connected with import keywords.

Main reason for making this change:

VSCode doesn't understand what type translations or faviconCounter() are unless those files are concurrently open with the files that use those declarations. Previously you would see translations is not declared with a red squiggle.

This allows for inter-module imports and exports, with sharing of
type information. Now we only need one <script /> tag in index.html
and the rest of the JS gets connected with import keywords.
@danthedaniel
Copy link
Copy Markdown
Member Author

One change I should highlight is that initializeObfuscation() is now invoked in chat.mjs. I figured there should only be one main module that performs top-level execution.

@creesch
Copy link
Copy Markdown
Collaborator

creesch commented Dec 16, 2024

Yeah, looks good to me.

@creesch creesch merged commit f79fe05 into Tildes-MC:main Dec 16, 2024
@danthedaniel danthedaniel deleted the js-modules branch December 16, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants