Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More refactoring for Vite migration #252

Merged
merged 6 commits into from
Sep 5, 2024
Merged

Conversation

rvanasa
Copy link
Contributor

@rvanasa rvanasa commented Sep 4, 2024

Merges into #248.

  • Refactors to use promise instead of global Motoko variable
  • Reintroduces global definition in Vite config to fix compilation error in dev server (unrelated to the above change)

const scriptContent = await response.text();
export const loadMoc = async () => {
if (!mocPromise) {
mocPromise = (async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the global Motoko with mocPromise so that this logic only runs once if loadMoc() is called multiple times before this resolves.

@chenyan-dfinity chenyan-dfinity merged commit 3254f9a into migrate-vite Sep 5, 2024
2 checks passed
@chenyan-dfinity chenyan-dfinity deleted the ryan/migrate-vite branch September 5, 2024 20:23
chenyan-dfinity added a commit that referenced this pull request Sep 5, 2024
* checkpoint

* checkpoint

* handle moc

* worker

* fix

* simplify vite.config

* Refactoring for Vite migration (#249)

* Misc

* Remove extraneous config

* simplify vite.config and bump versions

* bump dependencies

* fix

* fix

* remove eval in didToJs

* fmt

* Update hash for dfx version 0.23.0

* More refactoring for Vite migration (#252)

* Reintroduce 'global' for dev server

* Refactor to use 'Motoko' promise instead of global variable

* Misc

* Only run 'eval()' in 'loadMoc()' at most once

* Reformat

* chunking

* fix

* rename

---------

Co-authored-by: Ryan Vandersmith <[email protected]>
Co-authored-by: krpeacock <[email protected]>
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