Skip to content

Refactor for v2 #6

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

Merged
merged 1 commit into from
Nov 11, 2021
Merged

Refactor for v2 #6

merged 1 commit into from
Nov 11, 2021

Conversation

mdingena
Copy link
Owner

Changelog (⚠️ breaking changes!)

If you upgrade to v2, you will need to refactor your code:

  • Removed PrefabHash export.
  • Removed PrefabSlot export.
  • Renamed Prefab export to PrefabData.
  • Added Prefab export containing combined data from v1 PrefabHash and PrefabSlot.

Update your code:

- import { createString, Prefab, PrefabHash, PrefabSlot } from 'att-string-transcoder';
+ import { createString, Prefab, PrefabData } from 'att-string-transcoder';

- const guard: Prefab = {
+ const guard: PrefabData = {
    prefabObject: {
-     hash: PrefabHash.Large_Guard_Rectangle
+     hash: Prefab.Large_Guard_Rectangle.hash
    },
    childPrefabs: [
      {
-       parentHash: PrefabSlots.Large_Guard_Rectangle.Slot_Large_SwordType,
+       parentHash: Prefab.Large_Guard_Rectangle.slots.Slot_Large_SwordType,
        prefab: blade
      }
    ]
  };

  const string = createString(guard);

@mdingena mdingena merged commit dfa873a into main Nov 11, 2021
@mdingena mdingena deleted the v2.0.0 branch November 11, 2021 03:49
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.

1 participant