Skip to content

Some stdlib exports are undefinedΒ #2

@veryboringhwl

Description

@veryboringhwl

πŸ” Have you checked Spicetify.app page for your issue?

  • I have checked the FAQ

πŸ” Is there already an issue for your problem?

  • I have checked older issues, open and closed

β„Ή Environment / Computer Info

- Spotify version: 1.2.89
- Spicetify version: v3

πŸ“ Description

Some exports in v3 are undefined even though the regex replacement appears to succeed correctly.

Broken exports:

  • Panel
  • Snackbar
  • ReactFlipToolkit
  • ContextMenu
  • Tippy (idk if we should even keep this when tootip component exists)

These same regexes work correctly in v2.

Snackbar Example

This does not work:

const { enqueueSnackbar } = await import("/modules/stdlib/src/expose/Snackbar.js");
console.log(enqueueSnackbar);

But as alternative the notistack react hook which is exposed with webpack works:

import { useSnackbar } from "/modules/stdlib/src/webpack/Snackbar.js";
const { enqueueSnackbar } = useSnackbar();

Panel example

This transform works in v2 but returns undefined in v3:

V2

preprocess.go

{
	Name: "panel",
	Regex: `(=\(0,[a-zA-Z_$][\w$]*\.[a-zA-Z_$][\w$]*\)\(\{id:"RightPanelState)`,
	Replacement: func(submatches ...string) string {
		return fmt.Sprintf(`=globalThis.Spicetify.PanelMachine%s`, submatches[1])
	},
},

console.log(Spicetify.PanelMachine); this returns the machine object

V3

const { Machine } = await import("/modules/stdlib/src/registers/Panel.js");

console.log(Machine); this returns undefined

πŸ“Έ Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions