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

Dynamic loader, Dexie ESM fix #315

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

jbukl
Copy link

@jbukl jbukl commented Nov 11, 2023

encountered errors with the dynamic loader (when opening search.html) and dexie (import dictionary collection). the former I didn't actually see any visual errors other than the popup on search.html being broken, but errors showed up in console.

  • dynamic loader loads in scripts as modules - don't know anything about how this loader works, but upon seeing the error, I assumed dynamic loading could have caused it, and this seemed to fix it
  • dynamic loader checks sentinel script using import.meta instead of document.currentScript - latter does not exist in modules
  • import both dexie and the dexie-export-import addon, then export the updated Dexie object
  • prevent vscode organizeImports from inserting spaces at ends of braces

have not tested with firefox - I assume it should be compatible, but noting that in case.

Copy link

github-actions bot commented Nov 11, 2023

✔️ No visual differences introduced by this PR.

View Playwright Report (note: open the "playwright-report" artifact)

@jbukl jbukl force-pushed the dynamic-loader-modules branch from 47f05fc to 7ee2e6c Compare November 11, 2023 02:36
Fix dynamic loader script check
@jbukl jbukl force-pushed the dynamic-loader-modules branch from 7ee2e6c to bc695c2 Compare November 11, 2023 02:37
@jbukl jbukl changed the title Dynamic loader ESM fix Dynamic loader, Dexie ESM fix Nov 11, 2023
@jbukl jbukl marked this pull request as ready for review November 11, 2023 16:42
@jbukl jbukl requested a review from a team as a code owner November 11, 2023 16:42
@djahandarie djahandarie added this pull request to the merge queue Nov 12, 2023
@djahandarie djahandarie added the kind/bug The issue or PR is regarding a bug label Nov 12, 2023
Merged via the queue into yomidevs:master with commit f263e99 Nov 12, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug The issue or PR is regarding a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants